Skip to content

The Android Manifest File

When you build an Android app by using Volt MX Iris, an AndroidManifest.xml file is created in the app's corresponding dist folder. The file is located at WorkspaceName>/temp//build/luaandroid/dist. The manifest file provides essential information about your app to the Android operating system, and Google Play store.

The Android manifest file helps to declare the permissions that an app must have to access data from other apps. The Android manifest file also specifies the app’s package name that helps the Android SDK while building the app. The Android manifest file provides information such as activities, services, broadcast receivers, and content providers of an android application.

With Volt MX Iris, you can define the following options in the AndroidManifest.xml file:

  • Supported screen sizes
  • Supported SDK versions: minimum, target, and maximum
  • Ability to send Push Notifications
  • Various permissions for the application

To modify the Android Manifest.xml file from Iris, follow these steps:

  1. From the Project Explorer, click Project Settings. The Project Settings window appears.
  2. Click the Native tab.
  3. Click the Android sub-tab, and then scroll down to the Manifest Properties & Gradle Entries section.
  4. Configure the Permissions, Tags, and Deeplink URL scheme tabs. More information on how to

to configure manifest properties such as Permissions, Tags,and Deeplink URL in the Android Manifest file. Here is an example of a basic Android Manifest file generated with default permissions.

Permissions

An app must have certain permissions to access data from the other apps. By default, Volt MX Iris enables and disables certain permissions in the AndroidManifest.xml file. When you build an application, an AndroidManifest.xml file is automatically generated for the app. This manifest file will contain permissions based on how you have configured those permissions. If you have not specified any permissions explicitly, default permissions would apply.

For more information on the AndroidManifest.xml file, refer App Manifest on the Android Developer site.

The following permissions are set to true and added by default:

  • ACCESS_NETWORK_STATE
  • INTERNET
  • READ_PHONE_STATE

These permissions are set to false by default. You can add the permissions according to the requirements.

ACCESS_COARSE_LOCATIONACCESS_FINE_LOCATIONACCESS_LOCATION_EXTRA_COMMANDS
ACCESS_MOCK_LOCATIONACCESS_SURFACE_FLINGERACCESS_WIFI_STATE
ACCOUNT_MANAGERAUTHENTICATE_ACCOUNTSBATTERY_STATS
BIND_APPWIDGETBIND_DEVICE_ADMINBIND_INPUT_METHOD
BIND_REMOTEVIEWSBIND_WALLPAPERBLUETOOTH
BLUETOOTH_ADMINBRICKBROADCAST_PACKAGE_REMOVED
BROADCAST_STICKYBROADCAST_WAP_PUSHCALL_PHONE
CALL_PRIVILEGEDCAMERACHANGE_COMPONENT_ENABLED_STATE
CHANGE_CONFIGURATIONCHANGE_NETWORK_STATECHANGE_WIFI_MULTICAST_STATE
CHANGE_WIFI_STATECLEAR_APP_CACHECLEAR_APP_USER_DATA
CONTROL_LOCATION_UPDATESDELETE_CACHE_FILESDELETE_PACKAGES
DEVICE_POWERDIAGNOSTICDISABLE_KEYGUARD
DUMPEXPAND_STATUS_BARFACTORY_TEST
FLASHLIGHTFORCE_BACKGET_ACCOUNTS
GET_PACKAGE_SIZEGET_TASKSGLOBAL_SEARCH
HARDWARE_TESTINJECT_EVENTSINSTALL_LOCATION_PROVIDER
INSTALL_PACKAGESINTERNAL_SYSTEM_WINDOWKILL_BACKGROUND_PROCESSES
MANAGE_ACCOUNTSMANAGE_APP_TOKENSMASTER_CLEAR
MODIFY_AUDIO_SETTINGSMODIFY_PHONE_STATEMOUNT_FORMAT_FILESYSTEMS
MOUNT_UNMOUNT_FILESYSTEMSNFCPERSISTENT_ACTIVITY
PROCESS_OUTGOING_CALLSREAD_CALENDARREAD_CONTACTS
READ_FRAME_BUFFERREAD_HISTORY_BOOKMARKSREAD_INPUT_STATE
READ_LOGSREAD_SMSREAD_SYNC_SETTINGS
READ_SYNC_STATSREBOOTRECEIVE_BOOT_COMPLETED
RECEIVE_MMSRECEIVE_SMSRECEIVE_WAP_PUSH
RECORD_AUDIOREORDER_TASKSRESTART_PACKAGES
SEND_SMSSET_ACTIVITY_WATCHERSET_ALARM
SET_ALWAYS_FINISHSET_ANIMATION_SCALESET_DEBUG_APP
SET_ORIENTATIONSET_PREFERRED_APPLICATIONSSET_PROCESS_LIMIT
SET_TIMESET_TIME_ZONESET_WALLPAPER
SET_WALLPAPER_HINTSSIGNAL_PERSISTENT_PROCESSESSTATUS_BAR
SUBSCRIBED_FEEDS_READSUBSCRIBED_FEEDS_WRITESYSTEM_ALERT_WINDOW
UPDATE_DEVICE_STATSUSE_CREDENTIALSUSE_SIP
VIBRATEWAKE_LOCKWRITE_APN_SETTINGS
WRITE_CALENDARWRITE_CONTACTSWRITE_EXTERNAL_STORAGE
WRITE_GSERVICESWRITE_HISTORY_BOOKMARKSWRITE_SECURE_SETTINGS
WRITE_SETTINGSWRITE_SMSWRITE_SYNC_SETTINGS

