Skip to content

Instantly share code, notes, and snippets.

View code4a's full-sized avatar
🎯
Focusing

jiang yantao code4a

🎯
Focusing
View GitHub Profile
@code4a
code4a / gist:d47f4d4a2e0ccfd0e828f46849975f05
Created May 26, 2016 10:33
在不root手机的情况下读取Data目录下的文件
正确使用adb读取data下目录
@code4a
code4a / gist:56941deecd00a5f4f2869e0b43d477ca
Created April 22, 2016 01:42
android studio 在Android sdk version 23无法通过gradle compile httpclient 的解决方案
HttpClient was deprecated in API Level 22 and removed in API Level 23.
You can still use it in API Level 23 and onwards if you must,
however it is best to move to supported methods to handle HTTP.
So, if you're compiling with 23, add this in your build.gradle:
android {
useLibrary 'org.apache.http.legacy'
}
@code4a
code4a / gist:5306e9c9e06176af233e
Created February 18, 2016 08:12
Android Studio 给Gradle配置代理的方式
打开项目的gradle.properties,往里添加
# http
systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=port
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
# https
systemProp.https.proxyHost=www.somehost.org
@code4a
code4a / gist:702fba2477155868e5c5
Created January 26, 2016 07:58
android4.1 通知栏不显示小icon
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
builder.setContentText("test!!");
builder.setContentTitle("test_title");
builder.setLargeIcon(icon);
builder.setSmallIcon(R.drawable.ic_launcher);
builder.setPriority(Notification.PRIORITY_MIN); // 重点是这句
NotificationManager nf = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
nf.notify(0,builder.build());
@code4a
code4a / first problem
Last active January 15, 2016 03:43
record some fix plan
<br/> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files