代码改变世界

[Android Tips] 2. Disable recent apps dialog on long press home button

2014-03-20 21:10 by shaobin0604, 434 阅读, 0 推荐, 收藏, 编辑
摘要:public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); Log.d("Focus debug", "Focus changed !"); ... 阅读全文

[Android Tips] 1. Getting StatusBar Height

2014-03-20 12:54 by shaobin0604, 216 阅读, 0 推荐, 收藏, 编辑
摘要:public int getStatusBarHeight() { int result = 0; int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resou... 阅读全文

WebViewClient shouldOverrideUrlLoading 常见错误用法

2013-09-10 23:40 by shaobin0604, 17662 阅读, 3 推荐, 收藏, 编辑
摘要:需求描述 在使用 WebView 的项目中,一个常见的需求是将页面内的链接跳转限制在 WebView 内,而不是使用外部浏览器打开,但 WebView 的默认行为是将链接点击事件作为 Intent 发送给系统,由系统决定如何处理(通常的行为是使用浏览器打开或是弹出浏览器选择对话框),那么如何实现期望 阅读全文

Styling ActionBar Tabs

2013-05-11 17:22 by shaobin0604, 1661 阅读, 0 推荐, 收藏, 编辑
摘要:## 问题说明修改 ActionBar Tabs 模式在 `Theme.Holo.Light` 下的样式,以前是这个样子滴现要改成如下样式## 实现方式打开位于 SDK 提供的 theme 文件,位于`platforms/android-4.2/data/res/values/themes.xml`,找到`Theme.Holo.Light`节,与`ActionBar` 相关的属性如下:<!-- Action bar styles --><item name="actionDropDownStyle">@android:style/Widget.Hol 阅读全文

关于Android 文件API允许创建目录名的最大字符数

2013-03-20 18:14 by shaobin0604, 2411 阅读, 1 推荐, 收藏, 编辑
摘要:问题说明测试文件管理器的时候遇到到一个诡异的问题,新建目录输入了比较长的目录名,目录创建成功(File.mkdir返回true),但是一刷新文件管理器就挂了。之后再也进不了文件管理器,都是闪退。换了好几个文件管理器测试,如:ES,MIUI,OI。问题依旧。adb log 输出的信息如下,没有多少帮助。03-20 17:38:48.969 F/<unknown>( 6020): stack corruption detected: aborted03-20 17:38:48.999 W/InputDispatcher( 1366): channel '417e1c48 com 阅读全文

发布 InternetRadio SDK for Android

2012-12-02 11:36 by shaobin0604, 1968 阅读, 2 推荐, 收藏, 编辑
摘要:InternetRadio SDK 是用于播放网络流媒体音频的多媒体组件。开发者通过集成该SDK,可以很容易开发出类似于 TuneIn Radio, Any Radio, 蜻蜓.fm收音机 的网络收音机应用。 阅读全文

关于应用程序数据的备份与恢复

2012-10-14 21:33 by shaobin0604, 825 阅读, 0 推荐, 收藏, 编辑
摘要:简介市场上不少应用都提供了应用程序(安装包+应用数据)备份与恢复的功能,使得用户在重刷系统之后,应用程序的保存的信息也不会丢失(如:游戏的进度)。目前做的比较好的有:钛备份Go备份小米手机自带的备份功能方案应用程序的数据保存在目录/data/data/{package}普通应用没有权限访问别的应用数据目录下文件,因此需要以ROOT用户身份进行文件的备份与恢复操作。对于已ROOT的手机,可以通过 superuser.apk 授权以 ROOT 用户身份执行备份与恢复程序。对于如小米手机这种定制系统,可以编写一个 native service,并在 init.rc 以 root 身份启动,由 nat 阅读全文

查看部署在Heroku上的项目信息

2012-06-15 16:09 by shaobin0604, 539 阅读, 0 推荐, 收藏, 编辑
摘要:1. 进入项目根目录2. 终端输入$ heroku info输出=== strong-day-9896Addons: Shared Database 5MBDatabase Size: 152kGit URL: git@heroku.com:strong-day-9896.gitOwner Email: shaobin0604@qq.comRepo Size: 2MSlug Size: 3MStack: cedarWeb URL: http://strong-day-9896.herokuapp.com/3. 查看数据库... 阅读全文

About AudioSystem Mute

2012-02-10 10:33 by shaobin0604, 416 阅读, 0 推荐, 收藏, 编辑
摘要:Mute MIC(INPUT)Java层android.media.AudioManagervoid setMicrophoneMute(boolean on)Sets the microphone mute on or off.C++层AudioSystem.h // mute/unmute microphone static status_t muteMicrophone(bool state);Mute Stream(OUTPUT)Java层android.media.AudioManagerpublic void setStreamMute(int streamType,... 阅读全文

[转载]RTSP in Stagefright

2012-01-11 10:34 by shaobin0604, 553 阅读, 0 推荐, 收藏, 编辑
摘要:墙外的文章,搬运过来RTSP support was added into Stagefright on GingerBread release:A preliminary foundation module, provides a generic way to asynchronously handle commands and events/messages sequentially in the schedule thread. Each message has a target id, indicating its corresponding handler, which is the 阅读全文
上一页 1 ··· 4 5 6 7 8 9 10 11 下一页