Friday Sep 06, 2013

Recently Google Play made a number of changes, so that it is much more strict in terms of Android device/form factor support. For example, if you simply published an ADF Mobile application on Google Play and then try to download the app from an Android tablet, you may see "This Application is not compatible with your device". This is true even if you have created tablet-optimized screen in your ADF Mobile application. This is because Google Play now inspects the content of AndroidManifest.xml file for supported screen form factors. Google Play uses the "Supports Screen" element in the AndroidManifest.xml file to determine what devices/form factors are supported. Summary of the supported form factors and densities are described here: Supporting Multiple Screens | Android Developers. ADF Mobile supports different screen density display already in the deployment profile, and you don't really have to do anything there other than specified the required icon resources. As for screen size, you would need to add the "Supports Screen" element in the manifest xml file template for the screen size you want to support. For example, if you want to add to support all devices:

<supports-screens android:smallScreens="true"

android:normalScreens="true"

android:largeScreens="true"

android:xlargeScreens="true"/>

The Android site would give you definitions of what these different sizes mean. Basically, Normal = most of the smartphones, Large = small tablets with ~7 inch display, and xLarge = ~10 inch display.

Furthermore, when you download the ADF Mobile application from Google Play and attempt to install it, you will also see the application requesting all sorts of device permissions, regardless of whether you are actually using that device service or not. By default, ADF Mobile declares all the device permissions that may potentially be required by the framework. Therefore, for example, even if the app does not access camera, the AndroidManifest.xml file will still contain references to camera permissions. Ability to selectively choose the correct hardware permissions is planned for the next release of ADF Mobile. In the meantime, you can modify the AndroidManifest.xml file template in the ADF Mobile extension as the workaround.

Here is what you will need to do to update the AndroidManifest.xml template:

Unzip the file, which would extract all files into a "framework" directory

Navigate to framework/template/AndroidManifest.template.xml file

Use a text editor to modify the device permissions, as well as adding the supports screen element as referenced above. Check the list of device permissions and their definitions here for device permission modification, and please ensure you remove only the ones that you don't need. Note that some permissions are required for framework to operate. Please see the example below on what permissions are needed - the example below shows permissions required by the framework + GPS access.

Zip up the framework directory and name zip file as Oracle_ADFmf_Framework.zip, replacing the old one. Please make sure the zip file has the exact same directory structure as before.

In JDeveloper, before deploying the application again, please do a "Clean All" to clean out all old deployment artifacts.

Deploy the app - the app should now be visible for tablets, as well as has the appropriate permissions.

Upload the app to Google Play - no additional actions are needed in Google Play around supported form factors and device permissions.

Now Android deployment process does not do any extra validation for what device permissions are actually needed, so it's up to you to ensure these are set correctly. Also, you do not need to change the minimum and target API levels in the deployment profile - you would change it only if you want to restrict the application to support certain Android versions.

Below is an example of the Android Manifest template file where device permissions have been striped down to only include GPS access and what the framework needs, but screen form factors have been specified to support all smartphone and tablet devices.

About

This blog is is dedicated to announcements,tips and tricks and other items related to developing, integrating, securing, and managing mobile applications using Oracle's Mobile Platform. It is created and maintained by the Oracle Mobile product development team.