android-Creating Multiple APKs for Different Screen Sizes,Creating Multiple APKs for Different GL Te

desaco發表於2016-02-01

>Creating Multiple APKs for Different Screen Sizes

 When developing your Android application to take advantage of multiple APKs on Google Play, it’s important to adopt some good practices from the get-go, and prevent unnecessary headaches further into the development process. 

 >If you can manage it, confining your application to a single APK has several advantages, including:

  • Publishing and testing are easier
  • There’s only one codebase to maintain
  • Your application can adapt to device configuration changes
  • App restore across devices just works
  • You don’t have to worry about market preference, behavior from "upgrades" from one APK to the next, or which APK goes with which class of devices

> Putting this all together, your Android Manifests would likely look something like the following:

Blue:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="1001" android:versionName="1.0" package="com.example.foo">
    <supports-screens android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true" />
    ...

Green:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="2001" android:versionName="1.0" package="com.example.foo">
    <supports-screens android:smallScreens="false"
        android:normalScreens="false"
        android:largeScreens="true"
        android:xlargeScreens="true" />
    ...

Red:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="3001" android:versionName="1.0" package="com.example.foo">
    <supports-screens android:smallScreens="false"
        android:normalScreens="false"
        android:largeScreens="false"
        android:xlargeScreens="true" />
>Creating Multiple APKs for Different GL TextTures

If you can manage it, confining your application to a single APK has several advantages, including:

  • Publishing and Testing are easier
  • There’s only one codebase to maintain
  • Your application can adapt to device configuration changes
  • App restore across devices just works
  • You don’t have to worry about market preference, behavior from "upgrades" from one APK to the next, or which APK goes with which class of devices
>Creating Multiple APKs with 2+ Dimensions

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="0344001" android:versionName="1.0" package="com.example.foo">
    <uses-sdk android:minSdkVersion="3" />
    <supports-screens android:smallScreens="false"
        android:normalScreens="false"
        android:largeScreens="false"
        android:xlargeScreens="true" />

相關文章