Thursday 19 May 2011

Let your application compatible with Android 3.0 system

Recently, many Android application developers said they can not be compatible with Android 3.0, the current first-line 3.0, flat panel manufacturers are introduced, the following is compatible Android123 to everyone that it flat-panel methods:
1. Download the upgrade Android 3.0 SDK, at least to r10 upgrade the ADT plug-in version
 
2. If you do not Android 3.0 devices can also use the simulator, but the default resolution is 1280x800 most of the flat 3.0 WXGA, usually 1440x900 resolution 19-inch PC may appear to be cautious.
 
3. Androidmanifest.xml file settings api level, compatible with 3.0 is set to <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" /> so that your applications are compatible from the Android 1.6 to 3.0, of course, API Level 3.1 corresponding to 12.
 
4. For distribution of resources to provide res / layout-xlarge-land in this sector, generally flat relative to the phone is rotated 90 degrees to use, the equivalent horizontal screen, so the added land.
 
5. To make use of pixel-based devices, such as dip, sp, while the control attention android: layout_weight property use.
 
6. If your application must support the phone module, that is pure wifi version is not available, you can add <uses-feature android:name="android.hardware.telephony" /> androidmanifest.xml phrase, of course, not specified need to use <uses-feature android:name="android.hardware.telephony" android:required="false" />, or you can call at runtime, but the logic of classes relevant to consider the call can not be initialized , PackageManager pm = getPackageManager (); boolean hasTelephony = pm.hasSystemFeature (PackageManager.FEATURE_TELEPHONY);
 
7. So that your application is compatible with all resolutions
<manifest ...>
...
<compatible-screens>
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
</ Compatible-screens>
<application ...>
...
<application>
</ Manifest>
 
8. If you need to design a pure Android 3.x applications, can be considered
<manifest ...>
...
<Supports-screens android: smallScreens = "false"
android: normalScreens = "false"
android: largeScreens = "false"
android: xlargeScreens = "true" />
<application ...>
...
<application>
</ Manifest>

No comments:

Post a Comment