Giter VIP home page Giter VIP logo

cht-android'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-android's People

Contributors

abbyad avatar alxndrsn avatar binokaryg avatar derickl avatar dianabarsan avatar ernestoteo avatar estellecomment avatar freefony avatar gagbodamakou avatar garethbowen avatar henokgetachew avatar jkuester avatar jonathanbataire avatar kennsippell avatar kitsao avatar latin-panda avatar marina-kenf avatar mrjones-plip avatar mrsarm avatar newtewt avatar ngaruko avatar njogz avatar pkitutu avatar scdf avatar smbuthia avatar sugat009 avatar tookam 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

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  avatar  avatar  avatar  avatar  avatar  avatar

cht-android's Issues

Prompt before allowing bad URLs

Instead of rejecting bad URLs as is currently the case, instead display a confirmation dialog, e.g.:

Warning: this URL does not point to a live Medic Mobile webapp. Do you want to use it anyway?

[ back ] [ use it anyway ]

Warn users if system date is wrong

To avoid major reporting date issues, it would be helpful to have a notice that the system date is clearly wrong (eg pre 2015) and some generic comment on how to set it. This has apparently been an issue for previous Android deployment for LG.

Make User-Agent header more easily recognisable

Example from medic-android:

Dalvik/2.1.0 (Linux; U; Android 5.1.1; hi6210sft Build/LMY47X)

Example from medic-gateway:

'Dalvik/2.1.0 (Linux; U; Android 5.1.1; hi6210sft Build/LMY47X) medic.gateway.alert.generic/SNAPSHOT',

username field should default to lower-case

Current behaviour

On the login screen, when clicking on the Username field, the input defaults to uppercase, so on Tecno phone you have to press shift twice before you can enter a lowercase letter to start your username.

Desired behaviour

If input started in lowercase, then life would be easier (for me). Worth checking if real users generally have usernames starting with upper or lowercase letters.

We could also make the username case-insensitive.

Cannot logout

When you log out in the webapp, the android wrapper logs you straight back in again. We need a JS-Java hook which will delete the username and password when the javascript requests it.

app accepts any location request

Instead the app should first check that the location request domain matches the configured domain for the app.

This should protect location from leaking if the user somehow browses to sites outside the app's domain, or in an XSS attack.

Soft menu doesn't display on devices without a menu button

Problem: If you use an Android phone without a menu button you don't see the soft menu button, and so cannot access the app settings.

The current build looks like this (note the lack of legacy soft menu button in the bottom right):
2015-12-22 20 06 31
So you cannot reach this settings page:
2015-12-22 20 14 46
without clearing the app's data from the android system settings.

