Giter Site home page Giter Site logo

medic / cht-gateway Goto Github PK

View Code? Open in Web Editor NEW
83.0 25.0 40.0 1013 KB

Android SMS gateway app for CHT Applications

License: GNU Affero General Public License v3.0

Makefile 0.65% JavaScript 2.28% Shell 0.65% Java 96.42%
cht sms sms-gateway health hacktoberfest mhealth android

cht-gateway's Introduction

The Core Framework of the Community Health Toolkit (CHT)

This is the repository of the CHT Core Framework, a technical resource of the Community Health Toolkit (CHT) contributed by Medic.

Medic is a nonprofit organization on a mission to improve health in the hardest-to-reach communities through open-source software. Medic serves as the technical steward of the Community Health Toolkit.

For the latest changes and release announcements see our release notes. Our exact support matrix (including older app versions) can be found in our docs.

Overview

The CHT's Core Framework is a software architecture that makes it faster to build full-featured, scalable digital health apps that equip health workers to provide better care in their communities. To learn more about building an application with the Core Framework, visit our guide for developing community health apps.

The Core Framework addresses complexities like health system roles and reporting hierarchies, and its features are flexible enough to support a range of health programs and local care provider workflows.

Mobile and web applications built with the Core Framework support a team-based approach to healthcare delivery and management. Health workers can use SMS messages or mobile applications to submit health data that can then be viewed and exported using a web application. These web applications are fully responsive with a mobile-first design, and support localization using any written language. They can be installed locally or in the cloud by setting up the individual components or as a Docker container.

For more information about Medic's architecture and how the pieces fit together, see Architecture Overview. For more information about the format of docs in the database, see Database Schema. For more information about the SMS exchange protocol between webapp and gateway, see Message States.

Using the Core Framework

If you are a developer looking to contribute to the Core Framework itself, you should follow the development setup instructions.

If you wish to evaluate the Core Framework, or you are a developer looking to create or modify applications built with the Core Framework, you can instead follow the easy deployment instructions, which will get the latest stable release running locally via Docker.

You will need to also familiarise yourself with cht-conf, a tool to manage and configure your apps built using the Core Framework. A brief guide for modifying the config is available alongside the config. A more detailed guide is available in cht-docs.

Supported Browsers

Currently, the latest versions of Chrome, Chrome for Android and Firefox are functionally supported. We do not support Safari (unreliable implementations of necessary web APIs) and the generic android browser (unreliable implementations in general). Our webapp code, which includes any code written as configuration, is still ES5. Our exact support matrix (including older app versions) can be found in our docs.

Contributing

The Core Framework of the Community Health Toolkit is powered by people like you. We appreciate your contributions, and are dedicated to supporting the developers who improve our tools whenever possible.

To setup a development environment to contribute to the Core Framework follow the development instructions.

First time contributor? Issues labeled help wanted are a great place to start.

Looking for other ways to help? You can also:

  • Improve documentation. Check out our style guide here
  • Review or add a translation
  • Find and mark duplicate issues
  • Try to reproduce issues and help with troubleshooting
  • Or share a new idea or question with us!

The easiest ways to get in touch are by raising issues in the medic Github repo or joining our Community Forum.

For more information check out our contributor guidelines.

Build Status

Builds brought to you courtesy of GitHub Actions.

Build Status

Copyright

Copyright 2013-2022 Medic Mobile, Inc. [email protected]

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

cht-gateway's People

Contributors

abbyad avatar alxndrsn avatar dianabarsan avatar estellecomment avatar garethbowen avatar jkuester avatar kennsippell avatar latin-panda avatar mrsarm avatar newtewt avatar scdf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cht-gateway's Issues

Server is not corrected when it sends a duplicate message

