Skip to content

Commit

Permalink
Added native json form and sample app
Browse files Browse the repository at this point in the history
Signed-off-by: Ephraim Muhia <[email protected]>
  • Loading branch information
Ephraim Muhia committed Jul 25, 2017
1 parent c5e2ecf commit 49083a4
Show file tree
Hide file tree
Showing 564 changed files with 18,554 additions and 9 deletions.
62 changes: 62 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
language: android
# sudo set to required because of an issue with how TravisCI handles builds in Docker containers https://github.com/travis-ci/travis-ci/issues/3695.
# Setting sudo to required prevents Travis from testing the project in a Docker container.
sudo: required
jdk: oraclejdk8
dist: precise

env:
matrix:
- ANDROID_TARGET=android-22 ANDROID_ABI=armeabi-v7a
global:
# wait up to 10 minutes for adb to connect to emulator
- ADB_INSTALL_TIMEOUT=10
- MALLOC_ARENA_MAX=2

android:
components:
# tools required
- tools
# The BuildTools version used by your project
- build-tools-26.0.1
# The SDK version used to compile your projects
- android-21
- android-22
# Additional components
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-19

# Specify at least one system image,
# if you need to run emulator(s) during your tests
- sys-img-armeabi-v7a-android-22

addons:
apt_packages:
- pandoc

before_script:
# Emulator Management: Create, Start and Wait
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
- emulator -avd test -no-skin -no-audio -no-window &
- adb wait-for-device
- adb shell input keyevent 82 &

script:
- echo "Travis branch is $TRAVIS_BRANCH"
- echo "Travis branch is in pull request $TRAVIS_PULL+REQUEST"
- chmod 755 gradlew
- ls -la
# Enable the line below once we get all the test passing, currently most of the tests are failing
# so we'll just if the project compiles
#Run All tests Unit and Instrumentation
- travis_wait ./gradlew build -i --stacktrace

after_failure:
- pandoc android-json-form-wizard/build/reports/tests/index.html -t plain


notifications:
slack:
secure: fAiZ4yA7DM6nUKh7nqsCTqZBb03VEAvi5NcRu5mNh5coNn/50XNeZl+qpv7Dw70Ef85Y/k68uc6KwTGVqPXEmVq9Hk3e7lqpBNN8rufvgCYDDGPmywBmU5BhSeykKo0Ee7llM3mRR/EipjIWw1+YvMcS3hCoygf/UlMDDhG0Jo0=
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
[![Build Status](https://travis-ci.org/OpenSRP/opensrp-client.svg?branch=path)](https://travis-ci.org/OpenSRP/opensrp-client) [![Coverage Status](https://coveralls.io/repos/github/OpenSRP/opensrp-client/badge.svg?branch=path)](https://coveralls.io/github/OpenSRP/opensrp-client?branch=path)
[![Build Status](https://travis-ci.org/OpenSRP/opensrp-client-path.svg?branch=master)](https://travis-ci.org/OpenSRP/opensrp-client-path) [![Coverage Status](https://coveralls.io/repos/github/OpenSRP/opensrp-client-path/badge.svg?branch=master)](https://coveralls.io/github/OpenSRP/opensrp-client-path?branch=master)

[![Dristhi](opensrp-app/res/drawable-mdpi/login_logo.png)](https://smartregister.atlassian.net/wiki/dashboard.action)
[![Dristhi](https://raw.githubusercontent.com/OpenSRP/opensrp-client/master/opensrp-app/res/drawable-mdpi/login_logo.png)](https://smartregister.atlassian.net/wiki/dashboard.action)

To run this project, you need to do this:
========================================
=========================================

1. Set the ANDROID\_HOME environment variable to point to the location of your installed Android SDK 4.1.2 API level 16. For more information, look at [the documentation of maven-android-plugin](http://code.google.com/p/maven-android-plugin/wiki/GettingStarted).
1. Set the `ANDROID_HOME` environment variable to point to the location of your installed Android SDK 4.1.2 API level 16. For more information, look at [the documentation of maven-android-plugin](http://code.google.com/p/maven-android-plugin/wiki/GettingStarted).

2. Start an Android Virtual Device. Normally, this means you need to run "android avd" and then start one of the devices there.
2. Start an Android Virtual Device. Normally, this means you need to run `android avd` and then start one of the devices there.

Then, you can run "mvn clean install" in the main directory.
Then, you can run `mvn clean install` in the main directory.

Tips and tricks (to be completed):
=================================

* How to setup your Android SDK so that Maven finds it: http://pivotal.github.com/robolectric/maven-quick-start.html

* Adding an external Android library (apklib) as a submodule, and making it work with both Maven and IntelliJ. Write about "mvn clean" trick.
* Adding an external Android library (apklib) as a submodule, and making it work with both Maven and IntelliJ. TODO: Write about `mvn clean` trick.

Login (for demo server):
=================================
login-username - demotest,
```
login-username - demotest
login-password - Demot123
```

Check app.properties file in "drishti-app/asset/" folder to change the demo server url to your own instance of opensrp server.
Check `app.properties` file in `drishti-app/asset/` folder to change the demo server url to your own instance of opensrp server.
1 change: 1 addition & 0 deletions android-json-form-wizard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
53 changes: 53 additions & 0 deletions android-json-form-wizard/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:1.2.3"
classpath 'org.apache.commons:commons-lang3:3.3.2'
classpath 'org.robolectric:robolectric-gradle-plugin:1.1.0'
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "26.0.1"

defaultConfig {
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}
}

repositories {
maven { url "https://clojars.org/repo/" }
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile group: 'com.github.bmelnychuk', name: 'atv', version: '1.2.9'
compile 'com.github.johnkil.print:print:1.3.1'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.github.rey5137:material:1.1.0'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile('com.github.riadhnet:MaterialSpinner:1.2@aar') {
exclude group: 'com.nineoldandroids', module: 'library'
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-annotations'
}
}
17 changes: 17 additions & 0 deletions android-json-form-wizard/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/vijay/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.vijay.jsonwizard;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
7 changes: 7 additions & 0 deletions android-json-form-wizard/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vijay.jsonwizard" >

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
</manifest>
Binary file not shown.
Loading

0 comments on commit 49083a4

Please sign in to comment.