Last active
June 26, 2017 06:06
-
-
Save tzmartin/61ca361070409fdb8153 to your computer and use it in GitHub Desktop.
The Android equivalent to Settings.bundle is called Preferences. The preferences configuration files must be created in the project folders, platform/android/res/xml/preferences.xml and platform/android/res/values/array/array.xml.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string-array name="listNames"> | |
<item>5 Minutes</item> | |
<item>10 Minutes</item> | |
<item>15 Minutes</item> | |
<item>30 Minutes</item> | |
<item>60 Minutes</item> | |
</string-array> | |
<string-array name="listValues"> | |
<item>5</item> | |
<item>10</item> | |
<item>15</item> | |
<item>30</item> | |
<item>60</item> | |
</string-array> | |
</resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" | |
android:title="Preferences"> | |
<PreferenceScreen | |
android:title="Misc. Preferences" | |
android:summary="Click to see more options"> | |
<EditTextPreference | |
android:title="Edit Text Preference" | |
android:summary="You may enter a string" | |
android:defaultValue="" | |
android:key="editText" /> | |
</PreferenceScreen> | |
<PreferenceCategory android:title="Category One"> | |
<CheckBoxPreference | |
android:title="CheckBox Preference" | |
android:defaultValue="false" | |
android:summary="You may enter a boolean" | |
android:key="checkbox" /> | |
<RingtonePreference | |
android:title="Ringtone Preference" | |
android:summary="You may pick a ringtone" | |
android:defaultValue="" | |
android:key="ringtone" /> | |
</PreferenceCategory> | |
<PreferenceCategory android:title="Category Two"> | |
<ListPreference | |
android:title="List Preference" | |
android:summary="You may chose from multiple choices" | |
android:key="list" | |
android:entries="@array/listNames" | |
android:entryValues="@array/listValues" | |
/> | |
</PreferenceCategory> | |
</PreferenceScreen> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refer to the Android docs for available setting properties: http://developer.android.com/guide/topics/ui/settings.html.
Once defined, you can use invoke the Settings window from your app using the
openPreferences
function: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Android-method-openPreferences