Can't upgrade to android 8.0 - What are the options - android

I currently have an app which target Android 16 and which has been live for a while.
I'm worried that after the November 1 we'll have a lot of issues and we won't be able to use the play store anymore. Does anyone know if it'll still be possible to send & install the apk directly to the new devices after the changes? Even if we keep targeting 16?
I'm mostly concerned about the fact that we use the "Google Play services SDK". Will there still be a retro compatibility there?
Is it likely to have something like the dropping of the Google Play services SDK support like we had for Android Gingerbread and Honeycomb?
We also have a lot of things running in the background (GPS tracking, ...). If we install the apk directly with target 16, would we still be forced to follow the new Background Location Limits? Maybe be integrating the Google service apk directly in the app?

Related

Test Google billing in android api <24 using android studio emulator

I've created an app which uses Google Billing for in app purchases. I've tested the functionality on a number of real devices, as well as on emulators in Android Studio and it appears to be working fine.
I don't have any real devices that are running lower than android API 24, and although I can create a virtual device in Android Studio, it doesn't look like I can create one with Google play store functionality.
If I pick a device with Play store functionality...
...I'm only shown recommended system images down to API 24 (the same is true regardless of which device I pick)...
I can see plenty of other images under the 'X86 images' and 'Other images' sections, but none with Play store functionality.
Having tested on other API's, I'm pretty sure this will work, but it would be nice to be sure. Is there any way I can be sure without purchasing a physical device?
Official answer: No, there is no way if you want a "trustful" test environment.
Google has never released (and probably never will) emulator images with Google Play below API 24.
If you want test your app with API below that level your only option is buying an old phone with Google Play installed.
Unofficial answer: Online you can find some guide/tutorial which teach you how to install Play service and Play store on emulator images, like this one but I did not try them and don't know if they really works.

Is there a way to emulate a Android OS upgrade scenario on AVD emulator?

I've been trying to simulate a scenario where I want to check how my Android app behaves after an OS update. But I don't have access to physical device at the moment where I can run an actual OS update scenario, so I have to resort to trying it out on android emulator (AVD).
Is there a way I can update the OS on AVD as if it were a real phone, and be able to see how my app would behave?
What I essentially want to test out is this:
Let's say that I have android with API level 21 installed on a device. I install an app with maxSdkVersion 21 on it. Now my device upgrades to API level 22. What will happen to my app?
Will the OS silently get my app uninstalled and keep it that way?
Will the OS check with play store to see if a build of my app with a supported SDK level is available and download and install that instead?
Will the OS at least give me a visual warning or prompt that this particular app is not compatible on the device anymore and tell me what I could do next?
The Android Developer Docs recommends that using maxSdkVersion is not a good idea since in some cases uninstalls would happen.
An application declaring maxSdkVersion="5" in its manifest is published on Google Play. A user whose device is running Android 1.6 (API Level 4) downloads and installs the app. After a few weeks, the user receives an over-the-air system update to Android 2.0 (API Level 5). After the update is installed, the system checks the application's maxSdkVersion and successfully re-validates it. The application functions normally. However, some time later, the device receives another system update, this time to Android 2.0.1 (API Level 6). After the update, the system can no longer re-validate the application because the system's own API Level (6) is now higher than the maximum supported by the application (5). The system prevents the application from being visible to the user, in effect removing it from the device.
Warning: Declaring this attribute is not recommended. First, there is no need to set the attribute as means of blocking deployment of your application onto new versions of the Android platform as they are released. By design, new versions of the platform are fully backward-compatible. Your application should work properly on new versions, provided it uses only standard APIs and follows development best practices. Second, note that in some cases, declaring the attribute can result in your application being removed from users' devices after a system update to a higher API Level. Most devices on which your application is likely to be installed will receive periodic system updates over the air, so you should consider their effect on your application before setting this attribute.
What I also want to figure out is what happens next. And what does "in some cases" essentially mean?
I have created 2 demo apps to check your questions using the emulator. I have updated emulator's API level and restart it because every device gets restart after the system update. Please see this video what happening :)
Will the OS silently get my app uninstalled and keep it that way?
yes app get uninstlled
Will the OS at least give me a visual warning or prompt that this
particular app is not compatible on the device anymore and tell me
what I could do next?
app getting uninstalled without any message or warning
Will the OS check with play store to see if a build of my app with a
supported SDK level is available and download and install that
instead?
I think this can be check if the app is available on the play store. So I'm unable to test this. If anyone knows the answer to this question, please comment

