/ProductLayer-SDK-for-Android

ProductLayer SDK for Android

Primary LanguageJavaBSD 2-Clause "Simplified" LicenseBSD-2-Clause

ProductLayer SDK for Android

productlayer logo

The ultimate product information API, enabling a new breed of product-centric apps. This project contains the Android SDK. We also provide SDKs for iOS and Java.

See ProductLayer in action in our prod.ly app.

We have SHUT DOWN

https://www.cocoanetics.com/2018/04/productlayer-post-mortem/

Usage

Gradle

compile 'com.productlayer.ply-android-sdk:0.5.1'
compile 'com.productlayer.ply-android-common:0.5.1'

Maven

<dependency>
    <groupId>com.productlayer</groupId>
    <artifactId>ply-android-sdk</artifactId>
    <version>0.5.1</version>
</dependency>
<dependency>
    <groupId>com.productlayer</groupId>
    <artifactId>ply-android-common</artifactId>
    <version>0.5.1</version>
</dependency>

Get your API key from developer.productlayer.com

PLYRestClientConfig config = new PLYRestClientConfig();
config.apiKey = "YOUR_API_KEY";

Create the PLYAndroid client

PLYAndroid client = new PLYAndroid(config);

Make an API call

ProductService.searchProductsByBrand(client, "Apple", null, null,
    new PLYCompletion<Product[]>() {
        @Override
        public void onSuccess(Product[] result) {
            // display results
        }

        @Override
        public void onError(QueryError error) {
        }
    }
);

This will run asynchronously, querying our API for all products by brand Apple.

To view the full functionality of our API please visit developer.productlayer.com.

Demo

The demo app showcases some of the components found in the common library:

  • ScannerActivity, a barcode scanner and lookup of a product on ProductLayer
  • GlobalTimelineFragment, a feed of the latest products and opinions
  • ProductFragment, everthing about a specific product: facts, opinions, images

The common library includes even more components to facilitate usage of the SDK: adapters, dialogs, views as well as full-blown UI fragments.