03-03 11:12:14.259 25881 28861 I MedicGateway: Saving WO message: {"id":"xxx-yyy","to":"+123123123","content":"नमस्ते! Bilbo Baggins ले Frodo (12345) लाई आँखा जाँचको लागि पठाउनु भएको छैन। कृपया सोधखोज गर्नु होला। धन्यवाद!"}
03-03 11:12:14.259 25881 28861 I MedicGateway: Failed to save WO message: {"id":"xxx-yyy","to":"+123123123","content":"नमस्ते! Bilbo Baggins ले Frodo (12345) लाई आँखा जाँचको लागि पठाउनु भएको छैन। कृपया सोधखोज गर्नु होला। धन्यवाद!"}```

Feature request - Battery power level monitoring and alert system

If the battery level goes below a certain value (make this a user selectable value as well?), an alert SMS (pre defined, editable content) should go to a user saved number. This feature will be useful for PMs and/or Tech Leads in cases of power outages, battery failures etc.

Sometimes message status set to FAILED without failureReason

Seen in logs of a live project:

Exception caught trying to send SMSes: Give failureReason iff new status == FAILED (newStatus=FAILED, failureReason=null)

Logged by https://github.com/medic/medic-gateway/blob/master/src/main/java/medic/gateway/alert/Db.java#L141

  • Investigate where the error message might be thrown from. This might require updating the error message to include stacktrace.
  • Make sure that failureReason is set for all calls to updateStatus()

delete old logs to free space and prevent phone slowdown

It's been observed that gateway phones used in high SMS traffic projects are being slowed down as the logs pile up. Phones with lower RAM (512 MB) are very much effected with the phones being almost unusable. Even phones with higher RAM (2 GB) are getting slow to touch and user actions.

It'd be great to have an auto deletion feature that clears out the logs older than a certain period of time. Or when logs exceed a certain size of the available disk space.

Store all state changes

And make this visible in the UI, e.g. in dialog when message is clicked on

This should make debugging for individual messages simpler.

Add more useful logging when messages fail to send for GENERIC reason

Example log:

I/MedicGateway: Sending 1 SMSs...
I/MedicGateway: sendSms() :: [+123456789] 'Hej'
I/MedicGateway: IntentProcessor.onReceive() :: medic.gateway.alert.SENDING_REPORT
I/MedicGateway: Received sending report for message abcd1234-abcd-1234-abcd-abcdef123456 part 0.
I/MedicGateway: Sending message to +123456789 failed (cause: generic:-1)

This occurs occasionally in production and doesn't give us any useful info to diagnose cause. Options to improve this logging might include:

  • including full report PDU hex
  • including status of phone reception

message delivered without being sent

Was looking at the message history of a doc and noticed a message was delivered without being sent. Is that normal or expected? Wondering how that might have happened.

See the first item listed under .tasks:

curl https://v2-test-person-centered-anc.app.medicmobile.org/medic/072b93ef15d595ff28ad917a65b41483 | jq '.tasks[0]'

No spinner when refreshing Log list

Probably for message lists too. Especially problematic on slow phones with lots of data - can take multiple seconds to refresh a list.

Likely related to #40

Don't follow redirects for server URL

As per #22, there are some implications of following http -> https redirects. If we dont-follow-redirects, then this should prevent users from misconfiguring with HTTP URLs when they should be using HTTPS.

Device lock often breaks travis build

E.g. https://travis-ci.org/alxndrsn/medic-gateway/builds/127240575

medic.gateway.SettingsDialogActivityTest > enteringGoodUrlShouldForwardToMessagesList[test(AVD) - 5.0.2] FAILED 

    java.lang.RuntimeException: Waited for the root of the view hierarchy to have window focus and not be requesting layout for over 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Otherwise, something is seriously wrong. Selected Root:

    Root{application-window-token=android.view.ViewRootImpl$W@13fee133, window-token=android.view.ViewRootImpl$W@13fee133, has-window-focus=false, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) sim=#100 ty=1 fl=#1810100 pfl=0x8 wanim=0x103037d surfaceInsets=Rect(0, 0 - 0, 0)}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=480, height=800, has-focus=true, has-focusable=true, has-window-focus=false, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}}

Attempt to fix it here doesn't seem to have helped: 6df7bf6

Code here does the initial unlock: https://github.com/alxndrsn/medic-gateway/blob/master/scripts/start_emulator#L6; either this is failing, or the device relocks after some time.

delete old logs automatically

Work out a schedule (e.g. every hour, every day, every phone restart, every time the data gets too big) and delete old data automatically as per #27. This should maybe be configurable via Settings.

Wake up at the expected intervals on Huawei Gplay Mini

I have been testing on a Huawei GPlay Mini with the following spec:

This phone has some interesting power settings:

Protected Apps

In Settings > Privacy & security > Protected apps:

You can mark apps as being "allowed" to wake the system up. It seems prudent to enable medic-gateway here:

# Power saving

Settings > Power saving allows you to choose the Power plan for the phone. Initial testing will be conducted using Normal, as this is least likely to interfere with scheduled tasks used in medic-gateway:

In Settings > Power saving > Power info you can also set some specific settings for individual apps. For medic-gateway, set the following:

Setting value
Power-intensive prompt 👎
System wakeup 👍
Keep running after screen off 👍

Cannot save settings on first-run if _Enable polling_ is unchecked and URL is invalid

D/MedicGateway( 4230): medic.gateway.alert.IllegalSettingsException: component[2131427344]: error[2131296273]
D/MedicGateway( 4230): 	at medic.gateway.alert.Settings.validate(SettingsStore.java:94)
D/MedicGateway( 4230): 	at medic.gateway.alert.SettingsStore.save(SettingsStore.java:40)
D/MedicGateway( 4230): 	at medic.gateway.alert.SettingsDialogActivity.saveSettings(SettingsDialogActivity.java:126)
D/MedicGateway( 4230): 	at medic.gateway.alert.SettingsDialogActivity.access$000(SettingsDialogActivity.java:19)
D/MedicGateway( 4230): 	at medic.gateway.alert.SettingsDialogActivity$2.doInBackground(SettingsDialogActivity.java:111)
D/MedicGateway( 4230): 	at medic.gateway.alert.SettingsDialogActivity$2.doInBackground(SettingsDialogActivity.java:109)
D/MedicGateway( 4230): 	at android.os.AsyncTask$2.call(AsyncTask.java:288)
D/MedicGateway( 4230): 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
D/MedicGateway( 4230): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
D/MedicGateway( 4230): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
D/MedicGateway( 4230): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
D/MedicGateway( 4230): 	at java.lang.Thread.run(Thread.java:848)
E/AndroidRuntime( 4230): FATAL EXCEPTION: AsyncTask #1
E/AndroidRuntime( 4230): Process: medic.gateway.alert, PID: 4230
E/AndroidRuntime( 4230): java.lang.RuntimeException: An error occured while executing doInBackground()
E/AndroidRuntime( 4230): 	at android.os.AsyncTask$3.done(AsyncTask.java:300)
E/AndroidRuntime( 4230): 	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
E/AndroidRuntime( 4230): 	at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
E/AndroidRuntime( 4230): 	at java.util.concurrent.FutureTask.run(FutureTask.java:242)
E/AndroidRuntime( 4230): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
E/AndroidRuntime( 4230): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime( 4230): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime( 4230): 	at java.lang.Thread.run(Thread.java:848)
E/AndroidRuntime( 4230): Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
E/AndroidRuntime( 4230): 	at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6728)
E/AndroidRuntime( 4230): 	at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:1011)
E/AndroidRuntime( 4230): 	at android.view.ViewGroup.invalidateChild(ViewGroup.java:4552)
E/AndroidRuntime( 4230): 	at android.view.View.invalidate(View.java:11095)
E/AndroidRuntime( 4230): 	at android.view.View.invalidate(View.java:11044)
E/AndroidRuntime( 4230): 	at android.widget.Editor.setErrorIcon(Editor.java:339)
E/AndroidRuntime( 4230): 	at android.widget.Editor.setError(Editor.java:324)
E/AndroidRuntime( 4230): 	at android.widget.TextView.setError(TextView.java:4504)
E/AndroidRuntime( 4230): 	at android.widget.TextView.setError(TextView.java:4489)
E/AndroidRuntime( 4230): 	at medic.gateway.alert.SettingsDialogActivity.showError(SettingsDialogActivity.java:186)
E/AndroidRuntime( 4230): 	at medic.gateway.alert.SettingsDialogActivity.showError(SettingsDialogActivity.java:181)
E/AndroidRuntime( 4230): 	at medic.gateway.alert.SettingsDialogActivity.saveSettings(SettingsDialogActivity.java:132)
E/AndroidRuntime( 4230): 	at medic.gateway.alert.SettingsDialogActivity.access$000(SettingsDialogActivity.java:19)
E/AndroidRuntime( 4230): 	at medic.gateway.alert.SettingsDialogActivity$2.doInBackground(SettingsDialogActivity.java:111)
E/AndroidRuntime( 4230): 	at medic.gateway.alert.SettingsDialogActivity$2.doInBackground(SettingsDialogActivity.java:109)
E/AndroidRuntime( 4230): 	at android.os.AsyncTask$2.call(AsyncTask.java:288)
E/AndroidRuntime( 4230): 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/AndroidRuntime( 4230): 	... 4 more```

