Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Shoot and Share: Basic Mobile Application showing AeroGear Pipe and Authorization with multiple service providers

Authors: Summers Pittman (secondsun) - Daniel Passos (dpassos)
Level: Advanced
Technologies: Java, Android, Google, Facebook, KeyCloak
Summary: And example of interacting with several modern web services.
Target Product: -
Product Versions: -
Source: https://github.com/aerogear/aerogear-android-cookbook/tree/master/ShootAndShare

What is it?

The Shoot and Share project demonstrates how to authenticate with Google, KeyCloak, and Facebook as well as how to upload pictures to Google Drive, your Facebook Wall, or a KeyCloak protected web service.

This application also has an iOS port and a companion Server to host keycloak.

How do I run it?

1. System Requirements

For the complete instructions about how to setup Google, Facebook or Keycloak credentials, visit our OAuth2 documentation guide

2. Build Application

$ cd /path/to/app
$ ./gradlew clean build

3. Test Application

To deploy, run and debug the application on an Android device attached to your system, on the command line enter the following:

5.1) Install generated apk to device

$ cd /path/to/app
$ ./gradlew installDebug

5.2) Open app on device Application output is displayed in the command line window.

How does it work?

CameraActivity is responsible for taking pictures and saving them locally. After you take a picture an intent will launch PhotoActivity.

PhotoActivity is the sharing UI. In this class the calls are made to connect to the remote services using helper classes and uploads photos using an intent to start a background service.

GooglePlusHelper, FacebookHelper, and KeycloakHelper are utility classes which connect to remote services using aerogear-android-authz and upload photos to these services using aerogear-android-pipe.

UploadService performs the upload in the background so the UI is not blocked.