Your SlideShare is downloading. ×
Android Preferences
Android Preferences
Android Preferences
Android Preferences
Android Preferences
Android Preferences
Android Preferences
Android Preferences
Android Preferences
Android Preferences
Android Preferences
Android Preferences
Android Preferences
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Android Preferences

2,752

Published on

Android Preferences …

Android Preferences
Rajab Davudov

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,752
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Rajab Davudov
  • 2. Preferences are Important• Preferences are an important part of an Android application. It is important to let the users have the choice to modify and personalize their application depending on their needs.
  • 3. Preferences are Important
  • 4. How To• res/xml/preferences.xml• an Activity extends PreferenceActivity
  • 5. Preference Types• The CheckBoxPreference is a simple checkbox, that can return true or false.• The ListPreference, which shows a radioGroup where only 1 item can be selected a time.• The EditTextPreference shows a dialog with an editText view which returns a String.
  • 6. Preference Types
  • 7. Preference Types• The RingtonePreference shows a radioGroup that shows the ringtones.• The Preference is a custom preference.• The PreferenceScreen is a screen with preferences. When you have a PreferenceScreen inside an other PreferenceScreen, it simply opens a new screen with other preferences.
  • 8. Preference Types
  • 9. CheckBoxPreference<CheckBoxPreference android:title="Checkbox Preference" android:defaultValue="false" android:summary="This preference can be true or false" android:key="checkboxPref" />
  • 10. ListPreference<ListPreference android:title="List Preference" android:summary="This preference allows to select an item in a array" android:key="listPref" android:defaultValue="digiGreen" android:entries="@array/listArray" android:entryValues="@array/listValues" />
  • 11. Use PreferencesSharedPreferences sp =PreferenceManager.getDefaultSharedPreferences(this);boolean checked = sp.getBoolean("checkBox", true) ;String s = sp.getString("radioButton", "default") ;
  • 12. Think, Design, Code !!!
  • 13. Rajab Davudov Senior Developer at Azerfon radjab@gmail.comhttps://play.google.com/store/apps/developer?id=RADJABhttp://gplus.to/radjabhttp://www.fb.me/rajab.davudovhttp://www.linkedin.com/in/radjab

×