0%

repositories {
flatDir {
dirs 'libs'
}
}

fileTree(dir: 'libs', include: '**/*.aar')
.each { File file ->
dependencies.add("compile", [name: file.name.lastIndexOf('.').with { it != -1 ? file.name[0..ext: 'aar'])
}

原文链接

adb shell
shell@android:/ $ su
su
Test prop
no androVM.su.bypass prop -> su access rights managed by the SuperUser app
shell@android:/ # mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
shell@android:/ # chmod 777 /system
chmod 777 /system
shell@android:/ # cd system
cd system
shell@android:/system # chmod 777 etc
chmod 777 etc
shell@android:/system # cd etc
cd etc
shell@android:/system/etc # chmod 777 hosts
chmod 777 hosts
shell@android:/system/etc # exit
exit
shell@android:/ $ exit
exit

adb push D:\hosts system/etc
1 KB/s (184 bytes in 0.125s)

adb shell
shell@android:/ $ cat system/etc/hosts
cat system/etc/hosts
shell@android:/ $ exit
exit

 

json数据现在在项目中用到的非常多,如解析{“name”:”zhangsan“},当我们用getString(”age“)时,此时会抛出异常

1
2
3
Returns the value mapped by name if it exists, coercing it if necessary.
Throws
JSONException  if no such mapping exists.  

为避免出现此异常,我们可以用另外一个方法optString(”age“),这样即便没有这个字段也不会抛出异常,而是返回空字符。详情看这个方法的英文注释

1
Returns the value mapped by name if it exists, coercing it if necessary. Returns the empty string if no such mapping exists. 

声明:eoe文章著作权属于作者,受法律保护,转载时请务必以超链接形式附带如下信息

原文作者: 皇马船长

原文地址: http://my.eoe.cn/cainiao1/archive/15406.html