onsdag 4 februari 2015

Android : Implementing DRIVE API in your Android app ( Part 1 of 2 )

Before we can begin to develop the applicatio we need our own private key to register our app in the Google Developers Console so we can access the Drive API.

You can easily create your own keystore from your IDE at least from Android Studio or IntelliJ IDEA or if you like to do it the old fashioned way, go to the JDK SDK/bin directory and run keytool.

keytool -genkeypair -v -keystore D:\EXAMPLE_KEYSTORE\my_keystore -alias MyCompany -keyalg RSA -keysize 2048 -validity 10000

Next we need to register our key at Google Developers Console, we use the keytool again.

keytool -exportcert -alias MyCompany -keystore D:\EXAMPLE_KEYSTORE\my_keystore -list -v

Now we create a new project in the Google Developers Console, select APIs & auth tab and activate the Drive API.

Almost done, now select Credentials and and under OAuth, click 'Create new client ID' as we need authorized access. Fill in your app package name and the SHA1 fingerprint from your keystore.

Prerequisites done, now we can utilize the Drive API! Go to 'Part 2' for a sample application.

Inga kommentarer:

Skicka en kommentar