GithubHelp home page GithubHelp logo

7digital / 7digital-android-sdk Goto Github PK

View Code? Open in Web Editor NEW
6.0 42.0 9.0 904 KB

The 7digital Android SDK. Use this to add music charts and metadata, preview streams, purchasing and more to your Android app. http://developer.7digital.com/7digital-android-sdk

Java 100.00%

7digital-android-sdk's Introduction

7digital SDK for Android

The 7digital Android SDK enables you to you add functionality such as preview streams, music charts and metadata, search and purchasing to your app.

Full SDK documentation is available at http://7digital.github.io/7digital-Android-SDK/apidocs/

Getting Started

  1. Register as a developer to get a key and secret at http://developer.7digital.com

  2. Clone the repository, which includes a sample app

  3. To run the sample app, change the appKey and appSecret in the Constants.java file to your own key and secret.

  4. To use the SDK in your app, include the cloned repository as a module in Android Studio. Make sure to compile the 'sdk' module as a dependency.

     dependencies {
     	compile project(':sdk')
     }
    
  5. Alternatively, a compiled .aar or .jar is available in the Releases tab.

Running the sample

To run the sample, or any of the sdk tests, you must add your test credentials to the projects gradle.properties file.

A sample gradle.properties file (gradle.properties.sample) is included.

Copy these varibles to your gradle.properties file and fill in your 7digital credentials.

Adding Purchasing to Your App

To add purchasing simply integrate the 7digital Buy Button. This takes care of the checkout and music download process without sending users away to another site. For an example app, see the sample 7digital buy button app.

7digital-android-sdk's People

Contributors

aemeryjsa avatar josh-burton avatar juliusspencer avatar lingkhor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

7digital-android-sdk's Issues

DexIndexOverflowException Android Studio

I have tried both the jars i.e 7digital-android-sdk-v0.93 and 7digital-android-sdk-v0.93-withDependencies.jar. In the first case it gives me exception dependencies not found so when i manually add all the dependencies

compile('org.simpleframework:simple-xml:2.7.1') {
exclude module: 'stax'
exclude module: 'stax-api'
exclude module: 'xpp3'
}
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.fasterxml.jackson.core:jackson-core:2.5.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.0'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.5.0'
compile 'joda-time:joda-time:2.7'
compile 'com.mcxiaoke.volley:library:1.0.10'

It gives me the exception

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:283)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
Information:BUILD FAILED

So i tried the other way round i.e added the jar with dependencies. The it showed error

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;

These classes don't exist. So i added compile 'com.mcxiaoke.volley:library:1.0.10' and ended with the same above dex Overflow Exception. Any help on how to solve this issues.

I have already tried adding one by one, then either it gives JavaClassNotFound Exception or Dex OverFlow Error.

Android sample app and tests don't compile

Both the sample application and the SDK tests don't compile because the calling signature of getTrackPreview() doesn't match its definition in the SDK.

/Users/mark.rosenberg/AndroidStudioProjects/7digital-Android-SDK/sdk/src/androidTest/java/uk.co.sevendigital.android.sdk.test/api.request/preview/TSDIGetTrackPreviewRequest.java
Error:(63, 42) error: incompatible types: ServerAccessToken cannot be converted to String
Error:(77, 25) error: no suitable method found for getTrackPreview(String)
method SDIApi.Streaming.getTrackPreview(String,String) is not applicable
(actual and formal argument lists differ in length)
method SDIApi.Streaming.getTrackPreview(ServerAccessToken,String,String) is not applicable
(actual and formal argument lists differ in length)

Constants.java is empty, and providing appKey and appSecret members as suggested by the documentation, is apparently no longer needed as well.

VolleyUtil ?

Trying to use your SDK with a newer version of Volley and cant seems to find the VolleyUtil class. Is that something you guys made - if so, can you post the code? Or is it something that was only in an older versions of Volley - if so what Volley commit did you use to compile the aar file?

