Next lesson playing in 5 seconds

Cancel
  • Overview
  • Transcript

2.2 Android Preferences

In this lesson, I'll teach you about some Android-specific preferences in the config.xml file.

2.2 Android Preferences

Hello, everyone. This is Reggie Dawson. Welcome to the Publish an App with Cordova course for Tutsplus. In the last video, we discussed global and multi-platform preferences. In this video, we will look at the Android specific preferences and what they do. First we have the KeepRunning preference which determines if the application continues to run after a pause event. Setting it to false does not kill the app, it simply halts the code while the app is in the background. Next, the LoadUrlTimeout specifies how long to wait when loading a page before giving a timeout error. The default is 20,000 milliseconds, or 20 seconds. Then the InAppBrowserStorageEnabled preference controls whether pages open in the in-app browser can access local storage. The InAppBrowser plugin allows you to open external pages in a Cordova app. This plugin cannot access the Cordova APIs or local storage. This preference will allow your in-app files to access both local storage and web SQL storage. Then we have the LoadingDialog and LoadingPageDialog preferences. They both display a dialog with a specified title and message when a page loads. The title and message are separated by a comma. The difference between the two is that the LoadingDialog appears when you load the first page of an app. The LoadingPageDialog loads for every page in the application. Then we have the ErrorUrl preference. This preference will display the specified page when encountering an error in the app instead of the application error dialogue. Then we have the ShowTitle preference, which will show the title at the top of the screen. And the LogLevelPreference which defines the filter that you wanna use for your log messages. The options are error, warn, info, debug, and reboot. Then you have the AndroidLaunchMode preference with sets what happens when the app is launched, when it is already running. The options are standard, single top, single task and single instance. And then finally we have the DefaultVolumeStream preference, which controls the binding of the device's volume buttons. Normally unless playing media, the volume button affects the call or the volume of the ringer. Setting this to media will make the volume buttons control media while your app is active. Now that's all of the Android specific preferences. I know it's a lot to wrap your head around. At least now you know the different preferences you can use to affect your Android app. In the next video, we will talk about iOS specific preferences.

Back to the top