Android Sample App

Example Application

An example application is included with ZeroKit to demonstrate its usage. It demonstrates the following features:

  • Registration
  • Login and logout
  • Tresor creation
  • Tresor sharing
  • Encryption
  • Decryption

Configuring the Example

The example app requires a backend to function. We created a sample backend that you can use for the mobile and web ZeroKit sample apps. You can find the backend and setup instructions here. In the sample/src/main/AndroidManifest.xml set the values for com.tresorit.zerokitsdk.API_ROOT.

<meta-data
     android:name="com.tresorit.zerokitsdk.API_ROOT"
     android:value="YOUR API ROOT HERE (eg. https://{your tenant's service url})"/>

In the sample/src/main/assets/zerokit.properties set the values for adminkey and adminuserid. If this file does not exist, copy the sample zerokit.demo.properties file in the same directory to create one:

clientid={client id for your openid}
appbackend={url of the sample application backend}
  • apiroot: This is your tenant's service URL. You can find this URL on the management portal.
  • clientid: This is the client ID for your OpenID Connect client that you wish to use with your mobile.
  • appbackend: This is the URL of the sample application backend. You can find the sample backend and setup instructions here.

!!! IMPORTANT NOTE: You must never include your Admin key in your application. All Admin key calls must be done by your backend. We implemented a mock application in this example so you can run it without setting up a server. The admin key must be kept secret and not included in any client applications that you distribute.

Now you are ready to Build and Run the example in Android Studio.

Registering Test Users

Register test users following the &#039;test-user-{XYZ}&#039; username format. These users will be automatically validated by the sample backend so you can log in right after registration.

Used 3rd party libraries in the Example Application
  • Dagger 2: Dependency injector for Android
  • EventBus: A publish/subscribe event bus
  • Retrofit: Type-safe HTTP client for Android and Java

results matching ""

    No results matching ""