Make a more generic Check interface & list

Things that may need to be checked:

  • is this device the default SMS app?
  • does this device [still] have the correct permissions? (M / Marshmallow / 6.0+)
  • is the app whitelisted for waking up the phone? (Huawei)

And no doubt there will be further checks in future.

Need to implement headless and non-headless sms send services(?)

Reported on Samsung GT-I8200, setting medic-gateway as the default messaging app and then attempting to send a SMS via the Contacts app crashes.

E/AndroidRuntime(26550): Caused by: java.lang.ClassNotFoundException: Didn't find class "medic.gateway.alert.ComposeSmsActivity" on path: /data/app/medic.gateway.alert-1.apk
5:08 E/AndroidRuntime(26550): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{medic.gateway.alert/medic.gateway.alert.ComposeSmsActivity}: java.lang.ClassNotFoundException: Didn't find class "medic.gateway.alert.ComposeSmsActivity" on path: /data/app/medic.gateway.alert-1.apk

Maintain external list of unsynced WT messages

Problem

All the incoming messages from users are stored in Medic Gateway as it is used as the default SMS app for the phone. There has been a situation where the app had completely stopped working due to the memory issue and all the app data had to be erased from the Adnroid's app setings to free up space. In the process, it also deleted all the messages that were not synced with the webapp. There wasn't anyway to recover those messages and get to sync them back with webapp. In case of unsent messages originating from the webapp, we do not have to worry as they will still have the pending status and will be sent later when the app is restarted.

Possible solution

Saving unsynced messages on a separate file on a different file location will be a good option. In case of such app failures, user can simply import the messages from the files and the app will sync it back with webapp, thus eliminating any chances of lost reports.

Medic Gateway stopped polling automatically

Phone model: Samsung Galaxy J7
Android version: 6.0.1
Project URL: https://rolpa-eyehealth.app.medicmobile.org

SMS aren’t being synced and forwarded. Even the Compose function is not working. Logs suggests that it stopped polling the webapp automatically after a day. Stopping and starting the polling from Settings also didn't work. Also, the Retry function doesn’t do anything on both incoming and outgoing messages.

