The PinterestSDK for Android will allow you to authenticate an account with Pinterest and make requests on behalf of the authenticated user. For details on the supported endpoint, visit the Pinterest API.
-
Go to Android Studio | New Project | Minimum SDK
-
Select "API 11: Android 3.0" or higher and create your new project.
-
After you create a new project, go to File > New > New Module
-
Select "Import .JAR or >AAR Package"
-
Enter the path to .AAR file downloaded from this repo.
-
Under File > Project Structure, add pdk module as a dependency for your Project
-
Add the following as a dependency in build.gradle file
compile 'com.mcxiaoke.volley:library:1.0.+'
-
Go to Android Studio | New Project | Minimum SDK
-
Select "API 11: Android 3.0" or higher and create your new project.
-
After you create a new project, go to File > New > New Module
-
Select "Import Existing Project as Module"
-
Enter the path to source code downloaded from this repo.
-
Add the following as a dependency in build.gradle file
compile 'com.mcxiaoke.volley:library:1.0.+'
- If the pdk module is not added as a dependency automatically, add it manually under File > Project Structure.
Visit the Pinterest Developer Site and register your application. This will generate an appId for you which you will need in the next steps.
Before you make any calls using the PDKClient in your app, you will need to configure it with your appId:
Add the following lines in "onCreate" method of your Launch Activity
//imports
import com.pinterest.android.pdk.PDKCallback;
import com.pinterest.android.pdk.PDKClient;
import com.pinterest.android.pdk.PDKException;
import com.pinterest.android.pdk.PDKResponse;
//inside onCreate
PDKClient.configureInstance(this, YOUR_APP_ID);
PDKClient.getInstance().onConnect(this);
Add the following line outside the application tag in the manifest file.
<uses-permission android:name="android.permission.INTERNET"/>
And add the following Intent filter to your Login Activity
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="pdk[YOUR_APP_ID]" />
</intent-filter>
If your APP ID is 1234, scheme would be "pdk1234"
The PDK comes with a Example App. Just clone this repo, add your AppId, and run to get started.
For the full documentation and more information about the Pinterest Developer Platform, please visit: