Skip to content

Latest commit

 

History

History

android-app

AEM Guides WKND GraphQL - Android App

An example Android app that highlights Adobe Experience Manager's GraphQL APIs and the AEM Headless Client for Java.

Android App

Tutorial

A corresponding tutorial is available where you can learn how to setup and run the application to query data from an AEM environment using GraphQL.

How to use

  1. On the target AEM environment install the latest release of the WKND Reference site using Package Manager for local environments or using Cloud Manager's CI/CD Pipeline for cloud environments.

  2. Download and install Android Studio and open the folder android-app

  3. Modify the file config.properties at app/src/main/assets/config.properties and update contentApi.endpoint to match your target AEM environment:

    contentApi.endpoint=http://10.0.2.2:4502
    contentApi.user=admin
    contentApi.password=admin
    

    See connecting to AEM environments for more details.

  4. Download an Android Virtual Device (min API 28)

  5. Build and deploy the app using the Android emulator.

Connecting to AEM environments

10.0.2.2 is a special alias for localhost when using the emulator. So 10.0.2.2:4502 is equivalent to localhost:4502. If connecting to an AEM publish environment (recommended), no authorization is required and contentAPi.user and contentApi.password can be left blank.

If connecting to an AEM author environment authorization is required. By default the application is set up to use basic authentication with a username and password of admin:admin. The AEMHeadlessClientBuilder provides the ability to use token-based authentication. To use token-based authentication update client builder in AdventureLoader.java and AdventuresLoader.java:

/* Comment out basicAuth
 if (user != null && password != null) {
   builder.basicAuth(user, password);
  }
*/

// use token-authentication where `token` is a String representing the token
builder.tokenAuth(token)

A more detailed setup and tutorial can be found here.

System Requirements

AEM as a Cloud Service AEM 6.5 Sample Content Android Studio Android SDK
Continual 6.5.10+ WKND Site 1.0+ Arctic Fox 28+

Documentation