User profile
If you know the user's gender and/or birthday, you can share them with us so that we can suggest better matching apps to the user.
Java
Kotlin
1
// set the gender
2
AdjoeGender gender;
3
switch(getUserGender()) {
4
case "male":
5
gender = AdjoeGender.MALE;
6
break;
7
8
case "female":
9
gender = AdjoeGender.FEMALE;
10
break;
11
12
default:
13
gender = AdjoeGender.UNKNOWN;
14
break;
15
}
16
17
// set the birthday
18
Date birthday = getUserBirthday();
19
20
// if you don't know the exact birthday, the year is already enough
21
Calendar calendar = Calendar.getInstance();
22
calendar.set(Calendar.YEAR, getYearOfBirth());
23
calendar.set(Calendar.MONTH, 0);
24
calendar.set(Calendar.DAY_OF_MONTH, 0);
25
birthday = calendar.getTime();
26
27
String source = ""; // where did you get the user's profile information from? "facebook", "google", ...
28
29
try {
30
// send the profile information to adjoe
31
Adjoe.setProfile(context, source, gender, birthday);
32
} catch(AdjoeNotInitializedException e) {
33
// make sure to initialize the adjoe SDK first
34
}
Copied!
1
// set the gender
2
val gender: AdjoeGender
3
when (getUserGender()) {
4
"male" -> gender = AdjoeGender.MALE
5
6
"female" -> gender = AdjoeGender.FEMALE
7
8
else -> gender = AdjoeGender.UNKNOWN
9
}
10
11
// set the birthday
12
Date birthday = getUserBirthday();
13
14
// if you don't know the exact birthday, the year is already enough
15
Calendar calendar = Calendar.getInstance()
16
calendar.set(Calendar.YEAR, getYearOfBirth())
17
calendar.set(Calendar.MONTH, 0)
18
calendar.set(Calendar.DAY_OF_MONTH, 0)
19
birthday = calendar.time
20
21
val source = "" // where did you get the user's profile information from? "facebook", "google", ...
22
23
try {
24
// send the profile information to adjoe
25
Adjoe.setProfile(context, source, gender, birthday)
26
} catch(e: AdjoeNotInitializedException) {
27
// make sure to initialize the adjoe SDK first
28
}
Copied!
This method call has no effect if the user has not accepted the adjoe Terms of Service or is blocked by the adjoe services.

Adjoe Parameters

You can pass additional UA and placement parameters when you send the user profile:
Java
Kotlin
1
AdjoeParams adjoeParams = new AdjoeParams.Builder()
2
.setUaNetwork("network")
3
.setUaChannel("channel")
4
.setUaSubPublisherCleartext("SubPublisherCleartext")
5
.setUaSubPublisherEncrypted("SubPublisherEncrypted")
6
.setPlacement("placement")
7
.build();
8
AdjoeUserProfile adjoeUserProfile = new AdjoeUserProfile(gender, birthday);
9
Adjoe.setProfile(context, source, adjoeUserProfile, adjoeParams, listener);
Copied!
1
val adjoeParams = AdjoeParams.Builder()
2
.setUaNetwork("network")
3
.setUaChannel("channel")
4
.setUaSubPublisherCleartext("SubPublisherCleartext")
5
.setUaSubPublisherEncrypted("SubPublisherEncrypted")
6
.setPlacement("placement")
7
.build()
8
val adjoeUserProfile = AdjoeUserProfile(gender, birthday)
9
Adjoe.setProfile(context, source, adjoeUserProfile, adjoeParams, listener)
Copied!
Last modified 7mo ago
Copy link