Skip to content

Commit 77af556

Browse files
committed
release 19
1 parent 06738c7 commit 77af556

File tree

5 files changed

+134
-42
lines changed

5 files changed

+134
-42
lines changed

README.md

Lines changed: 125 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,182 @@
1-
<div align="center">
1+
<div align="center">
22
<table><tr>
33
<td width="45%" align="left">Яхонт делает невозможное</td>
44
<td><img src="https://akhasoft.github.io/yakhont/library/core/logo.png"></td>
55
<td width="45%" align="right">Yakhont - break limits now</td>
66
</tr></table>
77
</div>
8-
9-
# Yakhont: high-level Android components for data loading, location, lifecycle callbacks and more
8+
9+
# Yakhont: high-level Android components for data loading, location, lifecycle callbacks and many more
1010

1111
Yakhont is an Android high-level library offering developer-defined callbacks,
12-
loader wrappers, cache, location-awareness, permissions handling, lifecycle debug classes,
13-
advanced logging and many more helpful developer-oriented issues.
12+
loader wrappers, fully automatic cache, location-awareness, dynamic permissions handling,
13+
lifecycle debug classes, advanced logging and many more helpful developer-oriented issues.
14+
15+
Now you can load data in just one line of code (please refer to the
16+
[simplified demo](yakhont-demo-simple/src/main/java/akha/yakhont/demosimple/MainFragment.java)
17+
for working example):
18+
19+
```groovy
20+
new Retrofit2CoreLoadBuilder<>(/* your parameters */).create().startLoading();
21+
```
22+
23+
And take location in just a couple of lines (the working example is in the
24+
[simplified demo](yakhont-demo-simple/src/main/java/akha/yakhont/demosimple/MainActivity.java)
25+
too):
1426

15-
It extends the [Application.ActivityLifecycleCallbacks](https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html)
27+
```groovy
28+
@CallbacksInherited(LocationCallbacks.class)
29+
public class YourActivity extends Activity implements LocationListener {
30+
@Override
31+
public void onLocationChanged(Location location, Date date) {
32+
// your code here
33+
}
34+
}
35+
```
36+
37+
Yakhont extends the [Application.ActivityLifecycleCallbacks](https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html)
1638
approach to support your own callbacks creation, that allows to customize handling of
1739
almost every lifecycle state of your Activities and Fragments - and even without changing
1840
their sources (especially useful for libraries developers).
1941

20-
Powerful loader wrappers, which allows loading data in just one line of code, are abstracting
21-
you away from things like loaders management, data binding and caching, progress dialogs
22-
(fully customizable), errors handling and low-level threading;
23-
don't miss the swipe refresh and Rx support too.
42+
The powerful loader wrappers, which (in simplest, but very typical case) allows loading data
43+
in one line of code, are abstracting you away from things like loaders management, data binding
44+
and caching, progress dialogs (fully customizable), errors handling and low-level threading;
45+
don't miss the swipe refresh and both Rx and Rx2 support too.
2446

