Giter Club home page Giter Club logo

android-pdk's Introduction

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

compile '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

compile '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

//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"

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

android-pdk's People

Contributors

sahilmiglani avatar christinalee avatar jparise avatar kyanro avatar greyski avatar greypins avatar ihadeed avatar tonyteate avatar ivamilo avatar learnncode avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.