Class AppBrainUserData
java.lang.Object
com.appbrain.AppBrainUserData
Class to hold data about a user. It has a builder-like pattern so you can chain calls like:
AppBrain.getAds().setUserData(AppBrainUserData.create().setGender(gender).setLocation(location));All fields are optional, so you can set any combination of them.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionaddKeyword(String keyword) Add a keyword.addKeywords(Collection<String> keywords) Add a collection of keywords relevant to the context of the user.static AppBrainUserDatacreate()setBirthDate(Date date) Allows you to set the user's age.setGender(AppBrainUserData.Gender gender) Allows you to set the user's gender.setLocation(Location location) Set a recently retrieved location of the user (acquired from the android LocationManager or Google Play Service's LocationClient).
-
Method Details
-
create
- Returns:
- a new AppBrainUserData instance.
-
setBirthDate
Allows you to set the user's age. For young users COPPA compliance will be enabled automatically. -
setGender
Allows you to set the user's gender.AppBrainUserData.Gender.UNKNOWNis the default. -
addKeyword
Add a keyword. This can be anything relevant to the context of the user.
One example could be a word game with multiple categories "animals", "sports", "countries" and the keyword is then the last category the user played. Another example could be an app in which the user can type search queries, and the keyword can be the last search query of the user.
-
addKeywords
Add a collection of keywords relevant to the context of the user. SeeaddKeyword(String). -
setLocation
Set a recently retrieved location of the user (acquired from the android LocationManager or Google Play Service's LocationClient). -
getBirthDate
- Returns:
- the value set by
setBirthDate(Date).
-
getKeywords
- Returns:
- all keywords added by
addKeyword(String)oraddKeywords(Collection).
-
getGender
- Returns:
- the value set by
setGender(Gender).
-
getLocation
- Returns:
- the value set by
setLocation(Location).
-