安卓开发过程中权限大全

最近自学某公司的一些课程,在这里做一些总结,安卓开发常用的权限。

1

活动管理器
权限<uses-permission android:name="android.permission.GET_TASKS"/>
代码ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
2警报管理器
权限
代码AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
3音频管理器
权限
代码AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
4剪贴板管理器
权限
代码ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);;
5连接管理器
权限<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
代码ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
6输入法管理器
权限
代码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);
17Wi-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); 

转载于:https://www.cnblogs.com/xiaowangba/p/6314922.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值