Android Studio AVD Emulator Chrome and Play Store missing - android

I am making my first developer steps on Android.
Trying my first test app on an Android Virtual Device (AVD), I noticed that the device has almost no software on it, there is no Play Store and no Chrome Browser. See Screenshot. I checked all settings up and down but found no way to tweak the basic OS software load. I tried several phone models and API levels, but had no luck.
How can I create a device providing software support similar to a physical device, I do specifically need an Internet browser.

Google Play System Images
When creating the emulator, you need to select and create a system image that contains the playstore.

Related

When updating Chrome on Android Studio's Emulator, Chrome crashes

I am using Android Studio's device manager to run an emulated android tablet device on my Mac (M1). Specifically, the device targets API 30 and uses the arm64 architecture. By default, this device comes with the Chrome browser, version 91.
My goal is to update Chrome to the latest version possible (as of this post, version 108). Unfortunately, what I've tried either doesn't actually update Chrome or results in Chrome crashing immediately upon start up.
1. Clicking Chrome's Update Button - does nothing
The Chrome browser prompts me to update it, but clicking on this does nothing. The menu just closes.
2. Updating Chrome from the Play Store - can't select my device
I tried going through the Play Store instead. However, when I do this, it prompts me to select a valid device via a dropdown menu, and the emulator is not selectable in this dropdown.
3. Installing the APK via Android Debug Bridge - Chrome crashes
Finally, various places suggest using adb to install a Chrome APK file. This gist summarizes the process (remove old chrome, download the desired APK, and install it via command line).
I believe I'm supposed to download the "arm64-v8a + armeabi-v7a" version, because the architecture must match and my device manager is telling me my architecture is arm64:
When I install via adb, I get the "Success" message, and I can see in the app info on the emulator that Chrome is now version 108. However, when I attempt to turn it on, it crashes immediately.
For what it's worth, I tried every available APK architecture in the list just in case arm64 was wrong, and they all result in the same thing: "Success", but crashing upon startup.
Is it possible to update Chrome on an android emulator? Is there something I may be missing when installing the APK?
Let me know if more info is needed!
So, posting this question was apparently enough info for Stack Overflow to give me a good "Related Questions" list, and I found an answer on Is Google Play Store supported in avd emulators?.
Essentially, only some images support the Google Play Store; I hadn't realized this. That was why my attempts 1 and 2 (update via Chrome or Play Store respectively) didn't work. Once I used an image that supported the Play Store, I was able to update Chrome just fine!
Inconveniently, none of the tablet images support the play store, but there's a workaround.
Getting a Tablet Emulator with Google Play Store
Select an image that supports the Play Store (indicated by the icon in the Play Store column). I was only able to find these in the Phone section.
Download one of the provided system images. We only care that this image is downloaded, and we don't actually need to create this device.
Go back to the Device Manager and find your tablet image. Use its dropdown menu to Wipe Data and then Show on Disk. You may duplicate the image first, but wiping the data is important for the emulator to start on a clean slate.
Clicking Show on Disk should have brought up the files for that image. Locate config.ini and open it.
Change PlayStore.enabled from false to true.
Change image.sysdir.1, replacing where it says google_apis with google_apis_playstore instead. We downloaded this image on Step 2.
Save and start up the emulator. You now have a tablet emulator with the play store enabled!

Install applications from play store in android emulator

I installed Play Store in my android emualtor. for some reasons I can't download many applications to my Emulator, because when it says "your device isn't compatible with this version" or just not appearing when I'm searching it.
Is there any way to "disguise" my emulator as Nexus 5 so that many application won't block me from downloading it?
I suggest you use the perfect Android emulator called: Genymotion: http://www.genymotion.com/, and then take look at http://www.youtube.com/watch?v=zvTYDcYOFyw to set up the Google play service on it. It works perfectly, and I can have different devices to emulate and download what I want.

GoogleMaps, "This app wont run unless you update Google Play services." On emulator [duplicate]