This is because the target SDK is too high (presumably because we're targetting an SDK that has "moved on" from the menu button concept).

If we change the target SDK to 13 (from 19) the soft menu then appears in the bottom right:

2015-12-22 20 05 44
Except now the settings page:
2015-12-22 20 14 07
Doesn't look very nice.

I'm not sure if changing the target SDK causes other issues, how you can have the minimum sdk higher than the target, or if this is the only solution.

gradle sync fails because minSDKversion is in the manifest file not the build.gradle file.

Trying to run gradle sync is failing beceause were we have the minSDKVersion defined. This can be updated to the build.gradle defaultConfig per the warning. Looks like targetSDKversion is also generating a warning. We should update both to fix.

ERROR: The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
Move minSdkVersion to build file and sync project
Affected Modules: medic-android

WARNING: The targetSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
Move targetSdkVersion to build file and sync project
Affected Modules: medic-android 

Android wrapper crash logging in as Upgrade-Muso-Mali user

  1. Run android wrapper on Samsung S5 Neo. Custom build including 5893f24. Android 6.
  2. Configure to run with upgrade-muso-mali
  3. Login as user coumbadi

Expected: Login as user
Observed: Crash

01-16 16:28:06.966  3310  3310 I chromium: [INFO:CONSOLE(0)] "Application Cache Progress event (32 of 32) ", source: https://upgrade-muso-mali.XXXX/medic/_design/medic/_rewrite/ (0)
01-16 16:28:06.967  3310  3310 I chromium: [INFO:CONSOLE(0)] "Application Cache Cached event", source: https://upgrade-muso-mali.XXXX/medic/_design/medic/_rewrite/ (0)
01-16 16:29:52.154  3310  3355 E chromium: [ERROR:connection.cc(1894)] Quota sqlite error 14, errno 0: unable to open database file, sql: UPDATE OriginInfoTable SET last_modified_time = ? WHERE origin = ? AND type = ?
01-16 16:29:52.166  3310  3384 D         : NULL == surf->write_back_color_buffer
01-16 16:29:52.168  3310  3384 D         : NULL == surf->write_back_color_buffer
01-16 16:29:52.168  3310  3384 E chromium: [ERROR:gles2_cmd_decoder.cc(13477)] Context lost because SwapBuffers failed.
01-16 16:29:52.168  3310  3384 E chromium: [ERROR:gles2_cmd_decoder.cc(5019)] Error: 5 for Command kSwapBuffers
01-16 16:29:52.172  3310  3384 E chromium: [ERROR:texture_manager.cc(2971)] [.Offscreen-MainThread-0xcd87f400.CmdBufferImageTransportFactory-0xca1ab700]GL ERROR :GL_OUT_OF_MEMORY : glTexImage2D: <- error from previous GL command
01-16 16:29:52.289  3310  3384 D mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000,  [1080x1848]-format:1
01-16 16:29:52.298  3310  3310 E chromium: [ERROR:compositor_impl_android.cc(585)] Failed to init OutputSurface for compositor.
01-16 16:29:52.298  3310  3310 E chromium: [ERROR:compositor_impl_android.cc(585)] Failed to init OutputSurface for compositor.
01-16 16:29:52.301  3310  3310 E chromium: Failed to read /proc/self/maps
01-16 16:29:52.301  3310  3310 F chromium: [FATAL:compositor_impl_android.cc(586)] Too many context creation failures. Giving up... 
01-16 16:29:52.301  3310  3310 F chromium: 

@derickl also has a repro of this

Webapp URL errors cover the Save button

When the error comes up you can edit the text, but can't retry the save/connection because the error covers the Save button:
image

On the Tecno Y4 Android 4.4, the surest way to get rid of the message is to press the settings button since it doesnt have any side effects. Pressing the volume also works, but shows the volume bar. The power and menu buttons exit the app, but don't clear the error. The back button clears the error and closes the app.

Make it possible for apps to send SMS

Because of restrictions to the play store and sending sms we need a way to build the android app so that the SMS sending/receiving features are removed. This should be based on flavor as some projects will need it and will have to get the app outside of the play store.

Expose device information in medic-android so we can store it against monthly telemetry readings

It would be really helpful to be able to add hardware-specific information into our monthly telemetry documents that you can't find out from the browser.

Off the top of my head that could be:

  • Phone make and model
  • android major version and patch level
  • Max and free disk space
  • RAM, CPU, GPU (unless that's covered by make and model? Probably best to be explicit)
  • Network capacity re: their sim card (this is may be hard because we might just catch them at a bad time or whatever. It would have to be a static truth that was representative regardless of when we compiled it).

This would be exposed to medic-webapp via the JS bridge.

Code links to follow telemetry merge.

HBB on Settings screen crashes app

Steps to recreate

  1. go to the settings screen
  2. press HBB
  3. the app will now minimise
  4. re-open the app
  5. observe that screen is black with app name at the top, but no UI is visible and buttons don't do anything

Expected behaviour

If [cancel] button is available, HBB should return to the WebView without changing settings. Otherwise, HBB should finish() the Settings activity cleanly.

Cannot access menu on Android 6

Handset: Samsung Galaxy V2
Android version: 6.0.1

There appears to be no way to trigger the menu in the app on this handset when in the EmbeddedBrowserActivity.

For real users, this means that they won't be able to easily refresh the page (via Home menu option).

For developers, this means that reconfiguring the app (changing the webapp URL) is not possible.

Also on this phone, the EmbeddedBrowserActivity is not full-screen - there is a small status bar at the top.

medic-gateway does not have this problem, because the menu can be accessed from the title bar's More button.

Clean up ImagePicker

Either:

  1. use the standard build of ImagePicker, or
  2. move the ImagePicker fork to medic org

`Back` button quits the app

Observed: pressing physical back button exits the app
Expected: pressing back should navigate back a page within the app

Opening the admin console through webapp requires user to close and reopen the app

Logging in as an admin user to the android app allows us to see the admin console. This opens in a new tab/window. Once the user navigates here they cannot return to the medic webapp without closing and opening the app. Low priority as I assume most admin users won't be using the app to configure but it should be handled. Using the hardware back closes the app and could possibly be registered to navigate back in this instance.

Reproduction steps: Using a pixel 2 with android 8.1.0

Open App
Login in as admin user
Tap the hamburger menu dropdown
Tap the configuration.

Only allow webview to access expected URLs

If a URL is injected into our page it's possible to redirect the user to a different domain and risk exposing PHI. Block navigation to any site other than the right one.

First login broken

Observed: When first accessing the app, I am prompted for password by the android container, and then again by the webapp
Expected: should only be asked for password by the android container

Allow tablet users to use app in landscape mode

Switching from landscape to portrait or back causes the app to re-load. Therefore auto-rotation not required, but perhaps there could be a menu option to switch the orientation, or auto-detection if the device is a tablet or a phone.

Simplify known instance selection on entry to the app.

Currently our app shows Custom Alpha Dev and Beta Dev. It would be nice if we were to make a service call and get a list of known instances. Populate a list with the known instances and allow a user to just tap. While also keeping the custom in case the list doesn't get updated.

First Iteration thought would be a static file stored somewhere. Github for example that has a json file of names(key) with urls(value).

A super awesome would be somehow getting a list of all instances dynamically but may be a lot of overhead work.

Create Android notifications from Tasks

To improve the follow through for users it would be beneficial to pass alerts about a Task as an Android notifications. Otherwise we need to rely on the user opening the app to see the tasks.

This may need to be configurable as a different type of task, or could be pulled from known information about existing tasks. Otherwise it could be a generic Android notification to open their app if they haven't opened it in several days.

Add Fastlane or alternative to deploy phase for Travis

Fastlane allows for automating the process of uploading to the play store. This can be leveraged to push our software up for the testing phase using the beta process. It can also be leveraged to upload the new APK when we've completed testing. Taking the manual part out of the process.

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.