How i can migrate my app from 1.5 to 1.6 api fast and safe?
i am making a gigantic app for android, and i start doing it some moths ago for android 1.5, but now i know t开发者_StackOverflowhat some of the things i need for my app only can be done if you are programming for 1.6 api.
there is a easy, fast and safe way to migrate my app from 1.5 to 1.6 without having to lose time?
thanks
Since you are going to a newer version, I don't think that any code changes will be needed.
You need to:
1) Update the minSdkVersion in the AndroidManifest.xml. For android 1.6 it should be minSdkVersion = 4
. If you don't have that already, it is a good practice to always include it in the manifest. Add this line:
<uses-sdk android:minSdkVersion="4" />
as the last line before the closing tag of the manifest.
2) Change the target (again to 4) in your IDE or ant build scripts. In Eclipse right click your project, select Properties, Android and change the Project Build Target. Your project will recompile, when you click the Apply button.
Then, do a re-compile. I don't expect any errors to occur, but if they do, they will only be a few and you will be able to correct them quickly.
I use the following in my manifest file:
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4" />
At the same time I have configured Eclipse to use the Android 2.2 API. This way I ...
- support small screens
- can use the latest features (as long as I do it with care)
- android 1.5 users can still use my app (as long as I make sure it degrades gracefully)
See http://developer.android.com/guide/appendix/market-filters.html
精彩评论