Thanks in advance!

OAuth not working

Two test are failing for me, testLoginUser and testGetTrackPreview, the reason being OAuth is returning the following response:

OAuth authentication error: Access to resource denied

I've double checked my email, password, consumer key and secret, but still nothing... Does login work in the SDK or what am I doing wrong???

Authorization error while try to stream the song

I am getting track id in the sample application , now I want to stream this song. My code look like below.

sServerToken = new SDIServerUtil.ServerAccessToken(Constants.OAUTH_CONSUMER_KEY, Constants.OAUTH_CONSUMER_SECRET);
String token= sServerToken.getToken();
SDIGetTrackPreviewRequest.Result result= api.streaming().getTrackPreview(sServerToken, trackId);

But it throws authorization error. Log is like below:

01-09 10:10:32.467 6402-6476/uk.co.sevendigital.android.sdk.sample E/Volley﹕ [420] BasicNetwork.performRequest: Unexpected response code 401 for http://previews.7digital.com/clip/39704503?oauth_consumer_key=7d49xhs4ywuw&oauth_nonce=3251829979354847678&oauth_signature=f0oz1XXzvNmoH8uMVSF%2FMd5vmBk%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1420778501&oauth_token=7d49xhs4ywuw
01-09 10:10:33.069 6402-6476/uk.co.sevendigital.android.sdk.sample E/Volley﹕ [420] BasicNetwork.performRequest: Unexpected response code 401 for http://previews.7digital.com/clip/39704503?oauth_consumer_key=7d49xhs4ywuw&oauth_nonce=3251829979354847678&oauth_signature=f0oz1XXzvNmoH8uMVSF%2FMd5vmBk%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1420778501&oauth_token=7d49xhs4ywuw
01-09 10:10:50.696 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ java.util.concurrent.ExecutionException: com.android.volley.AuthFailureError
01-09 10:10:50.696 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at com.android.volley.toolbox.RequestFuture.doGet(RequestFuture.java:117)
01-09 10:10:50.696 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at com.android.volley.toolbox.RequestFuture.get(RequestFuture.java:88)
01-09 10:10:50.696 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at uk.co.sevendigital.android.sdk.util.VolleyUtil.executeStringRequest(VolleyUtil.java:51)
01-09 10:10:50.696 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at uk.co.sevendigital.android.sdk.api.request.preview.SDIGetTrackPreviewRequest.execute(SDIGetTrackPreviewRequest.java:83)
01-09 10:10:50.696 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at uk.co.sevendigital.android.sdk.api.SDIApi$Streaming.getTrackPreview(SDIApi.java:543)
01-09 10:10:50.696 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at uk.co.sevendigital.android.sdk.sample.fragment.detail.TrackDetailFragment$TrackDetailAsync.doInBackground(TrackDetailFragment.java:146)
01-09 10:10:50.696 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at uk.co.sevendigital.android.sdk.sample.fragment.detail.TrackDetailFragment$TrackDetailAsync.doInBackground(TrackDetailFragment.java:120)
01-09 10:10:50.696 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java:288)
01-09 10:10:50.696 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-09 10:10:50.697 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
01-09 10:10:50.697 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
01-09 10:10:50.697 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
01-09 10:10:50.697 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at java.lang.Thread.run(Thread.java:818)
01-09 10:10:50.697 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ Caused by: com.android.volley.AuthFailureError
01-09 10:10:50.697 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:153)
01-09 10:10:50.697 6402-6582/uk.co.sevendigital.android.sdk.sample W/System.err﹕ at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:110)

SDITrack.Composition.getDuration() json implementation returns strange result

Preview track duration no doubt varies, but the value returned by getDuration() seems to be unconnected with the actual duration of the track. For example track id = 19935517 (Minus the Bear - Steel and Blood) getDuration() reports 229, but the duration is very close to one minute exactly. Is getDuration() returning something other than milliseconds? Or is it simply broken? API docs don't specify units.

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.