How to bundle services with android project - android

I'm trying to use google maps in my android application. Therefore, I have 2 projects. One is my android app and another will be the google-play-services. How can I export the apk so that it is bundled together with the google-play-services?

Unfortunately, I don't think it's possible to bundle the actual Google Play services APK as part of your app. From the official docs:
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. Or...
The Android emulator with an AVD that runs
the Google APIs platform based on Android 4.2.2 or higher.
You can, however, check if Google Play services are available and do an action based on the result (in your case, link them to the store where they can download it) by calling isGooglePlayServicesAvailable() as described here.

Related

Google Play Services SDK (version 38) update

First of all: I am a Software Testing Engineer, so I don't create applications. I use Android Studio for AVD creation, than I install already developed apk file on Android Emulator and make tests. About a month ago I have noticed an annoying pop-up "Update Google Play services" and when I clicked "Update" button - nothing happened.
I don't want to describe all my struggles, but finally I decided that root cause is the outdated Google Play Services SDK (now I have version 38). Android Studio doesn't offers me to update it, and also I can't find any information about version 39. Maybe you know something about this and can help me?
You can always check here the latest version of Google Play service. This is the official documentation of Google Play service that shows you the update and the highlights of each version. This page also shows you how to use the Google Play services APIs in the Android studio.
Note that to test your app 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.

How to update Google Play Services on the emulator in Android Studio

Hi I am trying to run an Android Program I have created that can connect to Firebase with Authentication using email and password but it seems that I cannot even authenticate due to the fact of them saying my Google Play Service is not up to date.
I am stump here as I have the latest google play services according to my SDK manager
and I don't think it is my code's problem as when I use my friend's phone for debugging it works but not when I am using the emulator.
How can I update my google play services in the Android Studio built-in emulator.
Since Google introduced Google Play Store images in Android SDK Tools 26.0.0 now emulators comes with installed Google Play Store.
When creating Emulator use images that support Google Playstore (currently Nexus 5 and Nexus 5x with android O)
From 26.0.3
Adds a new tab in the extended window for Google Play Store images that displays the Play Services version and a button to check for updates to Play Services.
Edit:
Make sure that you use emulator with playstore is installed. Check if you have sdk manager -> sdk platforms -> Android 8 -> Google Play ... system image installed. Download it. Create new emulator using that image.
I had the same issue and spent half a day working it out.
In your emulator, go to settings->apps->Google Play Services and compare the version used to what appears in your build.gradle file.
In my case the emulator was running an earlier version and no amount of updates seemed to change it.
In build.gradle, I changed the following:
compile 'com.google.android.gms:play-services:9.6.1'
to
compile 'com.google.android.gms:play-services:8.+'
After which I restarted android-studio and it worked flawlessly.
I was facing same issue, but i downgrade my play services version in build.gradle.
settings->apps->Google Play Services application check image
my google play services version is 10.2.98, that's why we need google-play-services(in module level build.gradle) version lower than our emulator's library version.
set the lower version from here, we can see 10.2.6 is better and set it in build.gradle like this
compile 'com.google.android.gms:play-services-places:10.2.6'
and just simple, run app again.
Try to download and install the latest APK for Play Services as stated in this thread.
Based from Google documentation,
If you want to test your app on the emulator, expand the directory for Android 4.2.2 (API 17) or a higher version, select Google APIs, and install it. Then create a new AVD with Google APIs as the platform target.
Try to navigate to settings--> apps in your emulator and then find Google Play Services. Check the version number and use it in you build.gradle. To update it with the latest version, you can see it in these documentation and SO question.
Be noted that updates might not reach all users immediately, so your app should verify the version available before attempting to perform API transactions.

Running an app based on google play services library

I am trying to learn about Android Location API using Google Play Services through ANDROIDHIVE but whenever I try to run the app in genymotion the app never starts. I have checked every other apps developed by me they run perfectly and even my location API app runs when I remove the google-play-services-lib from the app through the properties. It only does not run when I add this library . I am using eclipse and the tutorial is also for eclipse users and my genymotion version is 2.4
#Saud kindly double check your set up with your API/s. There are many factors to consider why your app doesn't run. Emulator must run Android 4.2.2 or higher. Check the guide to see if you have followed the steps on setting up the Google Play services to your project. Also, take note that Google Play Services need to be sideloaded in Genymotion.

run google play store on android emulator

I installed Google play store on my android emulator successfully. But when I try to run Google app it gives "Unfortunately, Google services framework has stopped" error message. I tried to fix it using clear cache of Google play store app, clear data of Google services framework app and restart the device. Also I tried for new emulators. But It didn't work. Does it a matter version of android sdk and Google Services Framework.apk version?
Suggest a way to fix this problem.
Read up on the guide provided by Android here.
Specifically, note:
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.
As long as you satisfy those requirements, follow the installation instructions provided to install the SDK into your Developer environment.

Can we run an App with Google Map v2 on Emulator Running Android 4.3?

It is still not clear if we can test Google Map v2 on Android emulator or NOT.
It is all about Play Service and they "Google Android Team" have announced the following:
On Android-Developer Blog
They are saying
To simplify your testing, we've also released an updated Google APIs emulator image that includes Google Play Services 3.2. You can download the image through the Android SDK Manager.
On Android Developer Site They are saying
To test your app when using the Google Play services SDK, you must use either:
•A compatible Android device that runs Android 2.2 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.
But, I still not able to run the Map on Android Emulator with Google API 18 (4.3).
What is the right answer?
This wasn't possible initially, but it seems the new version of the google play services apk is making it possible.
Check out the answer here here
Unfortunately, I haven't been able to try it out myself.

Categories

Resources