Android - this app won't run without google play services which are missing from your phone [duplicate]

I want to use Google Play Services API in my application, but when I open the emulator to test my application it sends me a message that says "Google Play Services must be downloaded". I know that occurs because I coded this test in my MainActivity in the method onResume().
I want to know how I can install Google Play Services in my emulator, because soon I will need to test my maps.
Check out Setting Up Google Play Services which says:
To develop an app using the Google Play services APIs, you need to set up your project with the Google Play services SDK.
If you haven't installed the Google Play services SDK yet, go get it now by following the guide to Adding SDK Packages.
To test your app when using the Google Play services SDK, you must use either:
A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.
The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.
For api 21+ you can use system image with Google Play as I describe below.
For api 19+ (Android 4.4 Kitkat) you can use system image x86 with Google Api (I was able to use it).
For api 17+ (Android 4.2.2) you can TRY to use system image ARM with Google Api (It didn't work for me).
I was able to install Google Play and Google Services as separate apks to pure system image api 16 and 17, but they don't really work after that (services crush and play not opens). So seems like it is not possible to make them work on pure AVD image because they should be installed with root access. The same for updating Google Services on AVD system image with Google API preinstalled - can't update because of incompatible certificates, can't uninstall even using adb because don't have access.
How to setup AVD system image with Google Play
Now even better solution exist: using AVD image with build-in Google Play Services. It will enable you to use Google Services including Google Play. Also you will be able update it without re-creating AVD image.
Open AVD manager and choose create new device. You should use device definition with play store icon.
Then choose system image for it. You should choose one with Google Play and NOT with Google API.
Then launch new device.
You can update Play Services as shown on screenshot, or manually in app itself, just like a real device.
Update 2022; but even with above, you cannot use the Emulator to test Google Play Billing:
You must install your application on a real device to test Google Play Billing,
Or, ask Google for "closed testing" permission.
see How to test In-app Billing on an emulator?
This is how you make Android Google Maps API v2 work on your emulator.
Create a new emulator
for device choose "5.1'' WVGA (480 x 800: mdpi)"
for target choose "Android 4.1.2 - API level 16"
for "CPU/ABI" choose "ARM"
leave rest to defaults
these are the settings that are working for me. I don't know for different ones.
Start the emulator
install com.android.vending-1.apk and com.google.android.gms-1.apk via ADB install command
The longer answer is on my blog post about this issue https://medium.com/nemanja-kovacevic/how-to-make-android-google-maps-v2-work-in-android-emulator-e384f5423723
I came across another solution to use the Google play services on an emulator. The guys at http://www.genymotion.com/ provide very fast emulators on which you can install Google play services. They just need you to sign up to begin downloading and you need Virtual box installed. At the moment they cater for Android 16 and 17 but more are on the way.
In the current version (Android Studio 0.5.2) there is now a device type for "Google APIs x86 (Google Inc.) - API Level 19".
The key is to select the target of your emulator to, for example: Google APIs (ver 18).
If you select, for example, just Jellybean 18 (without API) you will not be able to test apps that require Google services such as map.
Keep in mind that you must first download the Google API of your favorite version with the Android SDK Manager.
This is a good practice and it is far better than juggling with most workarounds.
I tried to develop google MAP API V2 application recently and tried to run it through emulator but I everytime it showed me error "Google Play Servcies is not installed in this phone".
From my perpective even I think google MAP API V2 doesn't work on emulator.
Solution
Then I tried to run the same example on my Sony Experia you and again it showed me same error.
Then I installed google play services on my mobile and amazingly it started working..:)))
I got it working by
Installing the Google Play Services through the Android SDK Manager
Using a Galaxy Nexus Device (4.65", 720 x 1280: xhdpi)
Targeting the Android 4.2.2 Google API Level 17
Go to https://university.xamarin.com/resources/working-with-android-emulators .
Scroll down to the "Installing Google Play Services" section. Step by step walk through there.
Directly plagarized from xamarin here so I don't get dinged for linking and not including solution. Posting this as I found the hit in stack before I found the solution that worked across the board on the xamarin page.
Start the Xamarin Android Player and run one of the supplied images, the following assumes you have started the KitKat Nexus 4 image.
Download the proper Google Play Services .zip file from www.teamandroid.com/gapps/ . Make sure to download the image appropriate for your version of Android.
Drag the .zip file onto the running emulator and drop it to install the component, here we show it on Mac OS X, but the same mechanism is used in Windows. You will get a prompt to install the package onto the emulator which indicates the image will be restarted
Once it restarts, you will get a notification that installation is completed, and the image will now have Google Maps, Google+ and support for the Google Play store. Note that some things do not work correctly and you may get a few errors from some of the services, but you can safely dismiss these and continue the instructions.
Next, you will need to associate a Google account so that you can update the services using the Google Play store. It should prompt you for this, but if it does not, you can go into the Google Settings and add a new account.
Once you've added the account, you can then update the Google apps by opening the Google Play store application and going into settings from the side bar menu.
Select Settings and then scroll down to the Build Version number information and double-tap on it until it tells you it is either up-to-date, or that it will download and install a new version.
Power off the device (press and hold the power button in the toolbar on the right) and restart it. Once it restarts, it should indicate that it needs to update the Google Play services, tapping the notification will open the Google Play Store and install the latest version
Now you can run applications that depend on Google Maps in the Xamarin Android Player.
To the latest setup and information if you have installed the Android Studio (i.e. 1.5) and trying to target SDK 4.0 then you may not be able to locate and setup the and AVD Emulator with SDK-vX.XX (with Google API's).
See following steps in order to download the required library and start with that.
AVD Emulator setup -setting up Emulator for SDK4.0 with GoogleAPI so Map application can work- In Android Studio
But unfortunately above method did not work well on my side. And was not able to created Emulator with API Level 17 (SDK 4.2). So I followed this post that worked on my side well. The reason seems that the Android Studio Emulator creation window has limited options/features.
Google Play Services in emulator, implementing Google Plus login button etc
I know this is an old question, but I got here because I had a similar problem as everyone above. I solved it by just reading a little closer!
I hadn't noticed there were 2 possible system Images I could choose from, one that contained Google APIs and one that didn't (on my laptop the menu was too small for me to read the (with Google APIs) text appended.
It's a stupid thing to miss, but someone else might have a small screen like I did, and miss this :D
If your emulator x86 this method works your me.
Download and install http://opengapps.org/app/opengapps-app-v16.apk. And select nano pack
More info http://opengapps.org/app/

How to install google play services in emulator? [duplicate]

I want to use Google Play Services API in my application, but when I open the emulator to test my application it sends me a message that says "Google Play Services must be downloaded". I know that occurs because I coded this test in my MainActivity in the method onResume().
I want to know how I can install Google Play Services in my emulator, because soon I will need to test my maps.
Check out Setting Up Google Play Services which says:
To develop an app using the Google Play services APIs, you need to set up your project with the Google Play services SDK.
If you haven't installed the Google Play services SDK yet, go get it now by following the guide to Adding SDK Packages.
To test your app when using the Google Play services SDK, you must use either:
A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.
The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.
For api 21+ you can use system image with Google Play as I describe below.
For api 19+ (Android 4.4 Kitkat) you can use system image x86 with Google Api (I was able to use it).
For api 17+ (Android 4.2.2) you can TRY to use system image ARM with Google Api (It didn't work for me).
I was able to install Google Play and Google Services as separate apks to pure system image api 16 and 17, but they don't really work after that (services crush and play not opens). So seems like it is not possible to make them work on pure AVD image because they should be installed with root access. The same for updating Google Services on AVD system image with Google API preinstalled - can't update because of incompatible certificates, can't uninstall even using adb because don't have access.
How to setup AVD system image with Google Play
Now even better solution exist: using AVD image with build-in Google Play Services. It will enable you to use Google Services including Google Play. Also you will be able update it without re-creating AVD image.
Open AVD manager and choose create new device. You should use device definition with play store icon.
Then choose system image for it. You should choose one with Google Play and NOT with Google API.
Then launch new device.
You can update Play Services as shown on screenshot, or manually in app itself, just like a real device.
Update 2022; but even with above, you cannot use the Emulator to test Google Play Billing:
You must install your application on a real device to test Google Play Billing,
Or, ask Google for "closed testing" permission.
see How to test In-app Billing on an emulator?
This is how you make Android Google Maps API v2 work on your emulator.
Create a new emulator
for device choose "5.1'' WVGA (480 x 800: mdpi)"
for target choose "Android 4.1.2 - API level 16"
for "CPU/ABI" choose "ARM"
leave rest to defaults
these are the settings that are working for me. I don't know for different ones.
Start the emulator
install com.android.vending-1.apk and com.google.android.gms-1.apk via ADB install command
The longer answer is on my blog post about this issue https://medium.com/nemanja-kovacevic/how-to-make-android-google-maps-v2-work-in-android-emulator-e384f5423723
I came across another solution to use the Google play services on an emulator. The guys at http://www.genymotion.com/ provide very fast emulators on which you can install Google play services. They just need you to sign up to begin downloading and you need Virtual box installed. At the moment they cater for Android 16 and 17 but more are on the way.
In the current version (Android Studio 0.5.2) there is now a device type for "Google APIs x86 (Google Inc.) - API Level 19".
The key is to select the target of your emulator to, for example: Google APIs (ver 18).
If you select, for example, just Jellybean 18 (without API) you will not be able to test apps that require Google services such as map.
Keep in mind that you must first download the Google API of your favorite version with the Android SDK Manager.
This is a good practice and it is far better than juggling with most workarounds.
I tried to develop google MAP API V2 application recently and tried to run it through emulator but I everytime it showed me error "Google Play Servcies is not installed in this phone".
From my perpective even I think google MAP API V2 doesn't work on emulator.
Solution
Then I tried to run the same example on my Sony Experia you and again it showed me same error.
Then I installed google play services on my mobile and amazingly it started working..:)))
I got it working by
Installing the Google Play Services through the Android SDK Manager
Using a Galaxy Nexus Device (4.65", 720 x 1280: xhdpi)
Targeting the Android 4.2.2 Google API Level 17
Go to https://university.xamarin.com/resources/working-with-android-emulators .
Scroll down to the "Installing Google Play Services" section. Step by step walk through there.
Directly plagarized from xamarin here so I don't get dinged for linking and not including solution. Posting this as I found the hit in stack before I found the solution that worked across the board on the xamarin page.
Start the Xamarin Android Player and run one of the supplied images, the following assumes you have started the KitKat Nexus 4 image.
Download the proper Google Play Services .zip file from www.teamandroid.com/gapps/ . Make sure to download the image appropriate for your version of Android.
Drag the .zip file onto the running emulator and drop it to install the component, here we show it on Mac OS X, but the same mechanism is used in Windows. You will get a prompt to install the package onto the emulator which indicates the image will be restarted
Once it restarts, you will get a notification that installation is completed, and the image will now have Google Maps, Google+ and support for the Google Play store. Note that some things do not work correctly and you may get a few errors from some of the services, but you can safely dismiss these and continue the instructions.
Next, you will need to associate a Google account so that you can update the services using the Google Play store. It should prompt you for this, but if it does not, you can go into the Google Settings and add a new account.
Once you've added the account, you can then update the Google apps by opening the Google Play store application and going into settings from the side bar menu.
Select Settings and then scroll down to the Build Version number information and double-tap on it until it tells you it is either up-to-date, or that it will download and install a new version.
Power off the device (press and hold the power button in the toolbar on the right) and restart it. Once it restarts, it should indicate that it needs to update the Google Play services, tapping the notification will open the Google Play Store and install the latest version
Now you can run applications that depend on Google Maps in the Xamarin Android Player.
To the latest setup and information if you have installed the Android Studio (i.e. 1.5) and trying to target SDK 4.0 then you may not be able to locate and setup the and AVD Emulator with SDK-vX.XX (with Google API's).
See following steps in order to download the required library and start with that.
AVD Emulator setup -setting up Emulator for SDK4.0 with GoogleAPI so Map application can work- In Android Studio
But unfortunately above method did not work well on my side. And was not able to created Emulator with API Level 17 (SDK 4.2). So I followed this post that worked on my side well. The reason seems that the Android Studio Emulator creation window has limited options/features.
Google Play Services in emulator, implementing Google Plus login button etc
I know this is an old question, but I got here because I had a similar problem as everyone above. I solved it by just reading a little closer!
I hadn't noticed there were 2 possible system Images I could choose from, one that contained Google APIs and one that didn't (on my laptop the menu was too small for me to read the (with Google APIs) text appended.
It's a stupid thing to miss, but someone else might have a small screen like I did, and miss this :D
If your emulator x86 this method works your me.
Download and install http://opengapps.org/app/opengapps-app-v16.apk. And select nano pack
More info http://opengapps.org/app/

How to download Google Play Services in an Android emulator?

I want to use Google Play Services API in my application, but when I open the emulator to test my application it sends me a message that says "Google Play Services must be downloaded". I know that occurs because I coded this test in my MainActivity in the method onResume().
I want to know how I can install Google Play Services in my emulator, because soon I will need to test my maps.
Check out Setting Up Google Play Services which says:
To develop an app using the Google Play services APIs, you need to set up your project with the Google Play services SDK.
If you haven't installed the Google Play services SDK yet, go get it now by following the guide to Adding SDK Packages.
To test your app when using the Google Play services SDK, you must use either:
A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.
The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.
For api 21+ you can use system image with Google Play as I describe below.
For api 19+ (Android 4.4 Kitkat) you can use system image x86 with Google Api (I was able to use it).
For api 17+ (Android 4.2.2) you can TRY to use system image ARM with Google Api (It didn't work for me).
I was able to install Google Play and Google Services as separate apks to pure system image api 16 and 17, but they don't really work after that (services crush and play not opens). So seems like it is not possible to make them work on pure AVD image because they should be installed with root access. The same for updating Google Services on AVD system image with Google API preinstalled - can't update because of incompatible certificates, can't uninstall even using adb because don't have access.
How to setup AVD system image with Google Play
Now even better solution exist: using AVD image with build-in Google Play Services. It will enable you to use Google Services including Google Play. Also you will be able update it without re-creating AVD image.
Open AVD manager and choose create new device. You should use device definition with play store icon.
Then choose system image for it. You should choose one with Google Play and NOT with Google API.
Then launch new device.
You can update Play Services as shown on screenshot, or manually in app itself, just like a real device.
Update 2022; but even with above, you cannot use the Emulator to test Google Play Billing:
You must install your application on a real device to test Google Play Billing,
Or, ask Google for "closed testing" permission.
see How to test In-app Billing on an emulator?
This is how you make Android Google Maps API v2 work on your emulator.
Create a new emulator
for device choose "5.1'' WVGA (480 x 800: mdpi)"
for target choose "Android 4.1.2 - API level 16"
for "CPU/ABI" choose "ARM"
leave rest to defaults
these are the settings that are working for me. I don't know for different ones.
Start the emulator
install com.android.vending-1.apk and com.google.android.gms-1.apk via ADB install command
The longer answer is on my blog post about this issue https://medium.com/nemanja-kovacevic/how-to-make-android-google-maps-v2-work-in-android-emulator-e384f5423723
I came across another solution to use the Google play services on an emulator. The guys at http://www.genymotion.com/ provide very fast emulators on which you can install Google play services. They just need you to sign up to begin downloading and you need Virtual box installed. At the moment they cater for Android 16 and 17 but more are on the way.
In the current version (Android Studio 0.5.2) there is now a device type for "Google APIs x86 (Google Inc.) - API Level 19".
The key is to select the target of your emulator to, for example: Google APIs (ver 18).
If you select, for example, just Jellybean 18 (without API) you will not be able to test apps that require Google services such as map.
Keep in mind that you must first download the Google API of your favorite version with the Android SDK Manager.
This is a good practice and it is far better than juggling with most workarounds.
I tried to develop google MAP API V2 application recently and tried to run it through emulator but I everytime it showed me error "Google Play Servcies is not installed in this phone".
From my perpective even I think google MAP API V2 doesn't work on emulator.
Solution
Then I tried to run the same example on my Sony Experia you and again it showed me same error.
Then I installed google play services on my mobile and amazingly it started working..:)))
I got it working by
Installing the Google Play Services through the Android SDK Manager
Using a Galaxy Nexus Device (4.65", 720 x 1280: xhdpi)
Targeting the Android 4.2.2 Google API Level 17
Go to https://university.xamarin.com/resources/working-with-android-emulators .
Scroll down to the "Installing Google Play Services" section. Step by step walk through there.
Directly plagarized from xamarin here so I don't get dinged for linking and not including solution. Posting this as I found the hit in stack before I found the solution that worked across the board on the xamarin page.
Start the Xamarin Android Player and run one of the supplied images, the following assumes you have started the KitKat Nexus 4 image.
Download the proper Google Play Services .zip file from www.teamandroid.com/gapps/ . Make sure to download the image appropriate for your version of Android.
Drag the .zip file onto the running emulator and drop it to install the component, here we show it on Mac OS X, but the same mechanism is used in Windows. You will get a prompt to install the package onto the emulator which indicates the image will be restarted
Once it restarts, you will get a notification that installation is completed, and the image will now have Google Maps, Google+ and support for the Google Play store. Note that some things do not work correctly and you may get a few errors from some of the services, but you can safely dismiss these and continue the instructions.
Next, you will need to associate a Google account so that you can update the services using the Google Play store. It should prompt you for this, but if it does not, you can go into the Google Settings and add a new account.
Once you've added the account, you can then update the Google apps by opening the Google Play store application and going into settings from the side bar menu.
Select Settings and then scroll down to the Build Version number information and double-tap on it until it tells you it is either up-to-date, or that it will download and install a new version.
Power off the device (press and hold the power button in the toolbar on the right) and restart it. Once it restarts, it should indicate that it needs to update the Google Play services, tapping the notification will open the Google Play Store and install the latest version
Now you can run applications that depend on Google Maps in the Xamarin Android Player.
To the latest setup and information if you have installed the Android Studio (i.e. 1.5) and trying to target SDK 4.0 then you may not be able to locate and setup the and AVD Emulator with SDK-vX.XX (with Google API's).
See following steps in order to download the required library and start with that.
AVD Emulator setup -setting up Emulator for SDK4.0 with GoogleAPI so Map application can work- In Android Studio
But unfortunately above method did not work well on my side. And was not able to created Emulator with API Level 17 (SDK 4.2). So I followed this post that worked on my side well. The reason seems that the Android Studio Emulator creation window has limited options/features.
Google Play Services in emulator, implementing Google Plus login button etc
I know this is an old question, but I got here because I had a similar problem as everyone above. I solved it by just reading a little closer!
I hadn't noticed there were 2 possible system Images I could choose from, one that contained Google APIs and one that didn't (on my laptop the menu was too small for me to read the (with Google APIs) text appended.
It's a stupid thing to miss, but someone else might have a small screen like I did, and miss this :D
If your emulator x86 this method works your me.
Download and install http://opengapps.org/app/opengapps-app-v16.apk. And select nano pack
More info http://opengapps.org/app/

Categories

Resources