Delete old messages automatically

Consider whether parameters should be different depending on the status of the message.

Consider if we need to change the status of the message when its final status has been reported to the webapp.

Related: #28

com.android.builder.testing.api.DeviceException: No connected devices!

Can we have a make that just builds the software and a make test that runs the tests?

mandric in ~/dev/medic-gateway 
$ make
rm -rf src/main/assets/
rm -rf build/
./gradlew --daemon --parallel --stacktrace installDebug
Downloading https://services.gradle.org/distributions/gradle-2.13-bin.zip
..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Unzipping /Users/mandric/.gradle/wrapper/dists/gradle-2.13-bin/4xsgxlfjcxvrea7akf941nvc7/gradle-2.13-bin.zip to /Users/mandric/.gradle/wrapper/dists/gradle-2.13-bin/4xsgxlfjcxvrea7akf941nvc7
Set executable permissions for: /Users/mandric/.gradle/wrapper/dists/gradle-2.13-bin/4xsgxlfjcxvrea7akf941nvc7/gradle-2.13/bin/gradle
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Parallel execution is an incubating feature.
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom
Download https://jitpack.io/com/github/alxndrsn/android-check/1f87548c0686d823e5f1490a2053b70bd9f5022e/android-check-1f87548c0686d823e5f1490a2053b70bd9f5022e.pom
Download https://repo1.maven.org/maven2/com/trickyandroid/jacoco-everywhere/0.2.1/jacoco-everywhere-0.2.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle-core/2.1.0/gradle-core-2.1.0.pom
Download https://repo1.maven.org/maven2/com/puppycrawl/tools/checkstyle/6.10.1/checkstyle-6.10.1.pom
Download https://repo1.maven.org/maven2/com/google/code/findbugs/findbugs/3.0.1/findbugs-3.0.1.pom
Download https://repo1.maven.org/maven2/net/sourceforge/pmd/pmd-java/5.3.4/pmd-java-5.3.4.pom
Download https://repo1.maven.org/maven2/net/sourceforge/pmd/pmd/5.3.4/pmd-5.3.4.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder/2.1.0/builder-2.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint/25.1.0/lint-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle-api/2.1.0/gradle-api-2.1.0.pom
Download https://repo1.maven.org/maven2/com/android/databinding/compilerCommon/2.1.0/compilerCommon-2.1.0.pom
Download https://repo1.maven.org/maven2/org/jacoco/org.jacoco.core/0.7.2.201409121644/org.jacoco.core-0.7.2.201409121644.pom
Download https://repo1.maven.org/maven2/org/jacoco/org.jacoco.build/0.7.2.201409121644/org.jacoco.build-0.7.2.201409121644.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/37/commons-parent-37.pom
Download https://repo1.maven.org/maven2/org/apache/apache/16/apache-16.pom
Download https://repo1.maven.org/maven2/antlr/antlr/2.7.7/antlr-2.7.7.pom
Download https://repo1.maven.org/maven2/org/antlr/antlr4-runtime/4.5.1-1/antlr4-runtime-4.5.1-1.pom
Download https://repo1.maven.org/maven2/org/antlr/antlr4-master/4.5.1-1/antlr4-master-4.5.1-1.pom
Download https://repo1.maven.org/maven2/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.pom
Download https://repo1.maven.org/maven2/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.pom
Download https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.pom
Download https://repo1.maven.org/maven2/com/google/code/findbugs/bcel-findbugs/6.0/bcel-findbugs-6.0.pom
Download https://repo1.maven.org/maven2/com/google/code/findbugs/jFormatString/2.0.1/jFormatString-2.0.1.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.2/asm-debug-all-5.0.2.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-parent/5.0.2/asm-parent-5.0.2.pom
Download https://repo1.maven.org/maven2/com/apple/AppleJavaExtensions/1.4/AppleJavaExtensions-1.4.pom
Download https://repo1.maven.org/maven2/jaxen/jaxen/1.1.6/jaxen-1.1.6.pom
Download https://repo1.maven.org/maven2/net/java/dev/javacc/javacc/5.0/javacc-5.0.pom
Download https://repo1.maven.org/maven2/net/sourceforge/pmd/pmd-core/5.3.4/pmd-core-5.3.4.pom
Download https://repo1.maven.org/maven2/net/sourceforge/saxon/saxon/9.1.0.8/saxon-9.1.0.8.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-model/2.1.0/builder-model-2.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-test-api/2.1.0/builder-test-api-2.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/sdklib/25.1.0/sdklib-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/sdk-common/25.1.0/sdk-common-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/common/25.1.0/common-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/manifest-merger/25.1.0/manifest-merger-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/ddms/ddmlib/25.1.0/ddmlib-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/jack/jack-api/0.10.0/jack-api-0.10.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/jill/jill-api/0.10.0/jill-api-0.10.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-checks/25.1.0/lint-checks-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/annotations/25.1.0/annotations-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/databinding/baseLibrary/2.1.0/baseLibrary-2.1.0.pom
Download https://repo1.maven.org/maven2/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.pom
Download https://repo1.maven.org/maven2/com/beust/jcommander/1.35/jcommander-1.35.pom
Download https://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/3/oss-parent-3.pom
Download https://repo1.maven.org/maven2/com/android/tools/layoutlib/layoutlib-api/25.1.0/layoutlib-api-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/dvlib/25.1.0/dvlib-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/repository/25.1.0/repository-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-api/25.1.0/lint-api-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.jar
Download https://jitpack.io/com/github/alxndrsn/android-check/1f87548c0686d823e5f1490a2053b70bd9f5022e/android-check-1f87548c0686d823e5f1490a2053b70bd9f5022e.jar
Download https://repo1.maven.org/maven2/com/trickyandroid/jacoco-everywhere/0.2.1/jacoco-everywhere-0.2.1.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle-core/2.1.0/gradle-core-2.1.0.jar
Download https://repo1.maven.org/maven2/com/puppycrawl/tools/checkstyle/6.10.1/checkstyle-6.10.1.jar
Download https://repo1.maven.org/maven2/com/google/code/findbugs/findbugs/3.0.1/findbugs-3.0.1.jar
Download https://repo1.maven.org/maven2/net/sourceforge/pmd/pmd-java/5.3.4/pmd-java-5.3.4.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder/2.1.0/builder-2.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint/25.1.0/lint-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle-api/2.1.0/gradle-api-2.1.0.jar
Download https://repo1.maven.org/maven2/com/android/databinding/compilerCommon/2.1.0/compilerCommon-2.1.0.jar
Download https://repo1.maven.org/maven2/org/jacoco/org.jacoco.core/0.7.2.201409121644/org.jacoco.core-0.7.2.201409121644.jar
Download https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar
Download https://repo1.maven.org/maven2/antlr/antlr/2.7.7/antlr-2.7.7.jar
Download https://repo1.maven.org/maven2/org/antlr/antlr4-runtime/4.5.1-1/antlr4-runtime-4.5.1-1.jar
Download https://repo1.maven.org/maven2/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar
Download https://repo1.maven.org/maven2/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.jar
Download https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
Download https://repo1.maven.org/maven2/com/google/code/findbugs/bcel-findbugs/6.0/bcel-findbugs-6.0.jar
Download https://repo1.maven.org/maven2/com/google/code/findbugs/jFormatString/2.0.1/jFormatString-2.0.1.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.2/asm-debug-all-5.0.2.jar
Download https://repo1.maven.org/maven2/com/apple/AppleJavaExtensions/1.4/AppleJavaExtensions-1.4.jar
Download https://repo1.maven.org/maven2/jaxen/jaxen/1.1.6/jaxen-1.1.6.jar
Download https://repo1.maven.org/maven2/net/java/dev/javacc/javacc/5.0/javacc-5.0.jar
Download https://repo1.maven.org/maven2/net/sourceforge/pmd/pmd-core/5.3.4/pmd-core-5.3.4.jar
Download https://repo1.maven.org/maven2/net/sourceforge/saxon/saxon/9.1.0.8/saxon-9.1.0.8.jar
Download https://repo1.maven.org/maven2/net/sourceforge/saxon/saxon/9.1.0.8/saxon-9.1.0.8-dom.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-model/2.1.0/builder-model-2.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-test-api/2.1.0/builder-test-api-2.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/sdklib/25.1.0/sdklib-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/sdk-common/25.1.0/sdk-common-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/common/25.1.0/common-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/manifest-merger/25.1.0/manifest-merger-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/ddms/ddmlib/25.1.0/ddmlib-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/jack/jack-api/0.10.0/jack-api-0.10.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/jill/jill-api/0.10.0/jill-api-0.10.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-checks/25.1.0/lint-checks-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/annotations/25.1.0/annotations-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/databinding/baseLibrary/2.1.0/baseLibrary-2.1.0.jar
Download https://repo1.maven.org/maven2/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
Download https://repo1.maven.org/maven2/com/beust/jcommander/1.35/jcommander-1.35.jar
Download https://repo1.maven.org/maven2/com/android/tools/layoutlib/layoutlib-api/25.1.0/layoutlib-api-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/dvlib/25.1.0/dvlib-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/repository/25.1.0/repository-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-api/25.1.0/lint-api-25.1.0.jar
Observed package id 'add-ons;addon-google_apis-google-14' in inconsistent location '/Users/mandric/dev/android-sdk-macosx/add-ons/addon-google_apis-google_inc_-14' (Expected '/Users/mandric/dev/android-sdk-macosx/add-ons/addon-google_apis-google-14')
Observed package id 'system-images;android-10;default;x86' in inconsistent location '/Users/mandric/dev/android-sdk-macosx/system-images/android-10/x86' (Expected '/Users/mandric/dev/android-sdk-macosx/system-images/android-10/default/x86')
Observed package id 'system-images;android-14;default;armeabi-v7a' in inconsistent location '/Users/mandric/dev/android-sdk-macosx/system-images/android-14/armeabi-v7a' (Expected '/Users/mandric/dev/android-sdk-macosx/system-images/android-14/default/armeabi-v7a')
Observed package id 'system-images;android-15;default;armeabi-v7a' in inconsistent location '/Users/mandric/dev/android-sdk-macosx/system-images/android-15/armeabi-v7a' (Expected '/Users/mandric/dev/android-sdk-macosx/system-images/android-15/default/armeabi-v7a')
Observed package id 'system-images;android-16;default;armeabi-v7a' in inconsistent location '/Users/mandric/dev/android-sdk-macosx/system-images/android-16/armeabi-v7a' (Expected '/Users/mandric/dev/android-sdk-macosx/system-images/android-16/default/armeabi-v7a')
Observed package id 'system-images;android-17;default;armeabi-v7a' in inconsistent location '/Users/mandric/dev/android-sdk-macosx/system-images/android-17/armeabi-v7a' (Expected '/Users/mandric/dev/android-sdk-macosx/system-images/android-17/default/armeabi-v7a')
Observed package id 'system-images;android-18;default;armeabi-v7a' in inconsistent location '/Users/mandric/dev/android-sdk-macosx/system-images/android-18/armeabi-v7a' (Expected '/Users/mandric/dev/android-sdk-macosx/system-images/android-18/default/armeabi-v7a')
Observed package id 'system-images;android-18;default;x86' in inconsistent location '/Users/mandric/dev/android-sdk-macosx/system-images/android-18/x86' (Expected '/Users/mandric/dev/android-sdk-macosx/system-images/android-18/default/x86')
Observed package id 'system-images;android-19;default;x86' in inconsistent location '/Users/mandric/dev/android-sdk-macosx/system-images/android-19/x86' (Expected '/Users/mandric/dev/android-sdk-macosx/system-images/android-19/default/x86')
Download https://s3.amazonaws.com/repo.commonsware.com/com/commonsware/cwac/wakeful/1.1.0/wakeful-1.1.0.pom
Download https://repo1.maven.org/maven2/com/google/code/findbugs/annotations/3.0.1/annotations-3.0.1.pom
Download https://s3.amazonaws.com/repo.commonsware.com/com/commonsware/cwac/wakeful/1.1.0/wakeful-1.1.0.aar
Download https://repo1.maven.org/maven2/com/google/code/findbugs/annotations/3.0.1/annotations-3.0.1.jar
Incremental java compilation is an incubating feature.
Download https://repo1.maven.org/maven2/org/robolectric/robolectric/3.1-rc1/robolectric-3.1-rc1.pom
Download https://repo1.maven.org/maven2/org/robolectric/robolectric-parent/3.1-rc1/robolectric-parent-3.1-rc1.pom
Download https://repo1.maven.org/maven2/com/squareup/okhttp3/mockwebserver/3.2.0/mockwebserver-3.2.0.pom
Download https://repo1.maven.org/maven2/com/squareup/okhttp3/parent/3.2.0/parent-3.2.0.pom
Download https://repo1.maven.org/maven2/org/robolectric/robolectric-annotations/3.1-rc1/robolectric-annotations-3.1-rc1.pom
Download https://repo1.maven.org/maven2/org/robolectric/robolectric-resources/3.1-rc1/robolectric-resources-3.1-rc1.pom
Download https://repo1.maven.org/maven2/org/robolectric/robolectric-utils/3.1-rc1/robolectric-utils-3.1-rc1.pom
Download https://repo1.maven.org/maven2/org/robolectric/shadows-core/3.1-rc1/shadows-core-3.1-rc1.pom
Download https://repo1.maven.org/maven2/org/robolectric/robolectric-shadows/3.1-rc1/robolectric-shadows-3.1-rc1.pom
Download https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk16/1.46/bcprov-jdk16-1.46.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm/5.0.1/asm-5.0.1.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/5.0.1/asm-commons-5.0.1.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-util/5.0.1/asm-util-5.0.1.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/5.0.1/asm-analysis-5.0.1.pom
Download https://repo1.maven.org/maven2/com/ximpleware/vtd-xml/2.11/vtd-xml-2.11.pom
Download https://repo1.maven.org/maven2/com/thoughtworks/xstream/xstream/1.4.8/xstream-1.4.8.pom
Download https://repo1.maven.org/maven2/com/thoughtworks/xstream/xstream-parent/1.4.8/xstream-parent-1.4.8.pom
Download https://repo1.maven.org/maven2/org/codehaus/codehaus-parent/3/codehaus-parent-3.pom
Download https://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.pom
Download https://repo1.maven.org/maven2/org/apache/ant/ant/1.8.0/ant-1.8.0.pom
Download https://repo1.maven.org/maven2/org/apache/ant/ant-parent/1.8.0/ant-parent-1.8.0.pom
Download https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.2.0/okhttp-3.2.0.pom
Download https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp-ws/3.2.0/okhttp-ws-3.2.0.pom
Download https://repo1.maven.org/maven2/com/google/android/apps/common/testing/accessibility/framework/accessibility-test-framework/2.1/accessibility-test-framework-2.1.pom
Download https://repo1.maven.org/maven2/com/ibm/icu/icu4j/53.1/icu4j-53.1.pom
Download https://repo1.maven.org/maven2/com/google/guava/guava/19.0-rc2/guava-19.0-rc2.pom
Download https://repo1.maven.org/maven2/com/google/guava/guava-parent/19.0-rc2/guava-parent-19.0-rc2.pom
Download https://repo1.maven.org/maven2/com/almworks/sqlite4java/sqlite4java/0.282/sqlite4java-0.282.pom
Download https://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/4/oss-parent-4.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/5.0.1/asm-tree-5.0.1.pom
Download https://repo1.maven.org/maven2/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.pom
Download https://repo1.maven.org/maven2/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.pom
Download https://repo1.maven.org/maven2/org/apache/ant/ant-launcher/1.8.0/ant-launcher-1.8.0.pom
Download https://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom
Download https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/2.6.1/protobuf-java-2.6.1.pom
Download https://repo1.maven.org/maven2/com/google/google/1/google-1.pom
Download https://repo1.maven.org/maven2/org/robolectric/robolectric-annotations/3.1-rc1/robolectric-annotations-3.1-rc1.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm/5.0.1/asm-5.0.1.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/5.0.1/asm-tree-5.0.1.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/5.0.1/asm-commons-5.0.1.jar
Download https://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar
Download https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/2.6.1/protobuf-java-2.6.1.jar
Download https://repo1.maven.org/maven2/com/google/android/apps/common/testing/accessibility/framework/accessibility-test-framework/2.1/accessibility-test-framework-2.1.jar
Download https://repo1.maven.org/maven2/org/robolectric/robolectric-utils/3.1-rc1/robolectric-utils-3.1-rc1.jar
Download https://repo1.maven.org/maven2/com/ximpleware/vtd-xml/2.11/vtd-xml-2.11.jar
Download https://repo1.maven.org/maven2/org/robolectric/robolectric-resources/3.1-rc1/robolectric-resources-3.1-rc1.jar
Download https://repo1.maven.org/maven2/com/ibm/icu/icu4j/53.1/icu4j-53.1.jar
Download https://repo1.maven.org/maven2/com/google/guava/guava/19.0-rc2/guava-19.0-rc2.jar
Download https://repo1.maven.org/maven2/com/almworks/sqlite4java/sqlite4java/0.282/sqlite4java-0.282.jar
Download https://repo1.maven.org/maven2/org/robolectric/shadows-core/3.1-rc1/shadows-core-3.1-rc1.jar
Download https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk16/1.46/bcprov-jdk16-1.46.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-util/5.0.1/asm-util-5.0.1.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/5.0.1/asm-analysis-5.0.1.jar
Download https://repo1.maven.org/maven2/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar
Download https://repo1.maven.org/maven2/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar
Download https://repo1.maven.org/maven2/com/thoughtworks/xstream/xstream/1.4.8/xstream-1.4.8.jar
Download https://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar
Download https://repo1.maven.org/maven2/org/apache/ant/ant-launcher/1.8.0/ant-launcher-1.8.0.jar
Download https://repo1.maven.org/maven2/org/apache/ant/ant/1.8.0/ant-1.8.0.jar
Download https://repo1.maven.org/maven2/org/robolectric/robolectric/3.1-rc1/robolectric-3.1-rc1.jar
Download https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.2.0/okhttp-3.2.0.jar
Download https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp-ws/3.2.0/okhttp-ws-3.2.0.jar
Download https://repo1.maven.org/maven2/com/squareup/okhttp3/mockwebserver/3.2.0/mockwebserver-3.2.0.jar
Download https://repo1.maven.org/maven2/com/squareup/javawriter/2.1.1/javawriter-2.1.1.pom
Download https://repo1.maven.org/maven2/org/hamcrest/hamcrest-integration/1.3/hamcrest-integration-1.3.pom
Download https://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.pom
Download https://repo1.maven.org/maven2/net/java/jvnet-parent/3/jvnet-parent-3.pom
Download https://repo1.maven.org/maven2/com/squareup/javawriter/2.1.1/javawriter-2.1.1.jar
Download https://repo1.maven.org/maven2/org/hamcrest/hamcrest-integration/1.3/hamcrest-integration-1.3.jar
Download https://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar
Download https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.7.2.201409121644/org.jacoco.agent-0.7.2.201409121644.pom
Download https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.7.2.201409121644/org.jacoco.agent-0.7.2.201409121644.jar
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:prepareComAndroidSupportSupportV42301Library
:prepareComCommonswareCwacWakeful110Library
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/mandric/dev/medic-gateway/src/main/java/medic/gateway/SmsCompatibility.java:51: warning: [deprecation] createFromPdu(byte[]) in SmsMessage has been deprecated
> Building 56% > :compilreturn SmsMessage.createFromPdu(pdu);
                             ^
