Udostępnij za pośrednictwem


Android setup

Android applications can use the Rights Management SDK 4.2 to enable integrated information protection in their applications by using Azure Active Directory Rights Management (AAD RM ).

This topic will guide you through setting up your environment for creating your own new apps .

Prerequisites

We recommend the following software on your development system:

  • Windows or OS X operating system to run the Eclipse development environment.

  • This guide assumes that you are using the Eclipse SDK beginning with Eclipse Juno 4.2 and using a default installation.

  • Java starting with Java 1.6.

  • Android Developer Tools (ADT) Plugin.

    Note

    You might be asked to restart Eclipse to complete the installation.

     

  • The RMS SDK 4.2 package for Android. For more information see, Get started.

    This SDK can be used to develop for Android 4.0.3 (API level 15) and later.

  • Authentication library: We recommend that you use the Azure AD Authentication Library (ADAL). However, other authentication libraries that support OAuth 2.0 can be used as well.

    For more information see, ADAL for Android

    Note

    If your application will not be using the ADAL Library as the OAuth 2.0 authentication library, you should review this Android guidance, Some SecureRandom Thoughts.

     

Read the What's new topic for information about API updates, release notes, and frequently asked questions (FAQ).

Optional

Our UI library provides re-usable UI for consumption and protection operations for developers who don’t want to create their own custom UI - UI Library and Sample app for Android.

Configuring your development environment

Note

RMS SDK 4.2 Preview Release: In this preview release, the screen shots have not been updated to show the change in name of the pathes from com/microsoft/protection to com/microsoft/rightsmanagment. The text though, has been updated.

 

  • Open the Eclipse development environment.

  • To create a new Android Application project, on the File menu, click New, click Project, and then select Android Application Project.

  • Enter the application name. The project name and package name is filled based on the application name.

  • Click Next and select where you want to create the workspace.

  • Click Next and select an icon for your app.

  • Click Next and select Blank Activity to create the activity.

  • Click Next and provide a name for the activity. You can leave MainActivity as the default name with a layout name of activity_main.

  • Click Finish.

  • Your project has been created, along with the main activity class MainActivity.java.

Referencing the SDK

  • Navigate to the folder in which you extracted the adrms_android_sdk.zip. In the "SDK > com > microsoft > rightsmanagement" folder, make sure the files .classpath, .project, and project.properties are not marked as read-only.

  • To reference the SDK, you must import it to the workspace.

    In Eclipse, click File. On the File menu, click Import. In the Import dialog box, select Android / Existing Android Code into Workspace.

  • Click Next. Navigate to select the folder in which you extracted the adrms_android_sdk.zip. The SDK should appear in the list as com.microsoft.rightsmanagement.

  • When you click Finish, the SDK project appears as a sibling of your previously created application.

  • Right-click the Project icon and view the properties for the project.

  • Navigate to the Android tab.

  • Click Add, and then select the com.microsoft.rightsmanagement library from the workspace.

  • Click OK.

    Because the RMS SDK 4.2 connects with AAD RM, the application has to be granted the INTERNET and ACCESS_NETWORK_STATE. To do so, open the AndroidManifest.xml file in the root of the project.

    To add the permissions, click Add, and then select Uses Permissions.

  • You can verify the manifest step by viewing the manifest in the text editor view. Make sure the following lines appear:

    <uses-sdk
         android:minSdkVersion="15"
         android:targetSdkVersion="19"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission/>
    

    Note

    The SDK uses the android.support.v4

     

  • You are now ready to create your own new Android apps.

See Also

Get started

What's new

Developer terms and concepts

Android API Reference