Open App Settings tapping a Codename One Button












1















Is there any code that I can insert in the ActionListener of a Codename One Button to open the app settings on iPhone and on Android?



I saw something similar in other apps, for example to help the user to manually change the app permissions. In my case, I'd like to easily open the app settings to inspect the amount of total storage taken by the app (as suggested in https://stackoverflow.com/a/53992872/2670744) and other infos provided by Android and iOS.










share|improve this question



























    1















    Is there any code that I can insert in the ActionListener of a Codename One Button to open the app settings on iPhone and on Android?



    I saw something similar in other apps, for example to help the user to manually change the app permissions. In my case, I'd like to easily open the app settings to inspect the amount of total storage taken by the app (as suggested in https://stackoverflow.com/a/53992872/2670744) and other infos provided by Android and iOS.










    share|improve this question

























      1












      1








      1


      1






      Is there any code that I can insert in the ActionListener of a Codename One Button to open the app settings on iPhone and on Android?



      I saw something similar in other apps, for example to help the user to manually change the app permissions. In my case, I'd like to easily open the app settings to inspect the amount of total storage taken by the app (as suggested in https://stackoverflow.com/a/53992872/2670744) and other infos provided by Android and iOS.










      share|improve this question














      Is there any code that I can insert in the ActionListener of a Codename One Button to open the app settings on iPhone and on Android?



      I saw something similar in other apps, for example to help the user to manually change the app permissions. In my case, I'd like to easily open the app settings to inspect the amount of total storage taken by the app (as suggested in https://stackoverflow.com/a/53992872/2670744) and other infos provided by Android and iOS.







      codenameone






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 1 at 10:47









      Francesco GalganiFrancesco Galgani

      1,407613




      1,407613
























          1 Answer
          1






          active

          oldest

          votes


















          1














          I haven't tried this but execute("app-settings:") (from Display or CN) might work. If not you will need to use native code, specifically:



          [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];


          As mentioned here: How to open settings from my iPad application (Objective-C)






          share|improve this answer
























          • Thank you. For completeness: execute("app-settings:") works on iOS only. On Android, I needed to create a native interface, that I shared here: gist.github.com/jsfan3/3397f1cf7853532ddc9c56a09aae8b3b

            – Francesco Galgani
            Jan 2 at 23:52













          • Sorry I missed the point where you asked about Android. I'm pretty sure there is an execute string we can use to launch that too

            – Shai Almog
            Jan 3 at 3:18











          • I tried to search the String "app-settings" in the Codename One sources, but I didn't find it. So that feature is not implemented by Codename One, but is it implemented by the operating system (iOS in this case)? I'm interested in a list of these Strings because if they exist then they can be useful, however I didn't find documentation.

            – Francesco Galgani
            Jan 3 at 9:34






          • 1





            Just google iphone url schemes. This is the current top result: ios.gadgethacks.com/news/… I wrote about this a while back and back then there was a different top result. You can also expose your own app using a similar URL scheme of your own

            – Shai Almog
            Jan 4 at 3:22











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53994831%2fopen-app-settings-tapping-a-codename-one-button%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          I haven't tried this but execute("app-settings:") (from Display or CN) might work. If not you will need to use native code, specifically:



          [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];


          As mentioned here: How to open settings from my iPad application (Objective-C)






          share|improve this answer
























          • Thank you. For completeness: execute("app-settings:") works on iOS only. On Android, I needed to create a native interface, that I shared here: gist.github.com/jsfan3/3397f1cf7853532ddc9c56a09aae8b3b

            – Francesco Galgani
            Jan 2 at 23:52













          • Sorry I missed the point where you asked about Android. I'm pretty sure there is an execute string we can use to launch that too

            – Shai Almog
            Jan 3 at 3:18











          • I tried to search the String "app-settings" in the Codename One sources, but I didn't find it. So that feature is not implemented by Codename One, but is it implemented by the operating system (iOS in this case)? I'm interested in a list of these Strings because if they exist then they can be useful, however I didn't find documentation.

            – Francesco Galgani
            Jan 3 at 9:34






          • 1





            Just google iphone url schemes. This is the current top result: ios.gadgethacks.com/news/… I wrote about this a while back and back then there was a different top result. You can also expose your own app using a similar URL scheme of your own

            – Shai Almog
            Jan 4 at 3:22
















          1














          I haven't tried this but execute("app-settings:") (from Display or CN) might work. If not you will need to use native code, specifically:



          [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];


          As mentioned here: How to open settings from my iPad application (Objective-C)






          share|improve this answer
























          • Thank you. For completeness: execute("app-settings:") works on iOS only. On Android, I needed to create a native interface, that I shared here: gist.github.com/jsfan3/3397f1cf7853532ddc9c56a09aae8b3b

            – Francesco Galgani
            Jan 2 at 23:52













          • Sorry I missed the point where you asked about Android. I'm pretty sure there is an execute string we can use to launch that too

            – Shai Almog
            Jan 3 at 3:18











          • I tried to search the String "app-settings" in the Codename One sources, but I didn't find it. So that feature is not implemented by Codename One, but is it implemented by the operating system (iOS in this case)? I'm interested in a list of these Strings because if they exist then they can be useful, however I didn't find documentation.

            – Francesco Galgani
            Jan 3 at 9:34






          • 1





            Just google iphone url schemes. This is the current top result: ios.gadgethacks.com/news/… I wrote about this a while back and back then there was a different top result. You can also expose your own app using a similar URL scheme of your own

            – Shai Almog
            Jan 4 at 3:22














          1












          1








          1







          I haven't tried this but execute("app-settings:") (from Display or CN) might work. If not you will need to use native code, specifically:



          [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];


          As mentioned here: How to open settings from my iPad application (Objective-C)






          share|improve this answer













          I haven't tried this but execute("app-settings:") (from Display or CN) might work. If not you will need to use native code, specifically:



          [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];


          As mentioned here: How to open settings from my iPad application (Objective-C)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 1 at 12:54









          Shai AlmogShai Almog

          40.8k52555




          40.8k52555













          • Thank you. For completeness: execute("app-settings:") works on iOS only. On Android, I needed to create a native interface, that I shared here: gist.github.com/jsfan3/3397f1cf7853532ddc9c56a09aae8b3b

            – Francesco Galgani
            Jan 2 at 23:52













          • Sorry I missed the point where you asked about Android. I'm pretty sure there is an execute string we can use to launch that too

            – Shai Almog
            Jan 3 at 3:18











          • I tried to search the String "app-settings" in the Codename One sources, but I didn't find it. So that feature is not implemented by Codename One, but is it implemented by the operating system (iOS in this case)? I'm interested in a list of these Strings because if they exist then they can be useful, however I didn't find documentation.

            – Francesco Galgani
            Jan 3 at 9:34






          • 1





            Just google iphone url schemes. This is the current top result: ios.gadgethacks.com/news/… I wrote about this a while back and back then there was a different top result. You can also expose your own app using a similar URL scheme of your own

            – Shai Almog
            Jan 4 at 3:22



















          • Thank you. For completeness: execute("app-settings:") works on iOS only. On Android, I needed to create a native interface, that I shared here: gist.github.com/jsfan3/3397f1cf7853532ddc9c56a09aae8b3b

            – Francesco Galgani
            Jan 2 at 23:52













          • Sorry I missed the point where you asked about Android. I'm pretty sure there is an execute string we can use to launch that too

            – Shai Almog
            Jan 3 at 3:18











          • I tried to search the String "app-settings" in the Codename One sources, but I didn't find it. So that feature is not implemented by Codename One, but is it implemented by the operating system (iOS in this case)? I'm interested in a list of these Strings because if they exist then they can be useful, however I didn't find documentation.

            – Francesco Galgani
            Jan 3 at 9:34






          • 1





            Just google iphone url schemes. This is the current top result: ios.gadgethacks.com/news/… I wrote about this a while back and back then there was a different top result. You can also expose your own app using a similar URL scheme of your own

            – Shai Almog
            Jan 4 at 3:22

















          Thank you. For completeness: execute("app-settings:") works on iOS only. On Android, I needed to create a native interface, that I shared here: gist.github.com/jsfan3/3397f1cf7853532ddc9c56a09aae8b3b

          – Francesco Galgani
          Jan 2 at 23:52







          Thank you. For completeness: execute("app-settings:") works on iOS only. On Android, I needed to create a native interface, that I shared here: gist.github.com/jsfan3/3397f1cf7853532ddc9c56a09aae8b3b

          – Francesco Galgani
          Jan 2 at 23:52















          Sorry I missed the point where you asked about Android. I'm pretty sure there is an execute string we can use to launch that too

          – Shai Almog
          Jan 3 at 3:18





          Sorry I missed the point where you asked about Android. I'm pretty sure there is an execute string we can use to launch that too

          – Shai Almog
          Jan 3 at 3:18













          I tried to search the String "app-settings" in the Codename One sources, but I didn't find it. So that feature is not implemented by Codename One, but is it implemented by the operating system (iOS in this case)? I'm interested in a list of these Strings because if they exist then they can be useful, however I didn't find documentation.

          – Francesco Galgani
          Jan 3 at 9:34





          I tried to search the String "app-settings" in the Codename One sources, but I didn't find it. So that feature is not implemented by Codename One, but is it implemented by the operating system (iOS in this case)? I'm interested in a list of these Strings because if they exist then they can be useful, however I didn't find documentation.

          – Francesco Galgani
          Jan 3 at 9:34




          1




          1





          Just google iphone url schemes. This is the current top result: ios.gadgethacks.com/news/… I wrote about this a while back and back then there was a different top result. You can also expose your own app using a similar URL scheme of your own

          – Shai Almog
          Jan 4 at 3:22





          Just google iphone url schemes. This is the current top result: ios.gadgethacks.com/news/… I wrote about this a while back and back then there was a different top result. You can also expose your own app using a similar URL scheme of your own

          – Shai Almog
          Jan 4 at 3:22




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53994831%2fopen-app-settings-tapping-a-codename-one-button%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas