How to detect check or identify app is running on Android Go edition 8.1 Device programaticallyHow to check if a service is running on Android?Is quitting an application frowned upon?What is the simplest and most robust way to get the user's current location on Android?'App not Installed' Error on AndroidHow do I get the APK of an installed app without root access?How to detect device is Android phone or Android tablet?How to avoid reverse engineering of an APK file?Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?What are the Android SDK build-tools, platform-tools and tools? And which version should be used?Mipmap drawables for icons

Why don't short runways use ramps for takeoff?

Is this mechanically safe?

How do I safety check that there is no light in Darkroom / Darkbag?

Best Ergonomic Design for a handheld ranged weapon

How does one get a visa to go to Saudi Arabia?

Being told my "network" isn't PCI Complaint. I don't even have a server! Do I have to comply?

Has the US government provided details on plans to deal with AIDS and childhood cancer?

When did J.K. Rowling decide to make Ron and Hermione a couple?

Please explain the difference in the order of naming Tzelafchad's daughters

How to compare files with diffrent extensions and delete extra files?

Can living where magnetic ore is abundant provide any protection from cosmic radiation?

How to structure presentation to avoid getting questions that will be answered later in the presentation?

Does the problem of P vs NP come under the category of Operational Research?

How to escape forward slashes?

IBM mainframe classic executable file formats

May a hotel provide accommodation for fewer people than booked?

Can machine learning learn a function like finding maximum from a list?

Why are sugars in whole fruits not digested the same way sugars in juice are?

How can a class have multiple methods without breaking the single responsibility principle

Is this popular optical illusion made of a grey-scale image with coloured lines?

UX writing: When to use "we"?

Error with uppercase in titlesec's label field

Basic transistor circuit

Is Norway in the Single Market?



How to detect check or identify app is running on Android Go edition 8.1 Device programatically


How to check if a service is running on Android?Is quitting an application frowned upon?What is the simplest and most robust way to get the user's current location on Android?'App not Installed' Error on AndroidHow do I get the APK of an installed app without root access?How to detect device is Android phone or Android tablet?How to avoid reverse engineering of an APK file?Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?What are the Android SDK build-tools, platform-tools and tools? And which version should be used?Mipmap drawables for icons






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








5















I'd like to disable some features and reduce memory consumption on Android Go Devices. I'd like to have one APK for all Android devices.



How do I detect that my app is running on an Android Go 8.1 Device?
Is it sufficient to check for version 8.1 or will 8.1 version be distributed to normal Android Devices as well?










share|improve this question
























  • There's a full 8.1 build.

    – chrylis
    May 6 '18 at 7:16






  • 1





    @chrylis what do you mean?

    – bentzy
    May 7 '18 at 11:01











  • Android 8.1 is already shipping on the Pixel 2.

    – chrylis
    May 7 '18 at 16:13

















5















I'd like to disable some features and reduce memory consumption on Android Go Devices. I'd like to have one APK for all Android devices.



How do I detect that my app is running on an Android Go 8.1 Device?
Is it sufficient to check for version 8.1 or will 8.1 version be distributed to normal Android Devices as well?










share|improve this question
























  • There's a full 8.1 build.

    – chrylis
    May 6 '18 at 7:16






  • 1





    @chrylis what do you mean?

    – bentzy
    May 7 '18 at 11:01











  • Android 8.1 is already shipping on the Pixel 2.

    – chrylis
    May 7 '18 at 16:13













5












5








5


2






I'd like to disable some features and reduce memory consumption on Android Go Devices. I'd like to have one APK for all Android devices.



How do I detect that my app is running on an Android Go 8.1 Device?
Is it sufficient to check for version 8.1 or will 8.1 version be distributed to normal Android Devices as well?










share|improve this question














I'd like to disable some features and reduce memory consumption on Android Go Devices. I'd like to have one APK for all Android devices.



How do I detect that my app is running on an Android Go 8.1 Device?
Is it sufficient to check for version 8.1 or will 8.1 version be distributed to normal Android Devices as well?







java android android-8.1-oreo android-go






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 6 '18 at 5:54









bentzybentzy

7192 gold badges11 silver badges26 bronze badges




