Android client sample for SSO and IdP API.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Android Sample for 10Duke SSO and IdP Client

This repository provides a sample Android application, which demonstrates how to use the SSO and REST-API clients.


Clone and build following projects:

Follow the instructions in above projects.

Building the project

Use Android studio or run following from console:

./gradlew assembleDebug

Things to look for

  • How to declare dependencies? See build.gradle in module app
  • How to initialize the APIs? See class
  • How to use Login/Logout? See methods login(), onActivityResult() and handleLoginResult() in class BaseActivity
  • How to use the REST APIs? These are slightly invisible, as the simple crud-framework does most of the work, but see, e.g. methods and

Building all dependencies and this project

Following shell-script can be used to clone the required repositories and build them to assemble the sample project. The script also downloads and installs the Android SDK.

# Base directory, where the github-repositories are cloned to

mkdir -p ${REPO_BASE}

# Android SDK is downloaded to ANDROID_BASE
export ANDROID_HOME=${ANDROID_BASE}/android-sdk-linux

# java-client-core
# ================
git clone
cd java-client-core
mvn clean install

# java-client-idp
# ================
git clone
cd java-client-idp
mvn clean install

# android-client-idp-sso
# ======================
git clone

# These versions are necessary for working build:

# Some following scripts may use SRC, which should point to the project root

# Download, and install the initial Android SDK
mkdir -p ${ANDROID_BASE}

curl -O${SDK_VERSION}-linux.tgz
sha1sum android-sdk_r${SDK_VERSION}-linux.tgz

tar -xzf android-sdk_r${SDK_VERSION}-linux.tgz

# Update and download the missing Android SDK pieces:
cd ${ANDROID_HOME}/tools

# List available packages (no need to execute)
#./android list sdk  --extended --all

# Install needed dependencies
# NOTE: These ask to accept license
./android update sdk --filter android-16,android-24,build-tools-24.0.1,extra-android-m2repository,platform-tools,sys-img-armeabi-v7a-android-16 --all --no-ui

# Support annotations
cd ${ANDROID_HOME}/extras/android/m2repository/com/android/support/support-annotations/${SUPPORT_VERSION}
mvn install:install-file \
  -DpomFile=support-annotations-${SUPPORT_VERSION}.pom \

# The SDK itself
cd ${ANDROID_HOME}/platforms/android-${API_LEVEL}
mvn install:install-file \
  -Dfile=android.jar \ \
  -DartifactId=sdk \
  -Dversion=${API_LEVEL} \

# Build the maven-artifacts
cd ${SRC}
mvn clean install

# Build the SSO .aar and install it to the local Maven repository
./gradlew assembleDebug install

# Build the test
cd ../
./gradlew assembleDebug

# android-client-sample
# =====================
git clone
cd android-client-sample/
./gradlew assembleDebug