Android常用权限获取和设置
来源:互联网 发布:wms钢铁加工软件 编辑:程序博客网 时间:2024/05/18 17:41
Android常用权限获取和设置
1 活动管理器
权限 <uses-permission android:name="android.permission.GET_TASKS"/>代码 ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
权限
代码 AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
权限
代码 AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
权限
代码 ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
5 连接管理器
权限 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
代码 ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
权限
代码 InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
7 键盘管理器
权限
代码 KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
8 布局解压器管理器
权限
代码 LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
9 位置管理器
权限
代码 LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
10 通知管理器
权限
代码 NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
11 电源管理器
权限 <uses-permission android:name="android.permission.DEVICE_POWER"/>
代码 PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
12 搜索管理器
权限
代码 SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
13 传感器管理器
权限
代码 SensorManager sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
14 电话管理器
权限 <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
代码 TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
15 振动器
权限 <uses-permission android:name="android.permission.VIBRATE"/>
代码 Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
16 墙纸
权限 <uses-permission android:name="android.permission.SET_WALLPAPER"/>
代码 WallpaperService wallpaperService = (WallpaperService) getSystemService(Context.WALLPAPER_SERVICE);
17 Wi-Fi管理器
权限 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
代码 WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
18 窗口管理器
权限
代码 WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
0 0
- Android常用权限获取和设置
- android 常用adb 和 adb shell 命令 获取root权限
- Android 访问权限设置--cocos2dx常用权限
- android 常用权限和依赖
- Android常用权限和依赖
- Android常用依赖和权限
- android 常用权限和依赖
- Android常用权限和 依赖
- android 常用权限和依赖
- Android 常用权限和依赖
- android 常用权限和依赖
- android 常用权限和依赖
- android 常用权限和依赖
- android 常用权限和依赖
- android 常用权限和依赖
- android 常用权限和依赖
- android 常用权限和依赖
- android 常用权限和依赖
- 在Windows Azure虚拟主机上宿主Byteart Retail案例程序
- poj1088 滑雪 DP+DFS
- 金相抛光机既可以美容汽车也可以将汽车毁容
- tomcat7域名绑定问题
- centos linux 版本下 安装apche php mysql 环境
- Android常用权限获取和设置
- Eclipse代码自动补全设置
- 资料收集
- [IOS] Storyboard全解析
- IOS无限自动循环滚动banner(源码)
- 辅食添加
- Objective-C @encode关键字
- 软声级计如何选麦克风
- cygwin jni 报错 '__int64' does not name a type error: 'jlong' does not name a type