7192 gold badges11 silver badges26 bronze badges















  • There's a full 8.1 build.

    – chrylis
    May 6 '18 at 7:16






  • 1





    @chrylis what do you mean?

    – bentzy
    May 7 '18 at 11:01











  • Android 8.1 is already shipping on the Pixel 2.

    – chrylis
    May 7 '18 at 16:13

















  • There's a full 8.1 build.

    – chrylis
    May 6 '18 at 7:16






  • 1





    @chrylis what do you mean?

    – bentzy
    May 7 '18 at 11:01











  • Android 8.1 is already shipping on the Pixel 2.

    – chrylis
    May 7 '18 at 16:13
















There's a full 8.1 build.

– chrylis
May 6 '18 at 7:16





There's a full 8.1 build.

– chrylis
May 6 '18 at 7:16




1




1





@chrylis what do you mean?

– bentzy
May 7 '18 at 11:01





@chrylis what do you mean?

– bentzy
May 7 '18 at 11:01













Android 8.1 is already shipping on the Pixel 2.

– chrylis
May 7 '18 at 16:13





Android 8.1 is already shipping on the Pixel 2.

– chrylis
May 7 '18 at 16:13












2 Answers
2






active

oldest

votes


















3














There doesn't seems to be direct api for retrieving whether app is running on GO version.



But you may cover the case by combination of following :




  • based on device memory and deciding on threshold value for your app:



    private ActivityManager.MemoryInfo getAvailableMemory() 
    ActivityManager activityManager =
    (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);
    ActivityManager.MemoryInfo memoryInfo = new
    ActivityManager.MemoryInfo();
    activityManager.getMemoryInfo(memoryInfo);
    return memoryInfo;




  • Further similar steps can be take for particular model/manufacturer :



    String deviceName = android.os.Build.MODEL;
    String deviceMan = android.os.Build.MANUFACTURER;


Hope it helps.






