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/
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:
- From the Project Explorer, click Project Settings. The Project Settings window appears.
- Click the Native tab.
- Click the Android sub-tab, and then scroll down to the Manifest Properties & Gradle Entries section.
- 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_LOCATION | ACCESS_FINE_LOCATION | ACCESS_LOCATION_EXTRA_COMMANDS |
ACCESS_MOCK_LOCATION | ACCESS_SURFACE_FLINGER | ACCESS_WIFI_STATE |
ACCOUNT_MANAGER | AUTHENTICATE_ACCOUNTS | BATTERY_STATS |
BIND_APPWIDGET | BIND_DEVICE_ADMIN | BIND_INPUT_METHOD |
BIND_REMOTEVIEWS | BIND_WALLPAPER | BLUETOOTH |
BLUETOOTH_ADMIN | BRICK | BROADCAST_PACKAGE_REMOVED |
BROADCAST_STICKY | BROADCAST_WAP_PUSH | CALL_PHONE |
CALL_PRIVILEGED | CAMERA | CHANGE_COMPONENT_ENABLED_STATE |
CHANGE_CONFIGURATION | CHANGE_NETWORK_STATE | CHANGE_WIFI_MULTICAST_STATE |
CHANGE_WIFI_STATE | CLEAR_APP_CACHE | CLEAR_APP_USER_DATA |
CONTROL_LOCATION_UPDATES | DELETE_CACHE_FILES | DELETE_PACKAGES |
DEVICE_POWER | DIAGNOSTIC | DISABLE_KEYGUARD |
DUMP | EXPAND_STATUS_BAR | FACTORY_TEST |
FLASHLIGHT | FORCE_BACK | GET_ACCOUNTS |
GET_PACKAGE_SIZE | GET_TASKS | GLOBAL_SEARCH |
HARDWARE_TEST | INJECT_EVENTS | INSTALL_LOCATION_PROVIDER |
INSTALL_PACKAGES | INTERNAL_SYSTEM_WINDOW | KILL_BACKGROUND_PROCESSES |
MANAGE_ACCOUNTS | MANAGE_APP_TOKENS | MASTER_CLEAR |
MODIFY_AUDIO_SETTINGS | MODIFY_PHONE_STATE | MOUNT_FORMAT_FILESYSTEMS |
MOUNT_UNMOUNT_FILESYSTEMS | NFC | PERSISTENT_ACTIVITY |
PROCESS_OUTGOING_CALLS | READ_CALENDAR | READ_CONTACTS |
READ_FRAME_BUFFER | READ_HISTORY_BOOKMARKS | READ_INPUT_STATE |
READ_LOGS | READ_SMS | READ_SYNC_SETTINGS |
READ_SYNC_STATS | REBOOT | RECEIVE_BOOT_COMPLETED |
RECEIVE_MMS | RECEIVE_SMS | RECEIVE_WAP_PUSH |
RECORD_AUDIO | REORDER_TASKS | RESTART_PACKAGES |
SEND_SMS | SET_ACTIVITY_WATCHER | SET_ALARM |
SET_ALWAYS_FINISH | SET_ANIMATION_SCALE | SET_DEBUG_APP |
SET_ORIENTATION | SET_PREFERRED_APPLICATIONS | SET_PROCESS_LIMIT |
SET_TIME | SET_TIME_ZONE | SET_WALLPAPER |
SET_WALLPAPER_HINTS | SIGNAL_PERSISTENT_PROCESSES | STATUS_BAR |
SUBSCRIBED_FEEDS_READ | SUBSCRIBED_FEEDS_WRITE | SYSTEM_ALERT_WINDOW |
UPDATE_DEVICE_STATS | USE_CREDENTIALS | USE_SIP |
VIBRATE | WAKE_LOCK | WRITE_APN_SETTINGS |
WRITE_CALENDAR | WRITE_CONTACTS | WRITE_EXTERNAL_STORAGE |
WRITE_GSERVICES | WRITE_HISTORY_BOOKMARKS | WRITE_SECURE_SETTINGS |
WRITE_SETTINGS | WRITE_SMS | WRITE_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:
- In Volt MX Iris, from the Project Explorer, click Project Settings. The Project Settings window appears.
- Click the Native tab.
- Click the Android sub-tab and then scroll down to the Manifest Properties & Gradle Entries section.
-
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.
- To disable permissions, select the permissions from the right pane and click < Remove.
-
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.
For more information on Android Manifest tags and their attributes, refer Manifest Elements
Deeplink URL Scheme
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.
Android Manifest Example
The following is a basic AndroidManifest.xml
file that is generated with default permissions.