6.0許可權的基本知識,以下是需要單獨申請的許可權,共分為9組,每組只要有乙個許可權申請成功了,就預設整組許可權都可以使用了。
group:android.permission-group.contacts
permission:android.permission.write_contacts
permission:android.permission.get_accounts
permission:android.permission.read_contacts
group:android.permission-group.phone
permission:android.permission.read_call_log
permission:android.permission.read_phone_state
permission:android.permission.call_phone
permission:android.permission.write_call_log
permission:android.permission.use_sip
permission:android.permission.process_outgoing_calls
permission:com.android.voicemail.permission.add_voicemail
group:android.permission-group.calendar
permission:android.permission.read_calendar
permission:android.permission.write_calendar
group:android.permission-group.camera
permission:android.permission.camera
group:android.permission-group.sensors
permission:android.permission.body_sensors
group:android.permission-group.location
permission:android.permission.access_fine_location
permission:android.permission.access_coarse_location
group:android.permission-group.storage
permission:android.permission.read_external_storage
permission:android.permission.write_external_storage
group:android.permission-group.microphone
permission:android.permission.record_audio
group:android.permission-group.sms
permission:android.permission.read_sms
permission:android.permission.receive_wap_push
permission:android.permission.receive_mms
permission:android.permission.receive_sms
permission:android.permission.send_sms
permission:android.permission.read_cell_broadcasts
以下是普通許可權,只需要在androidmanifest.xml中申請即可。
android.permission.access_location_extra_commands
android.permission.access_network_state
android.permission.access_notification_policy
android.permission.access_wifi_state
android.permission.access_wimax_state
android.permission.bluetooth
android.permission.bluetooth_admin
android.permission.broadcast_sticky
android.permission.change_network_state
android.permission.change_wifi_multicast_state
android.permission.change_wifi_state
android.permission.change_wimax_state
android.permission.disable_keyguard
android.permission.expand_status_bar
android.permission.flashlight
android.permission.get_accounts
android.permission.get_package_size
android.permission.internet
android.permission.kill_background_processes
android.permission.modify_audio_settings
android.permission.nfc
android.permission.read_sync_settings
android.permission.read_sync_stats
android.permission.receive_boot_completed
android.permission.reorder_tasks
android.permission.request_install_packages
android.permission.set_time_zone
android.permission.set_wall*****
android.permission.set_wall*****_hints
android.permission.subscribed_feeds_read
android.permission.transmit_ir
android.permission.use_fingerprint
android.permission.vibrate
android.permission.wake_lock
android.permission.write_sync_settings
com.android.alarm.permission.set_alarm
com.android.launcher.permission.install_shortcut
com.android.launcher.permission.uninstall_shortcut
//首先判斷有沒有許可權
if (build.version.sdk_int >= build.version_codes.m) , request_permission);//申請許可權
return; }
}
/**
* 返回許可權申請結果 *
* @param requestcode
* @param permissions
* @param grantresults
*/@override
public void onrequestpermissionsresult(int requestcode, @nonnull string permissions, @nonnull int grantresults)
break; }
}super.onrequestpermissionsresult(requestcode, permissions, grantresults); }
android6 0以上動態申請許可權問題。
android公升級到6.0以後,一些敏感許可權不僅僅需要在清單檔案中配置許可權,還需要在程式執行時動態的申請。請求許可權 判斷是否需要動態申請許可權,即系統是否是6.0以上 if build.version sdk int build.version codes.m request read co...
Android6 0及以上動態申請許可權詳細講解
不知不覺android已經到了8.0,記得剛開始6.0剛出來的時候也是看了別人寫的一些文章這麼慢慢的過來了,轉眼已經快要兩年了,感嘆時光過的好快,然而不知道自己到底進步了多少。也許因為自己很懶,不善於總結,導致有時候明明之前見過某個知識點,卻又給忘了。當後來慢慢寫筆記的時候,我發現筆記對自己真的很重...
android6 0動態獲取許可權
android6.0引入了新的許可權系統,部分許可權需要我們動態的獲取。如果不注意這個改變,會造成我們應用的部分功能無法使用,甚至crash。目前有兩種解決辦法 這種方法雖然能夠臨時解決許可權問題,但是如果使用者在選擇許可權的時候選擇否,容易造成應用crash。2.當我們需要使用動態獲取許可權的功能...