medic / cht-android Goto Github PK
View Code? Open in Web Editor NEWA native Android container for Community Health Toolkit (CHT) applications
License: GNU Affero General Public License v3.0
A native Android container for Community Health Toolkit (CHT) applications
License: GNU Affero General Public License v3.0
Otherwise APKs are called workspace-...
when built on Jenkins
Currently: 46MB
Expected: 22MB
I suspect this happened when the crosswalk AAR build was switched from gn
to gyp
. Investigate, and make sure debug flags are disabled for xwalk_core_library
.
Either:
If it's available - i.e. handle failure gracefully.
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 ]
Bugfixes available in medic-gateway
. Consider making it a proper java lib.
Observed: pressing physical back
button exits the app
Expected: pressing back
should navigate back a page within the app
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
It may make no difference except increase the chance of bugs. Check release APK size with and without the guard.
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.
On android 6 and greater, there is an automatic backup feature which saves app data to google drive. We don't want our app's data, specifically the WebView's offline storage, to be saved to drive.
See https://developer.android.com/training/backup/autosyncapi.html#include-exclude for more details.
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.
Test that:
And make sure that it runs on travis
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:
This would be exposed to medic-webapp via the JS bridge.
Code links to follow telemetry merge.
Proof of concept: add onResume()
hook to all activities, e.g. https://stackoverflow.com/questions/12504462/implement-passcode-lock-for-android-application#12504616; add onStart()
hook to StartupActivity
.
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
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.
Value can probably be saved in onStop()
, and restored as currently done in onCreate()
.
if we care
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.
Observed: if a bad username/password combination is provided when accessing https://demo.app.medicmobile.org/, a blank screen is shown to the user
Expected: some kind of Login Failed
message should be shown
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.
If coming from WebView, pressing back
key or clicking cancel
button should take you back to the app, to the page previously viewed.
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.
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.
We should build every commit/branch but only deploy/upload based on git tags, similar to medic-gateway.
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):
So you cannot reach this settings page:
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:
Except now the settings page:
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.
Hello developer,
I am getting the below issues on running make. Can you resolve for this. I am installing the app locally in genymotion virtual device.
https://pastebin.com/EazaW64c
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.
Should be doable with e.g. a PNG overlay across the top of the icon saying ALPHA/BETA
On a slow connection it can take a while to load. It would be good to give the user some feedback while this is happening.
upgrade-muso-mali
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
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.
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.
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.
Seen on Kindle Fire - location permission is requested, but not enforced.
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',
Following from medic/cht-core#1566 and related to medic/cht-core#838: display a prettier error message if we're offline and a request cannot be fulfilled by appcache. Ideally, provide some sort of expando or section containing troubleshooting information, e.g. the requested URL.
Can be easy to forget what server you've configured for. Show a toast on startup to remind the user. This may seem over-technical for general use, but this build is currently only for internal use anyway so seems reasonable.
Brought over from medic/cht-core#1586
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.
When the error comes up you can edit the text, but can't retry the save/connection because the error covers the Save button:
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.
As per medic/cht-core#1237 (comment), using the /setup/poll
endpoint will give a more robust mechanism for checking if we're communicating with medic-api
than the current approach.
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.
If [cancel]
button is available, HBB should return to the WebView without changing settings. Otherwise, HBB should finish()
the Settings activity cleanly.
Build reports:
src/main/java/org/medicmobile/webapp/mobile/SimpleJsonClient.java:5: warning: [deprecation] DefaultHttpClient in org.apache.http.impl.client has been deprecated
import org.apache.http.impl.client.DefaultHttpClient;
It's recommended to switch from DefaultHttpClient to HttpURLConnection. Further reading: http://android-developers.blogspot.com.es/2011/09/androids-http-clients.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.