Set Android Manifest Permissions

You can modify the permissions in the AndroidManifest.xml file based on the requirements of the application.

To set the permissions in the Android Manifest file, follow these steps:

  1. In Volt MX Iris, from the Project Explorer, click Project Settings. The Project Settings window appears.
  2. Click the Native tab.
  3. Click the Android sub-tab and then scroll down to the Manifest Properties & Gradle Entries section.
  4. To enable permissions, select the permissions from the left pane and click Add >.
    For example, If you need to save images to an external storage device such as USB drive or SD card, add the WRITE_EXTERNAL_STORAGE setting.

    Note: To select multiple permissions, hold the Ctrl key and click the permissions. To select continuously listed permissions, hold the Shift key and click the permissions.

  5. To disable permissions, select the permissions from the right pane and click < Remove.

  6. Click Finish.
    When you build the app, Volt MX Iris generates the manifest file with the permissions that you specified.

    • If the app lists normal permissions in its manifest (permissions that don't pose risk to the user's privacy or the device's operation), the system automatically grants those permissions to the app.
    • If the app lists dangerous permissions in its manifest (permissions that could potentially affect the user's privacy or the device's normal operation), the app must explicitly request those permissions.

For more information on requesting runtime permissions, refer Runtime Permissions.

For more information on the list of dangerous permissions, refer Dangerous Permissions List.

Tags

Apart from the permissions, you can also configure tags such as application and activity. Following is a list of the manifest tags that can be configured from Iris:

  • Child Tag entries under tag
  • Child Tag entries under tag

  • Application Tag Attributes (ex: android:name=”string”)

  • Manifest Tag Attributes

  • Child Tag Entries under Main Launcher tag

  • Main Launcher Tag Attributes

For example, manifest attributes can be modified in the Android manifest file as follows.

<manifest xmlns: android = "http://schemas.android.com/apk/res/android"  
xmlns: tools = "http://schemas.android.com/tools"
package = "com.orgname.Sample"
android: versionCode = "1"
android: versionName = "1.0.0" //Manifest attributes>

For more information on Android Manifest tags and their attributes, refer Manifest Elements

You can use the URL Scheme tab for Deeplinking. The values for Scheme/ port/ path/host/pathprefix/path pattern specified under the Deeplink URL tab can be used to deep-link to a particular URL directly.

For example, if a scheme is defined as https and a host is defined as www.example.com, the following entry will be added to the Android manifest.xml file under intent-filter tag of default activity.

<intent-filter> <data android: scheme = "https"
android: host = "www.example.com"/> </intent-filter>

Android Manifest Example

The following is a basic AndroidManifest.xml file that is generated with default permissions.

<? xml version = "1.0"
encoding = "utf-8" ?>
//Manifest attributes

< manifest
xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: tools = "http://schemas.android.com/tools"
package = "com.orgname.Sample"
android: versionCode = "1"
android: versionName = "1.0.0" >
//Application attributes are added here  

< application
android: name = "com.konylabs.android.KonyApplication"
android: icon = "@drawable/Sample_icon"
android: label = "@string/app_name"
tools: remove = "supportsRtl"
tools: replace = "icon" >
//Activity attributes are added here  

< activity
android: name = ".Sample"
android: configChanges = "locale|keyboardHidden|orientation|screenSize|screenLayout"
android: label = "@string/app_name"
android: launchMode = "singleTask"
android: screenOrientation = "sensor"
android: theme = "@style/Theme.AppCompat.NoActionBar"
android: windowSoftInputMode = "adjustResize" > < intent - filter > < action android: name = "android.intent.action.MAIN" / > < category android: name = "android.intent.category.LAUNCHER" / > < /intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" / > < category android: name = "android.intent.category.DEFAULT" / > < /intent-filter>
            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable
" /> //Deeplink text is added here
//Add Child Tag Entries under Main Launcher here if required 

        </activity>
        <meta-data
            android:name="
android.app.default_searchable "
            android:value=".VoltMXMain " />
        <provider
            android:name="
com.orgname.Sample.SampleSearchSuggestionProvider "
            android:authorities="
com.orgname.Sample.SampleSuggestionProvider " />
    </application>
    //supported screens
    <supports-screens
        android:anyDensity="
true "
        android:largeScreens="
true "
        android:normalScreens="
true "
        android:smallScreens="
true "
        android:xlargeScreens="
true " />
    //These are the default permissions set as true
    // Add permissions here

    <uses-permission android:name="
android.permission.READ_PHONE_STATE " />
    <uses-permission android:name="
android.permission.ACCESS_NETWORK_STATE " />
    <uses-permission android:name="
android.permission.INTERNET " />

    //Add the Manifest child tags here if required


</manifest>