Android OS Forum banner
1 - 5 of 5 Posts

·
Premium Member
Joined
·
1,768 Posts
Discussion Starter · #1 ·
// DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
// Version 2, December 2004
//
// Copyright (C) 2004 Sam Hocevar <[email protected]>
//
// Everyone is permitted to copy and distribute verbatim or modified
// copies of this license document, and changing it is allowed as long
// as the name is changed.
//
// DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
// TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
//
// 0. You just DO WHAT THE **** YOU WANT TO.

^I love the WTFPL license^

Preference Examples by n00bware

I got tired trying to figure out the docs from
http://developer.android.com/reference/android/preference/package-summary.html
and reading examples of how to display the preferences but no examples of how to use the
values sent

SO I wrote an extremely simple app that shows some of the possible
uses of the standard android frameworks implementation of preferences
AND where and how to //do work

I choose the WTFPL license for good reason I really wanted to people to use these
examples to make their life easier

I kept the string names and method names simple and descriptive (they can be anything)

--> Make note of the branches I placed each preference in it's own branch
the branches are done in order (default branch is main and
was the full example)

Examples in order:
EditTextPreference ~/\~ https://github.com/n00bware/android_apps_PrefExamples/tree/EditTextPreference
ListPreference ~{-}~ https://github.com/n00bware/android_apps_PrefExamples/tree/ListPreference
CheckBoxPreference ~\/~ https://github.com/n00bware/android_apps_PrefExamples/tree/CheckBoxPreference
master === https://github.com/n00bware/android_apps_PrefExamples

OK now I was going to do all the code here but I wanted to give a full example people could just download and compile

I'm happy to entertain questions/comments here and maybe provide some more code if anyone
has questions

This is a super simple example and in the code I left lots of comments to explain what was going on

I also seperated the code into branches so everyone has easy to follow commits as examples they
can use.

Attached as the sample app. The strings are named for their string names so everyone can find them easily (that doesn't sound clear but you will see when you look @ res/values/strings.xml)

JBirdVegas
 

Attachments

·
Premium Member
Joined
·
1,768 Posts

Attachments

·
Premium Member
Joined
·
1,768 Posts
Discussion Starter · #3 ·

Attachments

1 - 5 of 5 Posts
Top