An extensible diagnostics activity for Android.
Uses Android's data binding framework, which is still in beta, so expect changes.
Add this library to your app's build.gradle
file:
android {
// This library uses data binding, so you'll need
// to add the following lines:
dataBinding {
enabled = true
}
}
dependencies {
compile 'org.honorato.diagnostics:diagnostics:0.1.7'
}
Create an activity that extends DiagnosticsActivity
(remember to declare it on your manifest as well):
public class MyDiagnosticsActivity extends DiagnosticsActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
}
Call it:
Intent intent = new Intent(this, MyDiagnosticsActivity.class);
startActivity(intent);
- RAM Memory
- GPS enabled
- Disk space
- Network connection
- Network quality (speed)
- Battery status
- NTP time sync
To add custom checks you'll need to:
- Create a custom check and override the
performCheck
method:
public class CustomCheck extends Check {
public CustomCheck(Context context) {
super(context);
setTitle(R.string.custom_title);
}
@Override
public void performCheck() {
setStatus(STATUS_OK, "Everything's OK!");
}
}
- Create an activity that extends
DiagnosticsActivity
and overridesetChecks
:
public class MyDiagnosticsActivity extends DiagnosticsActivity {
@Override
protected void setChecks() {
super.setChecks();
// Add your checks like this:
// this.checks.add(new CustomCheck(this.getBaseContext()));
}
}
Contributions are welcome! Here are a few ideas:
- Fix permissions for Android 6.0 (Marshmallow)
- Setup a result (to be used along with
startActivityForResult
) NetworkQualityCheck
needs to be more stable, and provide uplink/downlink checks- Sensor checks are welcome
- Create an icon
- Coordinator layout for ActionBar + ListView
- Add kbps measurement to
NetworkQualityCheck