Android- Running my application on 2.1 and higher versions - android

I want to make application that support 2.1 or higher platforms. Does anyone have solution for it?
Can I use somekind of cross-platform for it or cross-platefroms are only for porting applications from differnt OS? Or there is any library i can use for this purpose?

Any application built with Android 2.1 API will work later versions of Android (theoretically). In the AndroidManifest.xml file, set the target SDK version to 2.1, and the 2.1 API will be loaded by Eclipse for the application. Done. It's still recommended to test it on later versions in case there's some slight variations that aren't documented, but most if not all things should work.

Just code your application and in your AndroidManifest put this somewhere <uses-sdk android:minSdkVersion="7" />.
That corresponds to Android 2.1, more details here http://developer.android.com/guide/appendix/api-levels.html

Related

Is there a way to change a project from using API 12 to API 8

I set up my project to use Android 3.2 (API Level 12), but it seems like a lot of phones are still using Android 2.2 (API Level 8).
Is there a way to change my project from only supporting Android 3.2+ to supporting back to Android 2.2?
yes...just change the minsdk number in the manifest. You have to be sure that you don't use any feature that is not supported though...
in your AndroidManifest.xml add this line:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />
android:minSdkVersion tells the Store what the minimum version you are targeting is. In this case 2.2. Devices less than 2.2 won't be able to download your app.
android:targetSdkVersion tells the store what the best version you are developing for is. In this case 4.1. Devices over 4.1 can still download your app but certain features may run in compatibility mode.
NOTE: When you setup your project to use 3.2, all you did was select the Android SDK you wanted your IDE to use when checking and compiling your code. Without the uses-sdk line in your manifest you've targeted nothing.
Right Click Project -> Properties -> Android -> Select SDK version
Update Manifest, min/target api. (as others have described by others).
Go to your Manifest.xml file and edit the minSdkVersion to 4. That will set it way back to 1.5 or something like that :). You can make that number higher if you want to suit a higher API, but I like compatibility.

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.

What happens if we use/install 2.3 build in 2.2 device

I am working on application which should go into android 2.2(Froyo) and android 2.3(GingerBread) devices.
I have built application with android 2.3 SDK , and Installed the same application in 2.2(Froyo) and 2.3 (Ginger Bread) devices.
In both the devices application installed successfully and it is working properly.
I want to know if we install the higher version build into lower version devices is there any chances to face problems.
Till now I didn't found any issue with this.
I didn't used the MIN:SDK version field in the Manifest file.
If you want only users from version 2.2 and up to download your app, just make sure your minimum SDK version is 2.2 by putting this line in your AndroidManifest.xml:
<uses-sdk android:minSdkVersion="8" />
If you want an upper bound limit as well, you can add:
android:maxSdkVersion="10"
So users with Android SDK version 2.2 up to 2.3.3 will be able to install your app.
Regarding problems: If you're using a specific SDK API then just make sure to add an if clause around it to make sure you're on the right version. The best thing to do is change the target to 2.2 just to see if you have any compilation errors... Then you'd know what to change.
Then just fix the problems, change back to 2.3 and build.
If you don't specify the minimum sdk attribute in the manifest file users with 2.2 won't see your application on the market. It specifies that your application supports 2.2 so that users can see the app on the market.
Make sure any functionality that you use from 2.3 has an alternative functionality so that 2.2 users have the ability to actually use your application.
yes , u can find problem ,
try to install that app on android 1.6
it's about API version , there will be some APIs in your app doesn't supported in a lower API version

Can i run Android 2.0 application in Android 1.5?

I developed one simple android application targeting the Mobiles with android 2.0 OS.I want to know whether i can run the same application in android 1.5 .If any body knows it please help me out.
In your AndroidManifest.xml file (located in the base of the project) there's a tag called uses-sdk
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
Those numbers are known as API level where 3 is for Android 1.5 and 5 is for Android 2.0.
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
Note that this allows you to compile your code against the 2.0 SDK but if you use classes or functionality in your app that is not supported in 1.5 then it will crash. I recommend that you create an AVD for 1.5 and 1.6 for testing.
You may want to consider just compiling against 1.5 for simplicty.
Lastly, a common trick is to compile against 2.0 and avoid/disable features that aren't supported in earlier versions of android the following article shows how do this.
http://developer.android.com/resources/articles/backward-compatibility.html

Categories

Resources