- Grok Server 1.6.1 or above
- Android 4.1+ / API 16+ ("JellyBean" or above)
- "Normal" screen size or higher
- "High Density (hdpi)" or better
See Android versions dashboard for more information:
The application was designed and tested on "Nexus 4".
-
Install Java JDK version 1.7 or higher from http://www.oracle.com/technetwork/java/javase/downloads/index.html
-
Install Android SDK from https://developer.android.com/sdk/index.html
-
Make sure to install the latest android SDK using the following command:
android update sdk
-
The project is based on
gradle
and the new Android Studio IDE. It will NOT work with the legacyeclipse
IDE. You can downloaded Android Studio IDE from https://developer.android.com/sdk/installing/studio.html
-
Add
gradle.properties
file to your android folder with the following values:# Google Analytics Tracking ID systemProp.GA_TRACKING_ID = "UA-XXXXXXXX-X" # Email address to send user feedback systemProp.FEEDBACK_EMAIL = "[email protected]"
-
Add
local.properties
file to your android folder with the following values:sdk.dir=/your_path_to/adt-bundle-mac-x86_64-XXXXXXX/sdk
-
This project includes the gradle wrapper so there is no need to install
gradle
separately. -
To build execute
gradlew build
-
To test, launch the emulator first or plug your device in via USB, then execute:
gradlew -DSERVER_URL=??? -DSERVER_PASS=??? connectedCheck
-
The test reports will be generated in build/outputs/reports folder:
android/build/grok-mobile/outputs/reports/androidTests/connected/index.html
Example Test Execution from Gradle:
gradlew -DSERVER_URL=https://grok.domain.tld -DSERVER_PASS=XXXXX connectedCheck
NOTE replace grok.domain.tld
with the server IP or DNS entry of your Grok instance and replace XXXXX
with the API Key for that instance
-
You will have to install Maven from https://maven.apache.org/
-
You will have to set few environment variables:
# M2_HOME={path-to-apache-maven}/apache-maven-x.x.x # PATH=${PATH}:$M2_HOME/bin # M2=$M2_HOME/bin
-
As functional tests run on saucelabs you will need username and key of saucelabs. Following environment variables should be set:
# SAUCE_USER_NAME=sauce-username # SAUCE_KEY=sauce-key
-
The test reports will be generated in tests/behavioral/GrokMobileApp/target/surefire-reports folder: grok-mobile/tests/behavioral/GrokMobileApp/target/surefire-reports/testng-results.xml
Example Test Execution from Maven:
mvn install -D url="https://grok.domain.tld" -D pwd="XXXXX" -D deviceName="Android Emulator" -D version="4.4" -D sauceUserName=$SAUCE_USER_NAME -D sauceAccessKey=$SAUCE_KEY
NOTE replace grok.domain.tld
with the server IP or DNS entry of your Grok instance and replace XXXXX
with the API Key for that instance.
deviceName
you can select platform from here https://saucelabs.com/platforms/, this code is Grok APK is tested on "Android Emulator" and "Google Nexus 7C Emulator".
version
this is android version for the respective emulator
sauceUserName
and sauceUserName
as mentioned above.
In order to run the pipeline, ensure that following things are properly setup locally.
- You will require a running instance of Grok for testing the mobile app.
- Below are three ways to achieve:
- Pass the region and 1.6.1 AMI-ID from the marketplace release to
run_pipeline
script. Script will take care of launching a Grok instance. - Set up a bucket on S3. Create
stable_ami/ami.txt
file in the created bucket. URL will behttps://s3.amazonaws.com/<your-bucket-name>/stable_ami/ami.txt
. Contents of ami.txt should beAMI_ID: ami-xxxxxxxx
, whereami-xxxxxxxx
should be the AMI-ID. In this case you just need to pass region torun_pipeline
and AMI-ID will be fetched byhttps://s3.amazonaws.com/<your-bucket-name>/stable_ami/ami.txt
. Script will take care of launching a Grok instance. NOTE: The code will read<your-bucket-name>
from theS3_MAPPING_BUCKET
environment variable - Pass --server-url https://grok.domain.tld --apikey to a valid, running instance of Grok.
- Pass the region and 1.6.1 AMI-ID from the marketplace release to
- Ensure the Products repo is on your
PYTHONPATH
- Run
pip install -r pipeline/requirements.txt
- Your "Application Signing" keystore file must be located at
/etc/numenta/products/keys/grok.keystore
. See mobile-core/android/common.gradle for ways to override the default location. ANDROID_HOME
environment variable should be set to the location of your Android SDK (alternatively, set this inlocal.properties
)GROK_MOBILE_HOME
environment variable should be set to the location ofgrok-mobile
sources. E.g.:~/github/numenta/products/grok-mobile
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
environment variables must be setBUILD_PASSWORD
environment variable must be set properly.- Run an Android device locally. You can get a list of devices using
android list avd
and launch one usingemulator -avd <avd_name>