Open bishwasBhatta opened 8 years ago
Great list there @mandric . Can we have all that? 😄
On serious note, alert for Scenario 3 If data connection is lost for extended time (either WiFi, or GSM)
will be a great feature to have.
Get battery level:
import android.content.Intent;
import android.content.IntentFilter;
import android.os.BatteryManager;
import static android.content.Intent.ACTION_BATTERY_CHANGED;
---
Intent i = ctx.registerReceiver(null, new IntentFilter(ACTION_BATTERY_CHANGED));
Object val;
int level = i.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
int scale = i.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
if(level < 0 || scale <= 0) {
val = "unknown";
} else {
val = Math.round(level * 100.0f / scale);
}
This information could also easily be added to each request to medic-api, e.g.
{
"messages": ...
"updates": ...
"device": {
"power": 72
}
}
@alxndrsn Along with the information about the battery, can we please incorporate the details we can get from adb
commands. Such as:
adb dumpsys meminfo
adb dumpsys cpuinfo
, adb shell dumpsys | grep gateway | grep -i error
adb bugreport
adb shell dumpsys connectivity
Further any hardware diagnostic information would be helpful to keep track of the health of the gateway phone.
@mukesh2006 if you have an example of the outputs of these commands, that would be helpful. I doubt we can run the commands directly from java, but we may be able to get some of the same data. However, when implementing this feature we'll also be concerned with how quick it is to collect these data, and how much they might increase the size of a request to webapp.
@alxndrsn The output of these commands are:
adb dumpsys meminfo: memeinfo_medic_gateway.txt
adb dumpsys cpuinfo: cpuinfo_medic_gateway.txt
adb shell dumpsys | grep gateway: medic_error.txt
adb bugreport: bugreport-LDN-L22A-HUAWEILDN-LX2-2018-11-27-16-07-09.zip
adb shell dumpsys connectivity: medic_connectivity.txt
These are elaborate logs, we only need snippet of logs which are related with the medic gateway app, network, cpu and memory of the phone.
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.