A smarter and more elegant way to manage your keys in android Intent and SharedPreferences and more.
NOTICE: The document(or tutorial) for this SmartKey hasn't been finished yet, it would come out soon.
- Demo on simple and easy databinding.
The demo app is kind of a very easy and simple databinding demo.
- Demo on a friendlier toast.
Check out ToastUtil and try to toast something for several times simultaneously you'll know what I mean.
- Managing keys when using Intent.
How to elegantly manage the keys involved? The answer is do not manage it yourself and leave it to the system, and cares only about your business.
- Managing keys when using SharedPreferences.
How to elegantly manage the keys involved? The answer is also the same: do not manage it yourself and leave it to the system, and cares only about your business.
- Managing how to start an activity or service.
Generating a SmartTargets class to manage it.
As android-apt comes to an end, we upgraded our settings to annotationProcessor
- In your root project's build.gradle, add the following At buildscript -> in allprojects -> repositories:
maven {url 'https://jitpack.io' }
- In your module's build.gradle, add the following: Add dependencies:
// please note the available history version is 0.1.1, 0.1.5, 0.1.6, now 0.1.7
compile 'com.github.foreveruseful.smartkey:annotation:0.1.7'
compile 'com.github.foreveruseful.smartkey:sdks:0.1.7'
annotationProcessor 'com.github.foreveruseful.smartkey:apt:0.1.7'
- Rebuild your project. Check out the app module as an example.