(1)http://telly.github.io/groundy
这个库是async/background tasks,执行异步任务非常的方便;
proguard,官网上有;
(2)https://github.com/JakeWharton/butterknife
ioc,去除多余的findviewById方法等等。
proguard,官网上有;http://jakewharton.github.io/butterknife/
(3)https://github.com/greenrobot/EventBus
解耦的框架,非常不错,很推荐使用,网上也有蛮多分析其源码的。
proguard,如下:http://stackoverflow.com/questions/18460012/eventbus-and-proguard-could-not-dispatch-event
经过测试,这个是可以的
-keepclassmembers class ** {
public void onEvent*(**);
void onEvent*(**);
}
(4)javascript交互,如下,测试过可以。
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
-keepattributes JavascriptInterface
-keep public class com.mypackage.MyClass$MyJavaScriptInterface
-keep public class * implements com.mypackage.MyClass$MyJavaScriptInterface
-keepclassmembers class com.mypackage.MyClass$MyJavaScriptInterface {
<methods>;
}
proguard,http://stackoverflow.com/questions/21260126/proguard-mess-javascript-interface-functions-when-targeting-sdk-in-android-manif(5)使用ACRA库上报异常错误等信息;
https://github.com/ACRA/acra/wiki/ProGuard
#ACRA specifics
# Restore some Source file names and restore approximate line numbers in the stack traces,
# otherwise the stack traces are pretty useless
-keepattributes SourceFile,LineNumberTable
# ACRA needs "annotations" so add this...
# Note: This may already be defined in the default "proguard-android-optimize.txt"
# file in the SDK. If it is, then you don't need to duplicate it. See your
# "project.properties" file to get the path to the default "proguard-android-optimize.txt".
-keepattributes *Annotation*
# keep this class so that logging will show 'ACRA' and not a obfuscated name like 'a'.
# Note: if you are removing log messages elsewhere in this file then this isn't necessary
-keep class org.acra.ACRA {
*;
}
# keep this around for some enums that ACRA needs
-keep class org.acra.ReportingInteractionMode {
*;
}
-keepnames class org.acra.sender.HttpSender$** {
*;
}
-keepnames class org.acra.ReportField {
*;
}
# keep this otherwise it is removed by ProGuard
-keep public class org.acra.ErrorReporter
{
public void addCustomData(java.lang.String,java.lang.String);
public void putCustomData(java.lang.String,java.lang.String);
public void removeCustomData(java.lang.String);
}
# keep this otherwise it is removed by ProGuard
-keep public class org.acra.ErrorReporter
{
public void handleSilentException(java.lang.Throwable);
}
//------------------------------------不定期更新