Missing Accounts in Android Emulator - android

I've an app that uses Android accounts - GoogleLoginService on (< 2.1) and AccountManager on 2.1 or greater. the app works fine on phones, but doesn't work on any of the emulators.
When I try adding accounts in emulator, it fails. In 1.6, option doesn't even exist.
Is there a workaround? I heard that there is a custom system.img that has Accounts inbuilt, but cant find one. I need it for 1.6, 2.1, 2.2

Are your emulators using the Google APIs versions of Android? If not, use the SDK manager to get those versions of Android, and create a new emulator with one of them as the target.

Related

Running Android Applications on Smartphone with Lower Versions

Hello I am new to Android Programming, I have a doubt, can I run and test all android applications that I am going to create on my HTC phone with ice cream sandwich. I am using android studio and I prefer to test apps on my HTC connecting via USB. My system is very slow while using an emulator it is very difficult to test on emulator
Also 'compile with' API means what, I understand minimum and target sdk in Eclipse..
Yes, you can use your physical device.
But the good practice is to create a range on AVDs from minimal to max Android versions, and to test your app (run tests if you have wrote them) in those AVDs.
Skipping this point will lead to some users dissatisfaction because your app can fail\crash on untested versions. Different Android versions do have some minor differencies in the API and libs behaviour.

Does HTC opensense SDK work only on android devices with HTC Sense?

Recently I just discovered the HTC opensense SDK.
Will this SDK only work on HTC devices, or devices with HTC Sense installed, or will it work on other devices?
Link: http://www.htcdev.com/devcenter/opensense-sdk
Has anyone used this SDK before?
There's a showcase of some of the successful third party apps at the bottom of this page that use the SDK:
http://htcdev.com/devcenter/opensense-sdk
The functionality of the SDK only works on HTC devices in general, although sometimes a library is included to help aid development on emulators like with the Scribe active pen API. We do recommend that you write apps as a single APK that works on all devices, however, be they HTC or otherwise.
You can do this by targeting the SDK just like you would target a high version of Android, then checking using reflection or other methods when to use the extra functions. This is the same approach most developers use for supporting features only introduced in newer versions of Android. You can also have an Android library project that targets the SDK and a main project that targets something else if needed, and still produce a single APK.
You can see an example of the first technique in the samples directory of the add on. That's android-sdk\add-ons\addon-opensense_sdk_for_tablets-htc-12\samples where android-sdk is where you installed the SDK and you have the current OpenSense SDK installed from the Google SDK Manager. The sample project name for that is SingleApkDemo. The name of the add on will probably change in the next release but we'll still have samples in the directory.

Android -- selecting API from SDK Manager

I have downloaded the Android SDK(which i think has no version, it is standard). After installing Android SDK, Android SDK Manager comes which by default selects 3 things to be downloaded (1)Android SDK tools(2)Android 4.0.3 (API 15) and the things under it like documentation, samples etc (3)Google USB driver But at present i am having book on Android 3, so should i deselect the second option i.e. Android 4.0.3 (API 15) and select all things under Android 3.0 (API 11) or keeping Android 4.0.3 will be OK for Android 3.I know there are tutorials for Android 4.0.3 on Web so why should i go for Android 3 because i find it easy through books and i got Android 3 here in my place and still no Android 4. So what should i do?
You can install everything. I would recommend to install the API level you want to develop for. But it doesn't hurt (but wastes disk space) to install everything.
Sidenote: Android 3.0 is for tablets, 2.x for older and 4.x for the latest Android Smartphone devices.
You should select the API level that you will target. For example, I am writing an application for API level 7 (Android 2.1.x), so I've got that version installed on my machine. Of course, you can have more than one API level installed, so it is safe to install any combination (for example 3.0.x and 4.0.4 simultaneously - see last paragraph for the reason).
Once you've got a few API levels installed, Eclipse will allow you to change the target API for your project to any of the versions you have installed. The same applies for the command-line project creation.
There is actually one good use-case for installing a version newer than the one you are targeting in addition to the one you use: testing. You can create an emulation environment for a newer version of the API to ensure that your application does not crash and burn when the API levels do not match. If we were to extend my above example, a sensible set of levels to install is 3.0.x, 3.2, and 4.0.4. You can target the initial release of Honeycomb (unless you need anything from the later versions), and test with both the latest Honeycomb and Ice Cream Sandwitch.

Which Android platform SDK do I need?

I would like to test and distribute my phonegap app. It already runs for iPhone.
At first I installed the newest SDK (4.0.3) but this one does not run on my phone. So... i guess I have to install more.
What do I need to install in the Android SDK Manager?
All SDKs? Do I need the Sample/Arm/GoogleAPI/Sources too?
Generally I install all the SDK versions as it is good to be able to test on the various emulators to make sure you app works in all versions of Android. You should always build your application with the latest SDK but in your AndroidManifest.xml file you should have a android:minSdkVersion set to the lowest Android level you want your app to run on. For now I recommend 7 (Android 2.1) as 97% of the phones are running 2.1 or above.
As you can see in the platform versions chart here it is recommended to use Android 2.1 or 2.2 SDK to cover almost all the Android devices on the market.
I think you don't need Sample/ARM/Sources, though if you need to use Google proprietary API (for example Google Maps API) you need to use Google API versions of 2.1 or 2.2.
You only need the SDK that matches the API level you intend to build for.
This page: http://developer.android.com/resources/dashboard/platform-versions.html
has a breakdown of what devices are most active in currrent use (accessed market within 2 weeks)
Judging by that, if you target 2.1 you'd be able to install your app on 98.3% of all such devices.
It is generally best to pick the oldest platform that supports all of the features you need. Just stay at or above 1.6, that is when support for multiple screen sizes was introduced.
As I think, the best solution is SDK 2.2. Many devices work with this android version.
On your Android phone go to settings->About Phone and view the Android version. This should be the sdk you will need. Afterwords, you can just change the target android sdk version in your app and it should run on your phone. As for the folders you speak of - they contain some examples, the source code of the sdk and some additional apis to use google services. It is up to you whether you will need them. You will definitely need the platform-tools from the Android SDK manager - they provide you with the adb tool that enables you to upload applications to your device.

compatibility Android 3.* with android 4

I want to build Android application. My target devices is tablets (not smartphones). Today exist only 3.* version of android OS, aimed for tablets. Is it normal if i begin build application for tablets in 3.* API? The tablets which will be release with android 4.0 (ice cream sandwich) can to run my application built on 3.0 API? Or me better to wait for 4.0 API if my target devices is tablets?
Generally, in which version of API to develop my app for tablets?
Thanks.
I'm pretty sure that the applications which run on Android 3.* will run on Android 4.* too, because there is no point of making and OS if the old application will not run and all the developers have to build their applications for the next version. So I suggest to build your application for Android 3.* if your target devices are tablets.
Android documentation says that all their SDK releases are forward friendly and that seems to be the case when using an emulator. I have an application that was written in 2.0, recently upgraded to 2.1 and we have some people in the office that have XOOM tablets (3.0) and we cant get it installed.
After some modifications to the manifest (suggested steps from droid dev portal) it still wont install on the XOOM at all.
If you are targeting tablets then i would start with 3.0. If there are features in 3.1 that you can't live without then have fun.

Categories

Resources