Launching Android 2.x application in 1.x emulator

I need to get the Android project created in Eclipse for the 2.0 platform to run on 1.5 AVD (emulator). This is because I am writing an application that will support the Contacts API and ContactsContract API.

Does anyone know the magic word for this to happen?

+3
source share
2 answers

If we are really talking about an Android project (folders with source .java files and all the necessary XML files, etc.), just right-click the project folder and click Properties. In the properties window, select the section Androidin the left pane. Now just select the project creation goal that you want to use and click Apply.

EDIT: If you want to ensure backward compatibility of some functions, just check the SDK version and decide what to do with the version of the SDK version of the specific version.

int sdk = new Integer(Build.VERSION.SDK).intValue();

if(sdk >= 5) {
    // do whatever you need
}
else {
    // do whatever else you need
}
0
source

Check the answers to this question: How to use the contact API for Android 1.x and 2.x at the same time?

- , , . , , 1.x, 1.x, , 2.x, API.

0

Source: https://habr.com/ru/post/1774806/


All Articles