Android AVD For Specific Device - android

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.

Related

Android Studio AVD Emulator Chrome and Play Store missing

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.

Install actual android device not just skin on Android Studio/Virtual Machine

I am trying to run some tests of an Android application I am developing. The question I have is if it is possible to create an actual android device with its settings not just skins and the device's layout using Android Studio or a Virtual Machine, in order to see how application operates on other devices.
Would really appreciate if anyone could help.
You can use AVD Manager in Android Studio. You can create Android VM with it. You can customize :
What Android Version runs on it
The device screen size
memory
camera
storage
You can send custom inputs
Physically moving the device
Custom GPS coordinates
Send sms and call
Change battery level
etc
It is more than a skin, you can access the file system with adb, navigates the settings etc.
What you can't do is having the custom software layers made by manufacturers (i.e. OneUI from Samsung). It is stock Android
The emulator seems to be a standard qemu running a complete android system, so it's not only a skin.
If you want to test on real devices, you can have a look at Firebase Test Lab, which offers actual devices for testing, for a fee. See https://firebase.google.com/docs/test-lab/android/available-testing-devices on how to get the list of devices. Another option is Browserstack, which seems free for open source projects.

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 features

I was reading the Android documentations, the AVD topic.
I have a question.. What's this means?
An AVD consists of:
You can choose a version of the standard Android platform or
the system image packaged with an SDK add-on.
Any thoughts?
This may refer to some of the manufacturer specific images. For example some devices are dual screen or have special hardware. This can be seen in the download/addon manager where there are references to LG and Samsung to name but a few.
Overall an avd is a simulation of an android device including the hardware configuration. You can have more than one, for example I have 3 to simulate different screen densities and android versions. They are great for testing and easy to setup via the avd manager, where you can also set other settings like the default avd.
To setup an avd instance go into eclipse or access via the android SDK folder (where ever you put it) both routes lead to the same GUI.

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