随笔分类 - android
摘要:MediaCodec的使用demo: https://github.com/vecio/MediaCodecDemo https://github.com/taehwandev/MediaCodecExample http://bigflake.com/mediacodec/ 以下文章转载自: ht
阅读全文
摘要:大家对该功能第一印象就是ApiDemo 里面的 其只有区区几行代码 提取为: 执行之 会弹出一个对话框 效果为: 怎么实现这个呢? 1. 定义TestActivity 用于根据传入Uri 播放目标 2. 在AndroidManifest 注册TestActivity 3. 使用TestActivit
阅读全文
摘要:1,在build.grandle添加,其中规则写在proguard-rules.pro中,也可以自定义一个文件,将其代替,比如eclipse常用的 proguard-project.txt: buildTypes { release { signingConfig signingConfigs.re
阅读全文
摘要:http://www.jianshu.com/p/3c63ae866e52# 在Android Studio里,如果你想引入任何library到自己的项目中,只需要很简单的在module的build.gradle文件中添加一行依赖。 就是这么简单,library已经可以在自己的项目中使用。 这看起来
阅读全文
摘要:由于软链接及android的外部卡mount方式存在,导致一个文件夹可能同时有两个路径,如: /mnt/sdcard1 /storage/ext_sdcard ,如果通过某种方式(如mount命令)得到了这两个路径,但是现在要给路径去重,可以采用如下方法: 一、首先,要判断目录是否是同一个目录,可能
阅读全文
摘要:在源码\android\frameworks\base\core\java\android\content\res \Configuration.java下有读取DEFAULT_FONTSCALE的值,如果没有定义这个值就用缺省的值fontScale = 1.0f; 代码如下: 我后来加的代码: f
阅读全文
摘要:在 app/build.gradle 文件里添加几行代码: 加完之后整个build.gradle文件像这个样子(注意其中的 versionCode gitCommitCount 和 versionName gitShortShaDate): 附: git的 post-commit 类型 hook,p
阅读全文
摘要:当应用进程创建 RxCache 的实例后,会给应用进程返回一个 rxcache实例及一个 ProxyProvider,代码如下: using之前的代码返回的就是 rxcache 实例, using返回的是一个proxy实例。 这句调用会进入了rxcache的源码实现里,using的实现代码会创建一个
阅读全文
摘要:Jython is an implementation of the Python programming language designed to run on the Java platform. It is the successor ofJPython。但jython可能不能运行这andro
阅读全文
摘要:RxJava 是他们的基础组件,RxAndroid, Retrofit, RxCache等等都要用到它。 RxJava的基本用法: 关于 unSubscribe() 的调用问题: There is no need to unsubscribe in onCompleted. Take a look
阅读全文
摘要:android studio 代码块左边的缩进对齐线的颜色修改: Settings -> Editor -> Colors & Fonts -> General -> Code -> Vertical ident guide. 改成自己需要的颜色。 Android SDK在线更新镜像服务器 中国科学
阅读全文
摘要:在j2ee中可能会引起业务的延迟,java自行决定是否需要使用 Socket.TCP_NODELAY 选项来禁用 nagle 策略算法。c语言的语法是: setsockopt( sock, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(on));
阅读全文
摘要:LogReport: https://github.com/wenmingvs/LogReport, 崩溃日志上传框架 wcl-permission-demo:Android 6.0 - 动态权限管理的解决方案,文章:http://www.wangchenlong.org/2016/03/20/16
阅读全文
摘要:aFileChooser: https://github.com/iPaulPro/aFileChooser/issues, 这个是最适合android的文件选择器,看看有无可能改成文件夹选择器。 filemanager: https://github.com/openintents/fileman
阅读全文
摘要:直接打开如下网址: https://github.com/search?l=Java&q=+stars%3A%3E0&ref=searchresults&type=Repositories 或者在github的搜索框里输入: stars:>0
阅读全文
摘要:然后在子工程里加入: 示例(上面的repo是包含 gradle/wrapper 的目录,一般是顶层目录): 如果上面的还是不好弄,推荐一个简单的 jitpack.io 官网自己提供的获取导入格式的网址 :https://jitpack.io/#com.afollestad/material-dial
阅读全文
摘要:RxJava 是他们的基础组件,RxAndroid, Retrofit, RxCache等等都要用到它。 https://github.com/ReactiveX/RxJava https://github.com/ReactiveX/RxAndroid 有一个基于okhttp的android ht
阅读全文
摘要:后来加上的,因为太强大了,android上百个可立即使用的开源库介绍:https://github.com/Trinea/android-open-project 一些小工具库:1、The android tools 自己整理的常用的工具类 ; 2、AndroidUtilCode http://ww
阅读全文
摘要:1. 手机要有root权限 2. 下载tcpdump http://www.strazzere.com/android/tcpdump 3. adb push c:\wherever_you_put\tcpdump /data/local/tcpdump 4. adb shell chmod 675
阅读全文