A Don't Kill My App Library
The aim of dontkillmyapp.com is to create a collection of guides and information to help users and developers troubleshoot issues on their devices related to background tasks being killed unnecessarily by the Android system. This library displays relevant information from this site to the user of an affected application, and attempts to walk users through the process of solving the problem themselves, hopefully reducing the amount of time that developers have to spend providing support as a result of these issues.
Default Activity | Activity w Custom Theme | Dialog | Customized Doki View |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
For testing and experimentation purposes, a sample apk can be downloaded here.
Doki is available via JitPack, so getting it as simple as adding it as a dependency, like this:
build.gradle
fileallprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
build.gradle
filedependencies {
implementation('dev.doubledot.doki:library:0.0.1@aar') {
transitive = true
}
}
The DokiActivity
provides you with a default uncustomized implementation
of the Doki API that is quick and easy to set up and use. Simply call
DokiActivity.start(...)
to open it.
```kotlin DokiActivity.start(context = ...) ```
```java DokiActivity.start(context); ```
Alternatively, you can use DokiActivity.newIntent(...)
to create an
Intent to open it.
DokiContentView
is the custom view that DokiActivity
is based on. Implementing
it allows for greater customization and use in more complex scenarios.
In the layout you want to include our custom view, just add it like this:
<dev.doubledot.doki.views.DokiContentView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/doki_content"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
In order to fetch content from the Don't Kill My App website,
you must call loadContent()
on the view.
```kotlin val doki : DokiContentView? = findViewById(R.id.doki_content) doki?.loadContent() ```
```java DokiContentView doki = findViewById(R.id.doki_content); if (doki != null) doki.loadContent(); ```
If you are using the DokiContentView
, you can customize it by setting custom attributes.
Please check this file
which implements every option available.
For custom fonts and text styles, you can override the following styles:
<style name="Doki.Custom.Headline" parent="Doki.Headline"/>
<style name="Doki.Custom.Overline" parent="Doki.Overline"/>
<style name="Doki.Custom.Button" parent="Doki.Button"/>
And add the following attributes as you wish and with the values you want:
<item name="fontFamily">sans-serif</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:textStyle">bold</item>
<item name="android:textAllCaps">false</item>
<item name="android:textSize">16sp</item>
<item name="android:letterSpacing">0.1</item>
Note: don't change the parent styles, just add the attributes you want to modify
Thank you to everyone that helped to make this project possible!
MIT License
Copyright (c) 2019 Doki Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.