AppFriends Android SDK


Maven / jCenter / Bintray

To integerate AppFriends Android SDK to your Android Studio project, add the following to your application's build.gradle file:

repositories {
    maven {
        url ''

and add the appfriends SDK as part of your app's dependencies:

dependencies {
    compile ''

Initialization and customization

After logging into your admin panel, and created your application, you can find your App ID and App Secret. Add them to your AndroidManifest.xml file under <application>.

        android:value="[APPFRIENDS_ID]" />

        android:value="[APPFRIENDS_SECRET]" />

In your Application class, you have the option to customize the AppFriends SDK with AppFriendsConfiguration.Builder. You must call AppFriendsUIKit.init(this, configuration); to properly initialize the SDK:

public class MyApplication extends Application {
    public void onCreate() {

        AppFriendsConfiguration configuration = new AppFriendsConfiguration.Builder()
                .appName("Name of app") // Name of your app that shows up on the privacy agreement screen
                .appIcon(R.drawabl.app_icon) // Icon resource of your app that shows up on the privacy agreement screen
                .gravity(Gravity.RIGHT) // Which way the widget should open from

        AppFriendsUIKit.init(this, configuration);

Add floating widget icon to layout

To add the default widget icon to your Activity or Fragment, add the following to your layout xml:

    app:bragIcon="[BRAG ICON DRAWABLE]"

You may specify the "brag" icon (which allows users to share a screenshot) and the deeplink path of the current fragment/activity.

User Authentication

Before your users can start enjoying AppFriends, they need to have an AppFriends account. Login the user by invoking:

AppFriends.login(userID, username, avatarURL, userEmail);

where the parameters as as follows:

Parameter Type Description
userID String the user's userID in your own app.
username String the username
avatarURL String the full URL of the user's avatar
userEmail String user's email address

The AppFriends Android SDK should now be integrated and ready to go!