PhoneGap or Cordova lowest SDK version target - android

Up until now I have been doing my Cordova development on a Nexus 5 and Galaxy S4 which are running Android 4.4.2 and 4.2.2 respectively.
I recently tried development on a device running 4.0.4 and it wouldn't install. I found out this was due to my manifest which had:
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="19" />
I quite easily changed the minSdkVersion to one that suited that of Android 4.0.4 (15) and it compiled.
I was just wondering though, does anyone know if there are any functions used within Cordova or PhoneGap which would require an elevated minSdkVersion?
Is it only dictated by any plugins or native code that is written?

Phonegap requires at least Android 2.2. Taken from the documentation: "Cordova supports Android 2.2, 2.3, and 4.x." As long as you are above version 7 you are fine. If you're using an HTML5 framework like e.g sencha you should check their restrictions, too. It makes sense to support the minSDK 10 as there are still many devices (about 20%) of Android users which are running on Gingerbread as you can see in Googles fragmentation chart.
To answer your second question: of course it would be possible that a plugin features functionality which is only available on newer devices. In that case you have to make the decision if you rather go up with your minSDK by locking out users, or you do it without the functionality. It all depends on how well your plugin is written - normally it should also work on devices which don't feature the higher level APIs and react properly (e.g "sorry, your device is too old for that feature get a new one" ;)
Hope that helps!

Related

Android App compatibility Issue- Testing and Release (Min sdk and target sdk and ActionBar)

I'm new to Android development. I know this question is asked before. I've developed an Android application, tested it on OS Ver > 4.0.4 android phones. It worked fine. My SDK settings in the manifest file are below.
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="19" />
Doing so, will it limit the audience for the application? I see that I cannot allow the users who has V < 3.0 because of the ActionBar. But, does the SDK versions have any compatibility issues? I'd like to keep a wider Audience to this app, but do not have bandwidth to test on all versions. Thanks.
I'm releasing app next month. What are the issues that I have to take care of when releasing in context of the app compatibility in the Android developer console?
Thanks.
A minSdkVersion value of 9 indicates that the app will be available for devices running Android 2.3 (Gingerbread). If you want to restrict it to devices running 3.0 and above, you have to have a minSdkVersion of 11.
If ActionBar is the only contentious issue preventing you from distributing to devices running Android version <3.0, you can use the Support Library to make it available for Android versions 2.1 and above.
I'd like to keep a wider Audience to this app, but do not have bandwidth to test on all versions.
I do not understand what you mean by "bandwidth", but if you really want to test it on all versions, you can create emulators for each of these version and test it.

Android build target

I've been writing my first android app and so far have just been building against the highest android SDK available - 4.1. Up until this point I have only been testing on a physical device running 4.03 and everything seems to work fine.
I would like my min SDK level to be level 8 (2.2) and as far as I know I have not used anything from the APIs higher than this.
However if I build against 4.1 and run on a 2.2 emulator it just shows a white screen and no crash (OpenGL based so something going wrong with this). The same build runs fine on a 4.1 emu and my 4.03 device.
If I build against 2.2 with the exact same code it runs on the 2.2 emu fine.
I don't really know what could be causing this so any tips would be great. Do some classes get replaced in the newer APIs? If they were removed entirely I would assume it just wouldn't build at all against the new version.
Should I be setting my build target equal to my minimum? I am not using anything from the APIs higher than 2.2 currently but I was under the impression I should be building against the newest SDK available. Are there any negative effects of building for the lowest version for instance does it affect the look of the menus/dialogs?
Any help is appreciated, thanks.
You should build against the lowest SDK version you intend to be supported by your app (e.g., if you want to support users don't having the newest smart phones or tablets, building against the newest SDK version wouldn't be a good idea).
Generally, newer SDK versions only include additional classes and functions, but I am not 100% sure about any removed classes.
add this to your AndroidManifest.xml
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="15" />

How can I use PhoneGap 1.7 for deployment on Android 2.x devices?

I am currently using PhoneGap 1.7, just having created the HelloWorld app, per the instructions at their site. However, I believe it requires Android Revision 15 or higher (4.0.3). I will eventually be wrapping a jQuery Mobile app with PhoneGap and I need it to be runnable on Android 2.x. Android 1.x and 3.x would be nice but are not required. How can I create a deployable app that will work on 2.x and 4.x versions of Android (with 1.x and 3.x being optional)? I hope I don't have to have different versions of PhoneGap and thus different deployment app versions. I'd like to have one deployable app for all versions.
Thank you very much for any help.
I am not familiar at all with phonegap. But with native development the API levels are backward compatible. So you can build the application with API 15, but set the android:minSdkVersion in the manifest to something lower. I imagine this is how phonegap works also, so even though you are using the newest API level it should still be backward compatible.
i.e. in the manifest of a native app
<uses-sdk android:minSdkVersion="7"/>
would indicate that the application is able to run on any devices that are Android 2.1 or newer. Even though you've added the 4.0.3 android jar file to your project the system is smart enough to make sure that it still works on the older devices as long as you set this in the manifest.
It is also worth noting that if your app takes advantage of any newer API's then you'll have to come up with a way to ensure those features get turned off if the app detects that the OS version it is currently on is too old to support the feature.

Why is our Android 2.2 application "incompatible" with Android 2.3.5

We are seeing a problem with our company's application that has me very confused about the Android compatibility model.
Our app supports Android 2.1 and later. It is targeted for 2.2 and later. Our application manifest expresses this as follows:
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="7"></uses-sdk>
One of our customers is having a problem running our app on a Sprint Motorola XT603, Android 2.3.5.
The app is visible to them in the Market (as expected), yet when they try to run it, they get the following failure:
*'This app is incompatible with your Sprint Motorola XT603'.*
An interesting tidbit is that developer.android.com does not even list 2.3.5 as an Android version: http://developer.android.com/guide/appendix/api-levels.html.
From what I have read, I believe we are properly using the <uses-sdk> entry. We have successfully installed and run our app on later Android version (HoneyComb/3.0).
Is anyone familiar with 2.3.5 and why this compatibility issue exists?
Android 2.3 is actually available in its 2.3.7 version.
But 2.3.5 to 2.3.7 are just bug fixes and application updates (for example : voice and video chat in Google Talk in 2.3.4), nothing new for developers...
It would have been a nonsense to change API level... 2.3.3+ is API level 10.
On the other hand, if the android market allows them to install the application, this application is assumed compatible: do your customers use a custom ROM ?

How do I emulate a HoneyComb-compatible app on older emulators?

I began the process of making one of my apps Honeycomb-friendly.
I started by changing the project's target build to version 11, and edited to AndroidManifest.xml to use:
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="11" />
These are the only changes I made so far. I am able to test it perfectly on my Honeycomb tablet device.
However, I cannot get Eclipse to launch this app in an older emulator (e.g. version 9). Technically speaking, the app should run in older android versions, so what can I do to test this app for older devices?
Or am I doing something else wrong?
I'm by no means an expert on this front but setting the minSdkVersion different from the targetSdkVersion doesn't make the app automatically use a different API level based on the device. See this:
Android Min SDK Version vs. Target SDK Version
and this:
http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html
I suspect that because your application is using level 11 apis it won't run on a device that is of a previous API level.
This seems to be some sort of bug. When my 3.1 device is plugged into my PC, Eclipse/Android won't let me launch a new emulator that's < 3.0.
I worked around this by launching the emulator before I plug in my device, and then it has no problems deploying the app to both of the running devices.

Categories

Resources