Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Android Device Compatibility: Multi-APK Strategies and Multi-Window Support

Tech 1

Separate APKs for Different Screen Configurations

Publishing device-specific APKs allows optimized distribution for various screen sizes. Google Play handles this automatically when you upload an Android App Bundle.

Multi-Window Support

Starting with Android 7.0 (API 24), all applications can run in multi-window mode by default. You can control this behavior using the android:resizeableActivity attribute.

Setting android:resizeableActivity="false" prevents your application from entering multi-window mode, forcing fullscreen display. The system handles this differently based on target SDK:

  • API 26+: The app fills the entire screen regardless of window configuration
  • API 25 and below: The app is constrained to a 16:9 aspect ratio (approximately 1.86). On devices with larger ratios, letterboxing occurs with unused space at top and bottom

To override this behavior for extreme aspect ratios, declare a maximum aspect ratio. Google recommends 2.4 (12:5) as a practical maximum. Values below 1.0 for Wear OS devices or 1.33 for other devices will be rejected by the system.

For API 26 and above, use the android:maxAspectRatio attribute within the <activity> element:

<activity android:name=".MainActivity"
          android:maxAspectRatio="2.4"
          android:resizeableActivity="false">
</activity>

For API 25 and below, add a <meta-data> entry under the <application> tag:

<application>
    <meta-data 
        android:name="android.max_aspect" 
        android:value="2.4" />
</application>

Important: When specifying a maximum aspect ratio, you must also set android:resizeableActivity="false". Without this, the max aspect ratio constraint will be ignored.

Testing Note: Applications marked as non-resizable should be tested across as many device configurations as possible. Verify that all UI controls remain visible, as some devices allow users to force fullscreen mode which affects layout rendering.

Multi-APK Distribution

Multi-APK support on Google Play enables publishing distinct APK files for different hardware configurations. Each APK represents a complete application variant, but they share:

  • The same package name
  • The same listing on Google Play
  • The same signing key

This approach becomes necessary when a single APK cannot adequately support all target devices. When uploading an App Bundle to Google Play, the platform automatically generates and serves device-optimized APKs containing only required resources and code.

For distribution outside Google Play, you must manually compile, sign, and maintain each APK variant.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.