What follows are my notes for AeroDoc - a challenge demo to get up and running and I have
only completed the journey for Android - need some more focused time for iOS. My steps
may be incomplete as I was making notes while still fighting through the jungle and
getting a few bug fixes from the team along the way - Thank you very much - I will be
using this demo a lot next week. Please edit as you see fit - we should clean this up
and publish a step by step guide on how to AeroDoc.
Note: the UI of the mobile app is a bit clunky - see screenshots of the login screen
below
Getting aerodoc running for Android/GCM with Cordova:
1) Download Unified Push Server -
http://aerogear.org/download/
2) Create & deploy a DataSource (see attached) on EAP
3) Drag & drop .war to deployments folder of EAP 6.1
4) Start EAP
5) Login at
http://localhost:8080/aerogear-unifiedpush-server-0.8.1/
6) admin and "123"
7) You will be prompted to change the password - make it something you won't forget -
I use the same password for EAP admin itself
8) Create a new Push Application
9) Add Variant
10) Google Cloud API:
https://code.google.com/apis/console/b/0/?pli=1
follow notes at
http://aerogear.org/docs/guides/aerogear-push-android/google-setup/
input your API Key and Project Number (which is the SenderID in the JavaScript codebase
later on)
11) Backend web app (also contains the REST endpoints for the AeroDoc app)
git clone
https://github.com/aerogear/aerogear-aerodoc-cordova
mvn clean compile package
deploy the .war to the EAP server
note: I had to git clone and "mvn install" the Java Client
https://github.com/aerogear/aerogear-unifiedpush-java-client
as it was a dependency required to build the backend web app
using the browser, hit
http://192.168.1.102:8080/aerodoc
Note: you need to know your IP address later
and make sure to start your EAP with -b 0.0.0.0 or using the
"Listen on all interfaces to allow remote web connections" checkbox in the
Server properties of JBDS/JBoss Tools
Login in as "john" with a password of "123"
You can create Leads - basically Doctors who need a phone call one of your sales agents
like Maria or Bob.
12) Frontend hybrid mobile app
git clone
https://github.com/aerogear/aerogear-aerodoc-cordova
follow the instructions in the read me
update app.js in merges/android
also open and update LoginController.js in merges/android
pushNotification.register(function() {}, function(){},
{"senderID":"492580885002",
"ecb":"angular.element($('.topcoat-notification')).scope().onNotification"});
where "senderID" is your Google Project ID from step 10
13) Import the Android app into Eclipse+Android Tools using the File-Import-Android
wizard
It will appear as "HelloCordova" inside of the IDE
14) Plug in at least one Android device into your USB - assuming you have setup that
device for development (Google for "how to enable developer settings")
http://www.androidcentral.com/how-enable-developer-settings-android-42
15) Using Eclipse, Run As Android Application and target the device.
If the Emulator tries to start, by passing the device, select Run Configurations, select
the Target tab and check "Always prompt to pick device", hit Apply and OK
16) The app should install and run on the android device
login with "maria" and "123"
17) Back to
http://192.168.1.102:8080/aerodoc
Create a Lead
Dr Sally Mae Thomas
Manhattan
1231231234
and hit Save
click on the Lead, hit the Search Agents button to get a list of sales agents (those folks
running the mobile app like Maria in step 16), check the box and hit Send Lead
Note: you should instantly see the new lead appear in the application, along with a red
notification that says "A new lead has been created" and if the mobile is in the
background it will put up a message in the Android 4 notification bar. Selecting that
notification will pop the application back to the foreground.
If the app is not running (you killed/closed it competely), the notification will still
appear in the top bar, selection of the notification will re-launch the app, where you can
attempt to sign-in as "maria" and "123" but login may fail - just kill
the app, restart the app server, restart it from the application tray/home screen. I am
not sure why logins just fail at times, recycling the app server helps.
18) If you deploy the app to 2 or more devices (leveraging that prompt for device trick in
step 15), you can select the Lead (e.g. Dr Sally Mae Thomas) on the app and then hit the
Accept button which will remove the lead from the overall list and send a push
notification to all other sales agents (e.g. Bob whose password is also "123")
and remove the lead from their list.