How to edit Android's manifest file

Let us consider a hypothetical situation. Android stores backup local data in the cloud and in the case of your app in particular, this raises a data protection issue. At present, there exists no setting within LiveCode itself to prevent this. However, there is still a means in the form of the Android manifest.

The Android Manifest file

Every Android project comes with a manifest file, AndroidManifest.xml. This file is used to define various aspects of an app's metadata, grouped into various nodes such as activity, intent-filter, permission and uses-permission. The overwhelming majority of attributes contained within take the form android:<key>="<value>"

The template manifest file

All apps you build with any given version of LiveCode will use the same manifest template. In this particular scenario, it is necessary to edit this rather than the Manifest.xml created for the standalone.

On MacOS, the location of this file is /Applications/LiveCode <version>.app/Contents/Tools/Runtime/Android/Manifest.xml

On Windows, the location is <LiveCode install folder>\Runtime\Android\Manifest.xml

Editing the xml

In order to prevent the cloud backup issue described in the introduction from occurring, one must disable this particular feature by marking it as disabled in the Android manifest. Specifically, one would want to edit it to include the attribute android:allowBackup="false" in the application node.

First, close LiveCode.

Second, open the template manifest file at the location given above.

You will notice that LiveCode's template uses a lot of placeholder text, marked by $(). That particular text is to be left untouched; it is replaced with information specified in Standalone Application Settings. What is to be added however does not at present have an associated setting and, therefore, no associated placeholder text.

Find the <application> line. It should look something like:

<application android:label="${LABEL}" ${ICON} android:debuggable="false" ${ALLOW_HTTP_CONNECTIONS}>

Within this line, somewhere after ${ICON} but before the >, insert the text: android:allowBackup="false" and then save the change.

From the next time LiveCode is opened, until the change is reverted and LiveCode is re-opened, all Android apps created with this particular installation of LiveCode will not use Android's cloud backup.

 

For more information about the Android manifest file and its attributes, please consult the Android Developer documentation on the subject.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.