Getting Started

Implementing Loopy ™ with your app is a simple 4 step process:

1. Install the Library

Using Android Studio / Gradle ➜

Using Maven ➜

Using Eclipse ➜

2. Update your AndroidManifest.xml

Ensure your app supports SDK version 9 and above:

<manifest ... >

<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="18"/>

Ensure your app has the INTERNET permission. Geo location permissions are optional but recommended for superior analytics

<!-- Required -->
<uses-permission android:name="android.permission.INTERNET"/>

<!-- Recommended -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

To enable Install Tracking add the InstallTracker receiver

<application...>

<receiver android:name="com.sharethis.loopy.sdk.InstallTracker" android:exported="true">
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
</receiver>

</application>

</manifest>

Note

If your application already defines a broadcast receiver you can simply call Loopy to track the install

Show me how...

3. Implement the Loopy lifecycle in your activity

import android.app.Activity;
import android.os.Bundle;
import com.sharethis.loopy.sdk.Loopy;

public class MyActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Call onCreate and pass in your API key and secret
        Loopy.onCreate(this, "<YOUR-API-KEY>", "<YOUR-API-SECRET>");    // <== TODO: Set this
    }

    @Override
    protected void onStart() {
        super.onStart();
        Loopy.onStart(this);
    }

    @Override
    protected void onStop() {
        Loopy.onStop(this);
        super.onStop();
    }

    @Override
    protected void onDestroy() {
        Loopy.onDestroy(this);
        super.onDestroy();
    }
}

4. Implement a Share Dialog or Share Menu

Loopy integrates with the two most common ways to offer sharing to your app users


images/share_dialog_small.png
Share Dialog

Quick and simple. Great for novices or first-time app developers.

Show me how...

images/share_menu_small.png
Share Menu

Follow the official Android Style Guidelines and implement an Action Bar with a Share Menu

Show me how...