1 warning
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:prePackageMarkerForDebug
:unzipJacocoAgent
:transformClassesWithJacocoForDebug
:transformClassesWithDexForDebug
To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 910 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
:mergeDebugJniLibFolders
:transformNative_libsWithMergeJniLibsForDebug
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug
:validateDebugSigning
:packageDebug
:zipalignDebug
:assembleDebug
:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':installDebug'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:68)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.internal.UncheckedException: com.android.builder.testing.api.DeviceException: No connected devices!
    at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:45)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:78)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 14 more
Caused by: com.android.builder.testing.api.DeviceException: No connected devices!
    at com.android.builder.testing.ConnectedDeviceProvider.init(ConnectedDeviceProvider.java:116)
    at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:99)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    ... 21 more


BUILD FAILED

Total time: 6 mins 42.999 secs
make: *** [deploy] Error 1

Can API level 16 be supported?

minSdkVersion is currently 17. It would be convenient for some projects to support version 16. Investigate if this would be possible.

Set versionCode in build.gradle

Recommend:

  1. assert that there are only 3 parts when VERSION_TO_BUILD is split on full stops
  2. convert x.y.z -> 1000000*5 + 1000*3 + z*2

This is required by #26

Forward webapp-terminating messages immediately

Consider forwarding webapp-terminating messages immediately that they are received to medic-gateway. Consider that any autoreplies triggered will likely still not be available until the next poll is made (depending on how/where/when api/webapp/sentinel generates these replies).

