An example Android app that highlights Adobe Experience Manager's GraphQL APIs and the AEM Headless Client for Java.
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.
-
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.
-
Download and install Android Studio and open the folder
android-app
-
Modify the file
config.properties
atapp/src/main/assets/config.properties
and updatecontentApi.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.
-
Download an Android Virtual Device (min API 28)
-
Build and deploy the app using the Android emulator.
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.
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+ |