share|improve this answer


































    1














    This works for me, based on preinstalled Apps.



    If Assistant Go or Google Go versions are installed, definitely is an Android Go device.



    In rare cases that these apps didn't come preinstalled we look for Gmail Go and also Youtube Go preinstalled.



    Tested on Huawei Y5 Lite with Android 8.1 (Go).




    public static boolean isAndroidGoEdition(Context context)
    final String GMAIL_GO = "com.google.android.gm.lite";
    final String YOUTUBE_GO = "com.google.android.apps.youtube.mango";
    final String GOOGLE_GO = "com.google.android.apps.searchlite";
    final String ASSISTANT_GO = "com.google.android.apps.assistant";

    boolean isGmailGoPreInstalled = isPreInstalledApp(context, GMAIL_GO);
    boolean isYoutubeGoPreInstalled = isPreInstalledApp(context, YOUTUBE_GO);
    boolean isGoogleGoPreInstalled = isPreInstalledApp(context, GOOGLE_GO);
    boolean isAssistantGoPreInstalled = isPreInstalledApp(context, ASSISTANT_GO);

    if(isGoogleGoPreInstalled

    private static boolean isPreInstalledApp(Context context, String packageName)
    try
    PackageManager pacMan = context.getPackageManager();
    PackageInfo packageInfo = pacMan.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
    if(packageInfo != null)
    //Check if comes with the image OS
    int mask = ApplicationInfo.FLAG_SYSTEM
    catch (PackageManager.NameNotFoundException e)
    //The app isn't installed

    return false;







    share|improve this answer



























      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%2f50196665%2fhow-to-detect-check-or-identify-app-is-running-on-android-go-edition-8-1-device%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      There doesn't seems to be direct api for retrieving whether app is running on GO version.



      But you may cover the case by combination of following :




      • based on device memory and deciding on threshold value for your app:



        private ActivityManager.MemoryInfo getAvailableMemory() 
        ActivityManager activityManager =
        (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);
        ActivityManager.MemoryInfo memoryInfo = new
        ActivityManager.MemoryInfo();
        activityManager.getMemoryInfo(memoryInfo);
        return memoryInfo;




      • Further similar steps can be take for particular model/manufacturer :



        String deviceName = android.os.Build.MODEL;
        String deviceMan = android.os.Build.MANUFACTURER;


      Hope it helps.






      share|improve this answer































        3














        There doesn't seems to be direct api for retrieving whether app is running on GO version.



        But you may cover the case by combination of following :




        • based on device memory and deciding on threshold value for your app:



          private ActivityManager.MemoryInfo getAvailableMemory() 
          ActivityManager activityManager =
          (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);
          ActivityManager.MemoryInfo memoryInfo = new
          ActivityManager.MemoryInfo();
          activityManager.getMemoryInfo(memoryInfo);
          return memoryInfo;




        • Further similar steps can be take for particular model/manufacturer :



          String deviceName = android.os.Build.MODEL;
          String deviceMan = android.os.Build.MANUFACTURER;


        Hope it helps.






        share|improve this answer





























          3












          3








          3







          There doesn't seems to be direct api for retrieving whether app is running on GO version.



          But you may cover the case by combination of following :




          • based on device memory and deciding on threshold value for your app:



            private ActivityManager.MemoryInfo getAvailableMemory() 
            ActivityManager activityManager =
            (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);
            ActivityManager.MemoryInfo memoryInfo = new
            ActivityManager.MemoryInfo();
            activityManager.getMemoryInfo(memoryInfo);
            return memoryInfo;




          • Further similar steps can be take for particular model/manufacturer :



            String deviceName = android.os.Build.MODEL;
            String deviceMan = android.os.Build.MANUFACTURER;


          Hope it helps.






          share|improve this answer















          There doesn't seems to be direct api for retrieving whether app is running on GO version.



          But you may cover the case by combination of following :




          • based on device memory and deciding on threshold value for your app:



            private ActivityManager.MemoryInfo getAvailableMemory() 
            ActivityManager activityManager =
            (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);
            ActivityManager.MemoryInfo memoryInfo = new
            ActivityManager.MemoryInfo();
            activityManager.getMemoryInfo(memoryInfo);
            return memoryInfo;




          • Further similar steps can be take for particular model/manufacturer :



            String deviceName = android.os.Build.MODEL;
            String deviceMan = android.os.Build.MANUFACTURER;


          Hope it helps.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 24 '18 at 17:31

























          answered May 6 '18 at 6:23









          SahilSahil

          8215 silver badges11 bronze badges




          8215 silver badges11 bronze badges


























              1














              This works for me, based on preinstalled Apps.



              If Assistant Go or Google Go versions are installed, definitely is an Android Go device.



              In rare cases that these apps didn't come preinstalled we look for Gmail Go and also Youtube Go preinstalled.



              Tested on Huawei Y5 Lite with Android 8.1 (Go).




              public static boolean isAndroidGoEdition(Context context)
              final String GMAIL_GO = "com.google.android.gm.lite";
              final String YOUTUBE_GO = "com.google.android.apps.youtube.mango";
              final String GOOGLE_GO = "com.google.android.apps.searchlite";
              final String ASSISTANT_GO = "com.google.android.apps.assistant";

              boolean isGmailGoPreInstalled = isPreInstalledApp(context, GMAIL_GO);
              boolean isYoutubeGoPreInstalled = isPreInstalledApp(context, YOUTUBE_GO);
              boolean isGoogleGoPreInstalled = isPreInstalledApp(context, GOOGLE_GO);
              boolean isAssistantGoPreInstalled = isPreInstalledApp(context, ASSISTANT_GO);

              if(isGoogleGoPreInstalled

              private static boolean isPreInstalledApp(Context context, String packageName)
              try
              PackageManager pacMan = context.getPackageManager();
              PackageInfo packageInfo = pacMan.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
              if(packageInfo != null)
              //Check if comes with the image OS
              int mask = ApplicationInfo.FLAG_SYSTEM
              catch (PackageManager.NameNotFoundException e)
              //The app isn't installed

              return false;







              share|improve this answer





























                1














                This works for me, based on preinstalled Apps.



                If Assistant Go or Google Go versions are installed, definitely is an Android Go device.



                In rare cases that these apps didn't come preinstalled we look for Gmail Go and also Youtube Go preinstalled.



                Tested on Huawei Y5 Lite with Android 8.1 (Go).




                public static boolean isAndroidGoEdition(Context context)
                final String GMAIL_GO = "com.google.android.gm.lite";
                final String YOUTUBE_GO = "com.google.android.apps.youtube.mango";
                final String GOOGLE_GO = "com.google.android.apps.searchlite";
                final String ASSISTANT_GO = "com.google.android.apps.assistant";

                boolean isGmailGoPreInstalled = isPreInstalledApp(context, GMAIL_GO);
                boolean isYoutubeGoPreInstalled = isPreInstalledApp(context, YOUTUBE_GO);
                boolean isGoogleGoPreInstalled = isPreInstalledApp(context, GOOGLE_GO);
                boolean isAssistantGoPreInstalled = isPreInstalledApp(context, ASSISTANT_GO);

                if(isGoogleGoPreInstalled

                private static boolean isPreInstalledApp(Context context, String packageName)
                try
                PackageManager pacMan = context.getPackageManager();
                PackageInfo packageInfo = pacMan.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
                if(packageInfo != null)
                //Check if comes with the image OS
                int mask = ApplicationInfo.FLAG_SYSTEM
                catch (PackageManager.NameNotFoundException e)
                //The app isn't installed

                return false;







                share|improve this answer



























                  1












                  1








                  1







                  This works for me, based on preinstalled Apps.



                  If Assistant Go or Google Go versions are installed, definitely is an Android Go device.



                  In rare cases that these apps didn't come preinstalled we look for Gmail Go and also Youtube Go preinstalled.



                  Tested on Huawei Y5 Lite with Android 8.1 (Go).




                  public static boolean isAndroidGoEdition(Context context)
                  final String GMAIL_GO = "com.google.android.gm.lite";
                  final String YOUTUBE_GO = "com.google.android.apps.youtube.mango";
                  final String GOOGLE_GO = "com.google.android.apps.searchlite";
                  final String ASSISTANT_GO = "com.google.android.apps.assistant";

                  boolean isGmailGoPreInstalled = isPreInstalledApp(context, GMAIL_GO);
                  boolean isYoutubeGoPreInstalled = isPreInstalledApp(context, YOUTUBE_GO);
                  boolean isGoogleGoPreInstalled = isPreInstalledApp(context, GOOGLE_GO);
                  boolean isAssistantGoPreInstalled = isPreInstalledApp(context, ASSISTANT_GO);

                  if(isGoogleGoPreInstalled

                  private static boolean isPreInstalledApp(Context context, String packageName)
                  try
                  PackageManager pacMan = context.getPackageManager();
                  PackageInfo packageInfo = pacMan.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
                  if(packageInfo != null)
                  //Check if comes with the image OS
                  int mask = ApplicationInfo.FLAG_SYSTEM
                  catch (PackageManager.NameNotFoundException e)
                  //The app isn't installed

                  return false;







                  share|improve this answer













                  This works for me, based on preinstalled Apps.



                  If Assistant Go or Google Go versions are installed, definitely is an Android Go device.



                  In rare cases that these apps didn't come preinstalled we look for Gmail Go and also Youtube Go preinstalled.



                  Tested on Huawei Y5 Lite with Android 8.1 (Go).




                  public static boolean isAndroidGoEdition(Context context)
                  final String GMAIL_GO = "com.google.android.gm.lite";
                  final String YOUTUBE_GO = "com.google.android.apps.youtube.mango";
                  final String GOOGLE_GO = "com.google.android.apps.searchlite";
                  final String ASSISTANT_GO = "com.google.android.apps.assistant";

                  boolean isGmailGoPreInstalled = isPreInstalledApp(context, GMAIL_GO);
                  boolean isYoutubeGoPreInstalled = isPreInstalledApp(context, YOUTUBE_GO);
                  boolean isGoogleGoPreInstalled = isPreInstalledApp(context, GOOGLE_GO);
                  boolean isAssistantGoPreInstalled = isPreInstalledApp(context, ASSISTANT_GO);

                  if(isGoogleGoPreInstalled

                  private static boolean isPreInstalledApp(Context context, String packageName)
                  try
                  PackageManager pacMan = context.getPackageManager();
                  PackageInfo packageInfo = pacMan.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
                  if(packageInfo != null)
                  //Check if comes with the image OS
                  int mask = ApplicationInfo.FLAG_SYSTEM
                  catch (PackageManager.NameNotFoundException e)
                  //The app isn't installed

                  return false;








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 26 at 23:39









                  TechnoTrancerTechnoTrancer

                  213 bronze badges




                  213 bronze badges






























                      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%2f50196665%2fhow-to-detect-check-or-identify-app-is-running-on-android-go-edition-8-1-device%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

                      Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                      Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                      Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript