Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Distributing Android application to Specific Screens

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 182
    Comment on it

    In this post, you will learn how to distribute your android application to specific devices. You can choose the screens for that you want to distribute your application like only for tablets or only for mobile phones.

    You can publish two versions of your application for different screen sizes one for mobile devices and other for android tablets. <compatible-screens> element is used to to make the distribution of application to different screen sizes and density. Google play services use this information to filter the application for different screen sizes, so that only applicable device can download the application.

    If you want your application only for mobile phones:
    You can add the following lines if you want your application only for mobile phones:
     

    <manifest ... >
        <compatible-screens>
            <!-- all small size 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" />
            <!-- all normal size screens -->
            <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>

    You have to define <screen> elements inside <compatible-screens> for different screen sizes. Each <screen> element is for different density, because every screen has four different density configuration.

    If you want your application only for Tablets:
    You can add <support-screens> element to your manifest file, if you want your application only for tablets.

    <manifest ... >
        <supports-screens android:smallScreens="false"
                          android:normalScreens="false"
                          android:largeScreens="true"
                          android:xlargeScreens="true"
                          android:requiresSmallestWidthDp="600" />
        ...
        <application ... >
            ...
        </application>
    </manifest>

    It describes that your application does not support small and normal screen sizes and only applicable for large and extra large screens. It also describes that the application needs 600dp wide minimum usable area.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: