Android: How to maintain backwards-compatibility?

2019-05-24 03:47发布

According to the instructions found here, to make your app state which screen sizes you can support, you'll need to compile your app against Android 1.6.

Using the minSdkVersion and targetSdkVersion this should run also on Android 1.5:

  <uses-sdk android:minSdkVersion="3" 
          android:targetSdkVersion="4"/>

However, when I try to launch my app from Eclipse to run in a emulated 1.5, I get the following error:

 Failed to find an AVD compatible with target 'Android 1.6'.

Is this an error of the eclipse tools/emulator? Or how do I get it to also target 1.5 correctly while giving me the option to specify the supported screens?

1条回答
虎瘦雄心在
2楼-- · 2019-05-24 04:08

You can force Eclipse/ADT to show you a list of all available targets and let you pick an older target by changing your debug and run configurations:

  1. Select Run > Debug Configurations... (or Run Configurations)
  2. In the left pane, select Android Application > (your project)
  3. Open the Target tab in the main view
  4. For 'Deployment Target Selection Mode', choose Manual
  5. Press Apply, then Close
查看更多
登录 后发表回答