implement MedicMobile-specific settings screen

app url:  [__________]
username: [__________]
password: [__________]

url = "https://${username}:${password}@${appUrl}/api/sms";

Should make life simpler for tech leads and Standard users.

N.B. add a product flavour so we have non-medic branding as well (e.g. SMS Gateway)

Test marshmallow permissions

On android 6.0+ we programmatically request permissions for sending and receiving SMS.

We may also need to programmatically request all other required permissions (INTERNET, WAKE_LOCK, BOOT_COMPLETED etc.), as I think it's possible for the user to disable these manually, even if they are granted at install time by default.

Check if this needs doing, and if so create an issue for completing the work.

Understand if gateway can support Android 6.0

Since android M (6.0+), two new modes have been introduced which will affect the functioning of medic-gateway: Doze and App Standby. A good introduction is available at https://developer.android.com/training/monitoring-device-state/doze-standby.html

Doze Mode

[No method] can fire alarms more than once per 9 minutes, per app.
https://developer.android.com/training/monitoring-device-state/doze-standby.html#assessing_your_app

App Standby

If the device is idle for long periods of time, the system allows idle apps network access around once a day.
https://developer.android.com/training/monitoring-device-state/doze-standby.html#understand_app_standby

Conclusion

Clearly Doze Mode performance is not ideal, and App Standby performance would be unacceptable.

