Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Android Manifest Architecture: Configuration, Libraries, and Permissions

Tech 1

Hardware Configuration Requirements

Applications define required hardware capabilities using <uses-configuration>. This prevents installation on devices lacking essential inputs. It is recommended to support directional keys for accessibility, or alternatively declare touch requirements via <uses-feature> to better control filter behavior across touch types.

<!-- Specify input method prerequisites -->
<uses-configuration
    android:reqFiveWayNav="true"
    android:reqHardKeyboard="false"
    android:reqKeyboardType="qwerty"
    android:reqNavigation="dpad"
    android:reqTouchScreen="finger" />

Configuration Attributes:

  • android:reqFiveWayNav: Boolean. Indicates necessity of a central select button with directional movement (up/down/left/right/dpad). Overrides reqNavigation if used generically.
  • android:reqHardKeyboard: Boolean. Enforces presence of a physical QWERTY-style keypad.
  • android:reqKeyboardType: Enum. Specifies keyboard layout (nokeys, qwerty, twelvekey, undefined). Does not distinguish betwean physical and virtual layouts.
  • android:reqNavigation: Enum. Defines navigation hardware (nonav, dpad, trackball, wheel, undefined).
  • android:reqTouchScreen: Enum. Requires touch interaction (stylus, finger, notouch). Prefer <uses-feature> for detailed touch event capabilities.

Shared Library Management

To enforce dependency on external system libraries, use <uses-library> within the Application scope. This element adds class loaders for specific libraries and affects availability on the distribution platform. If android:required="true" is set, the Package Manager blocks installation on devices missing the library.

<!-- Define critical shared resources -->
<uses-library
    android:name="com.google.android.maps"
    android:required="true" />
  • android:name: Identifies the library package path. Reference official docs to find available system libraries.
  • android:required: Boolean defaulting to true. Set to false to allow installation without the library, provided runtime checks verify its existence before usage.

System Permission Declarations

Permissions listed here dictate system privileges needed at install time or launch time. Declare hardware-sensitive permissions explicitly via <uses-feature> to manage Google Play filtering accurately, rather than relying on implicit inference.

<!-- Request restricted access scopes -->
<uses-permission
    android:name="android.permission.CAMERA"
    android:maxSdkVersion="20" />
  • android:name: String identifier for the permission (e.g., READ_CONTACTS).
  • android:maxSdkVersion: Integer limit. Useful for legacy permissions dropped in later releases. For instance, external file writes might only be mandatory up to API level 19. Omitting this ensures compliance across all versions unless specifically targeted.

API Level Specific Permissions

For features introduced alongside Android 6.0, use <uses-permission-sdk-23>. This ensures permissions are requested only on devices supporting runtime grant mechanisms (SDK 23+). On older systems, these declarations are ignored, preventing unnecessary upgrade barriers.

<!-- Handle modern permission models conditionally -->
<uses-permission-sdk-23
    android:name="android.permission.RECORD_AUDIO"
    android:maxSdkVersion="25" />
  • android:name: The specific permission identifier required.
  • android:maxSdkVersion: The upper bound for API levels where this permission remains active for the app.

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.