25-
In short, the data loader features are:
47+
In short, the data loaders features are:
2648
- fully asynchronous
27-
- forced timeout
28-
- transparent cache
49+
- forced timeouts
50+
- automatic and absolutely transparent cache
2951
- both [RxJava](https://github.com/ReactiveX/RxJava/tree/1.x) and [RxJava 2](https://github.com/ReactiveX/RxJava) support
3052
- both [Retrofit](http://square.github.io/retrofit/1.x/retrofit/) and [Retrofit 2](http://square.github.io/retrofit/2.x/retrofit/) support
3153
- swipe-to-refresh
3254
- device orientation changing support
33-
- fully customizable GUI progress (via Dagger 2)
34-
35-
Other features includes:
36-
- out-of-the-box location awareness: just annotate your Activity and you're done
55+
- fully customizable GUI progress (via Dagger 2)
56+
- and last but not least: if Retrofit does not meet your requirements,
57+
support for any other libraries can be added easily
58+
59+
In addition, there are the location features which includes:
60+
- both new ([FusedLocationProviderClient](https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderClient)-based)
61+
and old ([GoogleApiClient](https://developers.google.com/android/reference/com/google/android/gms/common/api/GoogleApiClient)-based)
62+
Google Location API support
63+
- completely auto (but fully customizable via callbacks) permission handling
64+
- tons of boilerplate code are not needed anymore - just annotate your Activity
65+
- Rx support (both [RxJava](https://github.com/ReactiveX/RxJava/tree/1.x) and [RxJava 2](https://github.com/ReactiveX/RxJava))
66+
67+
So, the features Yakhont provides are:
68+
- powerful (but very easy in use) data loaders
3769
- self-configurable transparent cache which adjusts database structure 'on the fly'
70+
- out-of-the-box location awareness: just annotate your Activity and you're done
71+
- dynamic permissions handling, powered by user-defined callbacks
3872
- debug classes with strict mode and lifecycle logging - for all kinds of
39-
Activities and Fragments (can be enabled even for 3rd-party components)
73+
Activities and Fragments (can be enabled even for 3rd-party components via simple,
74+
but effective Yakhont preprocessor)
4075
- advanced logging with e-mail support (auto-disabled in release builds) and more.
4176

4277
All Activities and Fragments are supported: it's not necessary to derive them from any predefined
4378
ones (with one exception - you will need it for lifecycle debug).
4479

45-
The Yakhont AAR is about 300 KB (except the _full_ version, which is about 500 KB).
80+
The Yakhont AAR is about 320 KB (except the _full_ version, which is about 530 KB).
4681

4782
Yakhont supports Android 2.3 (API level 9) and above
4883
(_core_ version requires Android 3.0 (API level 11) as a minimum).
4984

50-
**Note:** Location API requires Android 4.0 (API level 14).
85+
**Note:** Location API requires Android 4.0 (API level 14); please visit
86+
[Android Developers Blog](https://android-developers.googleblog.com/2016/11/google-play-services-and-firebase-for-android-will-support-api-level-14-at-minimum.html)
87+
for more information.
5188

52-
## Demo
89+
## Demo and Releases
5390

54-
Demo applications are available [here](https://akhasoft.github.io/yakhont/yakhont-demo.apk) and
55-
[here (simplified version)](https://akhasoft.github.io/yakhont/yakhont-demo-simple.apk).
91+
Demo applications are available for download from the
92+
[latest release](https://github.com/akhasoft/Yakhont/releases/latest).
5693

5794
## Versions
5895

59-
- _core_: works with native Fragments
96+
- _core_: works with native Android Fragments
6097
- _support_: works with support Fragments (android.support.v4.app.Fragment etc.)
61-
- _full_: core + support + debug classes for Activities and Fragments
98+
- _full_: core + support + debug classes for most of Activities and Fragments
6299

63100
## Usage
64101

65-
Add the following to your build.gradle:
102+
Add the following to your build.gradle (you can use **build.gradle** files from [demo](yakhont-demo/buildgradle)
103+
and [simplified demo](yakhont-demo-simple/buildgradle) as working examples).
104+
105+
1. Update the **buildscript** section:
66106

67107
```groovy
68108
buildscript {
69109
dependencies {
70-
classpath 'akha.yakhont.weaver:yakhont-weaver:0.9.18'
110+
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
111+
112+
classpath 'akha.yakhont.weaver:yakhont-weaver:0.9.19'
71113
classpath 'org.javassist:javassist:3.20.0-GA'
72114
}
73115
}
116+
```
117+
118+
2. After your **apply plugin: 'com.android.application'** insert the following:
119+
120+
```groovy
121+
apply plugin: 'com.neenbedankt.android-apt'
122+
```
123+
124+
3. Update the **dependencies** section:
74125

126+
```groovy
75127
dependencies {
76-
compile 'com.github.akhasoft:yakhont:0.9.18'
128+
compile 'com.google.dagger:dagger:2.10'
129+
apt 'com.google.dagger:dagger-compiler:2.10'
130+
provided 'javax.annotation:jsr250-api:1.0'
131+
132+
compile 'com.android.support:appcompat-v7:25.3.1'
133+
134+
compile 'com.github.akhasoft:yakhont:0.9.19'
77135
}
136+
```
137+
138+
If you're using location API, add the line below:
139+
140+
```groovy
141+
dependencies {
142+
compile 'com.google.android.gms:play-services-location:11.0.4'
143+
}
144+
```
145+
146+
And for the Retrofit2 the following lines are required:
78147

148+
```groovy
149+
dependencies {
150+
compile 'com.squareup.retrofit2:retrofit:2.3.0'
151+
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
152+
}
153+
```
154+
155+
4. The code below forced to compile _release_ version only. If you want to compile
156+
the _debug_ version, please replace 'debug' with 'release':
157+
158+
```groovy
159+
android.variantFilter { variant ->
160+
if (variant.buildType.name == 'debug') {
161+
variant.setIgnore(true);
162+
}
163+
}
164+
```
165+
166+
5. The code which runs Yakhont Weaver:
167+
168+
```groovy
79169
String[] weaverConfigFiles = null
80170
boolean weaverDebug = false, weaverAddConfig = true
81171
android.registerTransform(new akha.yakhont.weaver.WeaverTransform(weaverDebug, android.defaultConfig.applicationId,
82172
android.bootClasspath.join(File.pathSeparator), weaverConfigFiles, weaverAddConfig))
83173
```
84174

85-
To avoid using the Transform API, you can try the following:
175+
Or (to avoid using the Transform API) you can try the following:
86176

87177
```groovy
178+
String[] weaverConfigFiles = null
179+
boolean weaverDebug = false, weaverAddConfig = true
88180
android.applicationVariants.all { variant ->
89181
JavaCompile javaCompile = variant.javaCompile
90182
javaCompile.doLast {
@@ -95,11 +187,11 @@ android.applicationVariants.all { variant ->
95187
}
96188
```
97189

98-
Here the Yakhont weaver manipulates the Java bytecode just compiled, which makes possible
190+
Here the Yakhont Weaver manipulates the Java bytecode just compiled, which makes possible
99191
to alternate classes implementation (e.g. add callbacks to Activities and Fragments)
100192
without changing their source code.
101193

102-
**Note:** the new Google "Jack and Jill" technology is not supporting bytecode manipulation
194+
**Note:** the Google "Jack and Jill" technology is not supporting bytecode manipulation
103195
(at least, for the moment).
104196

105197
## Weaver configuration
@@ -116,7 +208,7 @@ automatically appends these directives to your ProGuard configuration.
116208

117209
Anyway, it's strongly advised also to keep your model and Retrofit API as follows
118210
(it's just an example from the Yakhont Demo,
119-
please update it according to your application's packages names):
211+
so please update it according to your application's packages names):
120212

121213
```
122214
-keep class akha.yakhont.demo.model.** { *; }
@@ -133,7 +225,7 @@ $ cd Yakhont
133225
$ ./gradlew build
134226
```
135227

136-
To do a clean build, issue the following commands:
228+
To do a clean build, run the commands below:
137229

138230
```
139231
$ ./gradlew --configure-on-demand yakhont-weaver:clean yakhont-weaver:build

yakhont-demo-simple/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ buildscript {
2222
dependencies {
2323
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' // Dagger 2
2424

25-
classpath 'akha.yakhont.weaver:yakhont-weaver:0.9.18' // Yakhont weaver
25+
classpath 'akha.yakhont.weaver:yakhont-weaver:0.9.19' // Yakhont weaver
2626
classpath 'org.javassist:javassist:3.20.0-GA'
2727
}
2828
}
@@ -41,8 +41,8 @@ android {
4141
minSdkVersion 14
4242
//noinspection OldTargetApi
4343
targetSdkVersion 23 // for lower values permissions dialogs will not be shown
44-
versionCode 10000
45-
versionName '1.0'
44+
versionCode 10101
45+
versionName '1.1'
4646

4747
resConfigs 'en', 'ru'
4848
}

yakhont-demo/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ buildscript {
2222
dependencies {
2323
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' // Dagger 2
2424

25-
classpath 'akha.yakhont.weaver:yakhont-weaver:0.9.18' // Yakhont weaver
25+
classpath 'akha.yakhont.weaver:yakhont-weaver:0.9.19' // Yakhont weaver
2626
classpath 'org.javassist:javassist:3.20.0-GA'
2727
}
2828
}
@@ -41,7 +41,7 @@ android {
4141
minSdkVersion 14
4242
//noinspection OldTargetApi
4343
targetSdkVersion 23 // for lower values permissions dialogs will not be shown
44-
versionCode 10100
44+
versionCode 10101
4545
versionName '1.1'
4646

4747
resConfigs 'en', 'ru'

yakhont-weaver/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ apply plugin: 'java'
1818

1919
ext {
2020
publishedName = 'Yakhont Weaver'
21-
publishedDescription = 'The Yakhont component for the Java bytecode manipulation'
21+
publishedDescription = 'The Yakhont component for working with the Java bytecode'
2222

2323
publishedGroupId = 'com.github.akhasoft'
2424
publishedArtifactId = 'yakhont-weaver'
2525
publishedPackaging = 'jar'
26-
publishedVersion = '0.9.18'
26+
publishedVersion = '0.9.19'
2727

2828
projectJavaDocLinks = ['http://jboss-javassist.github.io/javassist/html/',
2929
'http://google.github.io/android-gradle-dsl/javadoc/current/']

yakhont/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ apply plugin: 'com.neenbedankt.android-apt'
2828

2929
apply from: 'preprocessor.gradle'
3030

31-
String verName = '0.9.18'
32-
int verCode = 901818
31+
String verName = '0.9.19'
32+
int verCode = 901901
3333

3434
ext {
3535
publishedName = 'Yakhont'

0 commit comments

Comments
 (0)