This android app syncs contact details for Valtech employees to your phone. It is connected to Valtech's identity provider (Valtech IDP), https://id.valtech.com/.
This app also serves to demonstrate how easy it is to integrate with Valtech IDP and its OAuth 2 interface. It also serves as a public, free and open source (MIT) example of how to write a Contact Provider for Android.
Follow these simple steps to setup sync:
- Download and install the app from Google Play.
- Open Android Settings -> Accounts.
- Click Add account and choose Valtech.
- Sign in to IDP using your email and password.
- Done! Contacts for your Valtech country will now be synced to your phone on a daily basis.
If you like to sync contacts from more countries than your own country, follow these steps:
- Go to Android Settings -> Accounts -> Valtech.
- Touch Countries to sync.
- Select which countries to sync contacts from (your own country will be preselected).
If you unselect a previously selected country, contacts synced from that country will be removed. If you uninstall the app all contacts synced will be removed.
You can revoke access for the app at any time at https://id.valtech.com/.
- Download the Android SDK.
- Install IntelliJ IDEA.
- Create the file
<repo-root>/local.properties
with the contentssdk.dir=/path/to/android/sdk
. - Import the project in IntelliJ.
- Open IntelliJ.
- Import project.
- Select the valtech-contactsync-android folder.
- Import project from external Model: Gradle.
- Select "User gradle default wrapper (recommended)".
- Finish.
- Add the Android SDK.
- File -> Project structure -> SDKs.
- Click +, choose Android SDK.
- Select path to the Android SDK.
- Click OK.
- Go to Project in Project Structure.
- Choose Android as the Project SDK.
- Do
cp idp.xml.template app/src/main/res/values/idp.xml
and fill in the client secret.
- Update
versionCode
andversionName
inapp/build.gradle
. - Push to develop and merge to master.
- Go to https://circleci.com/gh/valtech/valtech-contactsync-android/tree/master.
- Click your build, Build artifacts and download the app-release.apk.
- Upload
app-release.apk
to Google Play Developer Console.
- Get the key for signing the APK from IT (initially created using
keytool -genkey -v -keystore valtech.keystore -alias valtech -keyalg RSA -keysize 2048 -validity 10000
). - Put the
valtech.keystore
at repository root. - Make sure you have the correct IDP credentials in
app/src/main/res/values/idp.xml
. - Update
versionCode
andversionName
inapp/build.gradle
. - Run
SIGNING_KEY=<putpassphrasehere> ./gradlew assembleRelease
(add a space beforeSIGNING_KEY
as that will hide the command from history if you have$HISTCONTROL
set). - Upload
app/build/outputs/apk/app-release.apk
to Google Play Developer Console.
This project is heavily inspired by jimlar/valtechdroid.