When integrating a Google Plus login button in an Android app, I'm observing some differences in how the button appears on an actual device and in the emulator. I am aware of the fact that the Google Plus services APKs are not installed in the emulator, but this can be worked around by pulling the APKs from a device and installing them into the emulator using APK.
My current "implementation" simply includes the login button in a layout, by referring to the button with the following XML code:
<com.google.android.gms.common.SignInButton
android:id="#+id/sign_in_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
When I test my app on the device, the button appears all red and shiny, according to the guidelines mentioned here https://developers.google.com/+/mobile/android/sign-in . But when running on the emulator, it's just a normal button (grey background with black text) saying "Sign in with Google".
Any idea why the results are different? I've made sure I'm running the same API level, and the resource does seem to get pulled in correctly also on the emulator since it shows the actual login button (but with a different look).
Update: Found a clue in logcat; the message "Sign in button not found, using placeholder instead." pretty much explains why I'm seeing the grey dull button on the emulator. Still need to figure out why; could be the "copy google plus apk's from device" hack isn't working properly.
Google Play services works on the 4.2.2 versions of the Android Emulator and is officially supported as described in the Android documentation: Setup Google Play Services.
Update
You now can use the Intel/x86 images (HAXM-compatible) for API 19 and newer and for ARM, Google Play Services is available on most images.
Setting up the image
To get the right image for your virtual device manager:
Open the Android SDK Manager
Open the group Android 4.2.2 (API 17)
Check Google APIs
Check ARM EABI v7a System Image
To create the Virtual Device:
Open the Android Virtual Device Manager
Create a New device
Enter an AVD name
Set the target to Google APIs (Google Inc.) - API Level 17
Save your Virtual device and start it...
Note CPU/ABI will be fixed as ARM
Now you should be able to use the Google Play Services in the emulator. Of note, you need to set your target appropriately in your Android project to the Google APIs in order for Google Play Services to work.
I tried most combinations of running the emulator, but with and without the Google APIs, which means I tested with both x86 and arm modes. I found no way of making the apk's pulled from my Galaxy Nexus phone to run correctly on the emulator.
Guessing this is somewhat related to getting the Play Store up and running, I decided to try that as well to see if I had more luck. I did not; could not get that working either. The Play Store icons appear and can be launched, but it immediately closes itself.
What did work however was to download and install the apks at the bottom of the page here:
http://umut.tekguc.info/en/content/google-android-map-v2-step-step
After installing the vending and gms packages, the login button appeared in it's full beauty under the emulator. Since I haven't actually implemented the actual login functionality yet, I can not be sure that it will actually work, but at least the button now looks identical in my app on my device and in the emulator.
You also need to download the Google Play Services software (look under "Extras" in the Android SDK manager), and install the library google-play-services_lib in your project (File-Import-Android-Existing Android Code Into Workspace, and then browse to for instance /opt/adt-bundle-linux/sdk/extras/google/google_play_services/libproject and select google-play-services_lib).
Another interesting tidbit is that this will only work on the "pure" Android emulator setups, not with the "Google API" setups. It seems the latter have some parts of those apps installed in the emulator already (not visibly and not working), and I haven't managed to remove the existing versions to install the custom apk files that worked as described above. I tested adb remove, adb install, adb install -r, and even removing the directories from /data which also failed. It's looking very much like Google is trying to make this difficult.
I'm disappointed Google is making this so hard; Google may have some weird licensing reasons for keeping this stuff out of the emulator, but if they really want people to use their services in their Android apps they need to make these services available in the emulator. Forcing people to always develop on a device (with otherwise excellent emulators available) or making people jump through hoops (lots of googling, installing unofficial/hacked versions of the apks etc) is just evil.
Final update before accepting my answer; although the correct button with the correct styling is now showing in the emulator, I am still not able to get the "pick account" dialog to appear in the emulator. When/if I do I will share the proper solution here.
Check the ldpi, mdpi, hdpi, etc... folders for a different button graphic. Your emulator is almost certainly a different DPI than your device.
i have noticed that from API 21 there are ARM and x86 images with Google APIs implemented
perhaps if you have no problem emulating using android 5 it will works without extracting the APKs

Android AVD For Specific Device

I created an Android application that I have published in the marketplace. It crashes on a specific device, the Motorola Cliq XT, so I would like to make an AVD of this device and test it in the emulator. I know that I can make a new AVD with the right API level, but what other considerations are there for this AVD so that I can closely mimic the actual device? Are there standard AVDs that someone has released for different phones, or do we not have that kind of flexibility? Thanks.
The Motorola Developer Network site provides instructions for downloading and installing the necessary add-ons to support the creation of a device-specific AVD. Sadly, I'm no longer able to find the actual download page.

Why not standard Android emulators?

I'm new to Android, but have published iphone and bberry apps. I see that I have to create an emulator using the SDK, before I can write and test an app. Why are there no default emulators? Why not at least a Nexus one, or HTC hero emulator shipped with the product?
Sure its supposed to be flexible, but why not make it easy to create hello world and play around with a virtual Android phone? Both blackberry and iphone come with default simulators when you download the sdk.
Thanks,
Gerry
Since you can create an emulator configuration - or Android Virtual Device (AVD) - with three mouse clicks and typing a name I don't see too much wrong with the Android Emulator that ships with the SDK.
The reason that there's no Nexus One or HTC Hero emulator is that these ship with proprietary code which can't be given away free with the emulator.
The Sense UI that comes with the Hero is written by HTC only for their handsets and some of the Google Apps, such as Google Maps, GMail and YouTube are owned by Google and are not part of the Android Open Source Project. I believe Google charge handset makers for these apps and if they included them in the SDK then anyone could have them for free.
The SDK includes emulators for all currently released devices, you just have to create and name them.
To create a "Nexus One" emulator, you would create an AVD that is using the 2.1 SDK, and has a screen size of WVGA800. It's as simple as that.
It used to be this way, but was changed to make developers think about what platform version / configuration they are developing against (and to allow multiple platform AVDs to be created).
Here is a quick way to launch an emulator running cupcake:
$ android create avd -n android1.5 -t
$ emulator -avd android1.5
What about other features.... i would love to make my app work on all android devices but, i dont own all of them, just 1. So i have to create an avd for each possible hardware configuration(phone). meaning i have to track down the exact specs for say 5-10 phones? resultion, density, aspect ratio, input types, multi touch? proccessor FPU? some do some dont. etc etc. something needs done.
I'm confused by your question. The SDK ships with an emulator. You just have to create and configure an instance of it first through the SDK and AVD manager.
You can create appropriate avd using android (android.bat) in folder /tools of sdk. Also you can choose resolution, sd card, API level. It's really easy:)
If you want to write for Nexus - why not? Choose appropriate sdk level and enjoy.

Categories

Resources