The document continues to suggest Google Cloud Messaging (GCM), but this is not suitable for our use case.

Alternatives

Opting out of battery optimisations

We can opt out of battery optimisations by requesting the IGNORE_BATTERY_OPTIMIZATION_SETTINGS permission, which apparently means:

An app that is whitelisted can use the network and hold partial wake locks during Doze and App Standby.

This would be ideal, as the cwac-wakeful library that medic-gateway uses for the polling also uses partial wakelocks: https://github.com/commonsguy/cwac-wakeful/blob/74f68c26bfe1e15b614f8b875fb3bf60f75a332e/wakeful/src/com/commonsware/cwac/wakeful/WakefulIntentService.java#L39. However, this reportedly does not work. N.B. this stackoverflow answer was written by the author of the cwac-wakeful library.

Conclusion

It's not yet clear what's the best approach and what will be the most frequent polling of webapp that we can achieve.

May not have high enough SMS_RECEIVED permission to cancel SMS

On pre-kitkat, there are a number of weirdnesses to be aware of:

  1. we need to make sure we're very high in the queue for receiving SMS_RECEIVED intents - reportedly on Samsung GT-I8200, an app called Hangouts is preventing messages from reaching medic-gateway
  2. we probably shouldn't allow medic-gateway to be set as the default SMS app. I didn't realise it was an option, but reportedly this can be done on Samsung GT-I8200

When device space runs out, app explodes

This should probably be a trigger for some cleanup:

 I/MedicGateway(29271): Could not write log entry to DB.
 I/MedicGateway(29271): android.database.sqlite.SQLiteFullException: database or disk is full (code 13): , while compiling: PRAGMA journal_mode
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:893)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:638)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:829)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:814)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:709)
 I/MedicGateway(29271):  at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1040)
 I/MedicGateway(29271):  at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:256)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:224)
 I/MedicGateway(29271):  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
 I/MedicGateway(29271):  at medic.gateway.alert.c.<init>(Unknown Source)
 I/MedicGateway(29271):  at medic.gateway.alert.c.a(Unknown Source)
 I/MedicGateway(29271):  at medic.gateway.alert.i.a(Unknown Source)
 I/MedicGateway(29271):  at medic.gateway.alert.i.a(Unknown Source)
 I/MedicGateway(29271):  at medic.gateway.alert.i.a(Unknown Source)
 I/MedicGateway(29271):  at medic.gateway.alert.i.a(Unknown Source)
 I/MedicGateway(29271):  at medic.gateway.alert.i.a(Unknown Source)
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.