Você está na página 1de 46

White Label Android Application Installation and

Customization Guide

Background

Background
Application built for civic
agencies to bring voting
information to the public
Code written to make
deployment easy, without
extensive Android
development experience

Background

https://developers.google.com/civic-information/

Background

This is your data that Google is serving!

Background - API

Background - API

Response includes:
Contest and Referendum
Candidate information
Polling locations
State and local election official contact info

Background White Label


App not in the Play Store, but ready
to deploy
Customizable text and images
Feature complete and ready to go

Background Open Source

BSD 3-Clause License


https://github.com/votinginfoproject/
android-white-label-app

Basic Requirements

Recent Windows, Macintosh, or Linux computer


Java SDK
GitHub (use desktop app, or command line)
Android Studio
Device drivers for your Android device
Technical proficiency

Setup before you start


First, get your API keys:
Google Civic Information API Key
Google Maps Android SDK API Key
Google Directions API Key
Google Analytics Tracking ID

Setup before you start


Google makes this really easy:
https://console.developers.google.com

Setup before you start


Google makes this really easy:
https://console.developers.google.com

(There are a lot of APIs when you first get


to this page, but theyre listed alphabetically)

Setup before you start


Google makes this really easy:
https://console.developers.google.com

Create these
two keys

Setup before you start

Setup before you start


Google makes this really easy:
https://www.google.com/analytics/web

Setup Dependencies

Java SDK
http://www.oracle.com/technetwork/java/javase/
downloads/jdk7-downloads-1880260.html

Details at:
https://github.com/votinginfoproject/android-white-label-app

Setup Dependencies

Android Studio required for


Android development:
https://developer.android.com/sdk/installing/studio.html

Details at:
https://github.com/votinginfoproject/android-white-label-app

Setup Dependencies

GitHub
https://windows.github.com/

Details at:
https://github.com/votinginfoproject/android-white-label-app

Setup get the code


Go to
https://github.com/votinginfoproject/android-white-label-app

If you have the desktop app


installed, click Clone in
Desktop

Setup get the code


Open Android Studio and import the project

To pull updates from GitHub, go


to VCS -> Git -> Repository -> Pull
Or use the GitHub app or command line

Setup install dependencies


Go to Tools -> Android -> SDK Manager

Setup install dependencies


Install dependencies listed at
https://github.com/votinginfoproject/android-white-label-app

Setup Settings
Copy
xmltemplates/api_keys.xml.template
to
app/src/main/res/values/api_keys.xml

Setup Settings
Open the api_keys.xml file
it should look like this

Setup Settings
Get your API keys together and update the api_keys.xml
file. You can also do this with a plain text editor.
Update the Android and Browser keys, and the Analytics
Tracking ID

The official only and test election options can be set here, too

Setup Settings
Copy
xmltemplates/app_tracker.xml.template
to
app/src/main/res/xml/app_tracker.xml

Update the Analytics Tracking ID

Setup Settings
Also, update the Brand Name text with what you want
the app to be called. This text will be at the top of the
home page and can be edited on line 36 of
app/src/main/res/values/strings.xml

Setup Settings
The Google Maps API key requires some information
about your specific build of the project. Detailed
instructions are in the repositorys README file.

Setup Settings
There is also a way to do this in Android Studio from
Build -> Generate Signed APK

More info can be found at


http://developer.android.com/tools/publishing/app-signing.html

Setup Settings
Copy the APK fingerprint you generate and paste it in
the API key in the Google Developer Console

Setup Emulator and Devices


The Android Emulator does not support Google Play
Services, which are required for the Google Maps SDK to
function properly. We recommend using an actual
Android device for testing.
Get documentation about using devices:
http://developer.android.com/tools/device.html
And drivers for your device:
http://developer.android.com/tools/extras/oem-usb.html

Setup Build the project


Click the Run button in the Run menu

Run Build the project


And the app should load on your device

Run Additional Configurations


There are a few more things to consider
before packaging the app for submittal to
the Play Store
About, Terms, and Privacy Policy content
Customized images
Additional language support

Run Additional Configurations


About, Terms, and Privacy Policy content
are in app/src/main/res/values/strings.xml

Run Additional Configurations


Edit, save, and rebuild

You can change any of the text in Android


Studio or a plain text editor that supports
UTF-16 character encoding.

Run Additional Configurations


Translations are also in app/src/main/res/
Each translation gets its own values
directory

Spanish translations are not available yet, but are in progress

Run Additional Configurations


Customize the apps images by updating files in
the app/src/main/res/drawable-{size} directories
Tips:
Use the same name
Keep the same pixel dimensions
There are different sets of images to support
different screen sizes
More detail at:
http://developer.android.com/design/style/iconography.html

Run Additional Configurations


Customize the AppIcons (app_icon.png),
an Background (bg_home.png) images for
a complete visual rebranding.
You dont need to
change these,
though.

Publish
Thats everything for setup and configuration!
The next step is to package the app and submit it to the
Play Store. Google has lots of documentation on this
process.
http://developer.android.com/distribute/googleplay/

Publish
The publishing process requires completing several steps.
http://developer.android.com/distribute/tools/launch-checklist.html

Publish
Set up a developer account to get started

Publish
The process takes some time to work through, but isnt
particularly difficult.
Many of the issues you may encounter are not new, and
resolutions can likely be found with a quick Google
search.
If additional technical support is needed, contact:
Jen Tolentino at jtolentino@pewtrusts.org

Good luck!

White Label Android Application Installation and


Customization Guide

Você também pode gostar