Android 常用编程技巧

分类:Android30人阅读评论(0)收藏举报

1、设置屏幕的亮度:

WindowManager.LayoutParams lp=getWindow().getAttributes();
lp.screenBrightness
=1.0f;

getWindow().setAttributes(lp);

WindowManager.LayoutParams 的 screenBrightness 是一个 0 表示最暗,1 表示最亮的浮点数。
1.0f 表示 100%,屏幕背景灯开到最亮。

适用于 Android1.5 或以上版本。

2、背景灯常亮

android.os.PowerManager

android.os.PowerManager.WakeLock

http://hi.baidu.com/sunnyykn/blog/item/74532f089567cd326b60fb0d.html

View 类有以下XML属性:

android:keepScreenOn - boolean

3、控制LED灯

主要是用 android.app.NotificationManager 类

final int ID_LED=19871103;

NotificationManager nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Notification notification = new Notification();
notification.ledARGB = 0xFFFFFF; //这里是颜色,我们可以尝试改变,理论上0xFF0000是红色
notification.ledOnMS = 100;
notification.ledOffMS = 100;
notification.flags = Notification.FLAG_SHOW_LIGHTS;
nm.notify(ID_LED, notification);
nm.cancel(ID_LED);

4、让自己的程序获得ROOT权限

http://my.unix-center.net/~Simon_fu/?p=951


5、android 的音频架构(高手啊)

http://www.soomal.com/doc/10100002092.htm

http://www.360doc.com/content/10/1223/09/4525948_80586548.shtml


6、在Emulator上模拟来电效果


telnet

然后输入 o localhost 5554

输入gsm call 123456 上面显示OK

这时再去看模拟器,上面就有来电了.


更多相关文章

  1. 四、 Android之手机屏幕朝向
  2. Android保持屏幕常亮
  3. 改变Android屏幕默认启动方向为横向
  4. How to root android emulator (Android 7.1.1/ Nougat) 如何roo
  5. android终端模拟器运行命令可以进行adb connect
  6. Android屏幕分辨率
  7. Android 屏幕设置
  8. android 模拟器获取root权限
  9. Android dp方式的屏幕适配工具使用(Android Studio插件方式)

随机推荐

  1. 『转』Android Intent常见应用
  2. PreferenceActivity-Android的设置界面
  3. Android 之网络编程
  4. Android widget组件(一):Button、 EditText
  5. LatinIME输入法分析
  6. Android清除本地数据缓存代码案例
  7. Tab形式的菜单实现总结TabHost 和 Fragme
  8. android保持在休眠时,后台程序继续运行(让
  9. Android 内核编绎错误解决方案
  10. android 自动打包