pinterest/android-pdk

Name: android-pdk

Owner: Pinterest

Description: Pinterest Android SDK

Created: 2015-07-21 20:48:00.0

Updated: 2018-05-10 10:55:57.0

Pushed: 2018-04-14 09:18:54.0

Homepage: https://developers.pinterest.com/docs/sdks/android/

Size: 357

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

PinterestSDK for Android

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.

Installation
Using AAR
  1. Go to Android Studio | New Project | Minimum SDK

  2. Select “API 11: Android 3.0” or higher and create your new project.

  3. After you create a new project, go to File > New > New Module

  4. Select “Import .JAR or >AAR Package”

  5. Enter the path to .AAR file downloaded from this repo.

  6. Under File > Project Structure, add pdk module as a dependency for your Project

  7. Add the following as a dependency in build.gradle file

ile 'com.mcxiaoke.volley:library:1.0.+'
Using Source code
  1. Go to Android Studio | New Project | Minimum SDK

  2. Select “API 11: Android 3.0” or higher and create your new project.

  3. After you create a new project, go to File > New > New Module

  4. Select “Import Existing Project as Module”

  5. Enter the path to source code downloaded from this repo.

  6. Add the following as a dependency in build.gradle file

ile 'com.mcxiaoke.volley:library:1.0.+'
  1. If the pdk module is not added as a dependency automatically, add it manually under File > Project Structure.
Setting up your App
Registering Your App

Visit the Pinterest Developer Site and register your application. This will generate an appId for you which you will need in the next steps.

Configuring PDKClient

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

ports
rt com.pinterest.android.pdk.PDKCallback;
rt com.pinterest.android.pdk.PDKClient;
rt com.pinterest.android.pdk.PDKException;
rt com.pinterest.android.pdk.PDKResponse;


side onCreate
lient.configureInstance(this, YOUR_APP_ID);
lient.getInstance().onConnect(this);

Add the following line outside the application tag in the manifest file.

s-permission android:name="android.permission.INTERNET"/>

And add the following Intent filter to your Login Activity

ent-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]" />
tent-filter>

If your APP ID is 1234, scheme would be “pdk1234”

Example App

The PDK comes with a Example App. Just clone this repo, add your AppId, and run to get started.

Documentation

For the full documentation and more information about the Pinterest Developer Platform, please visit:

PinterestSDK for Android

Pinterest API Docs

Pinterest API signup


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.