简体   繁体   中英

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.

ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM