標籤:
Android Permission denied 錯誤(附Android許可權大全)
java.net.SocketException: Permission denied (maybe missing INTERNET permission)
這是一個經典錯誤, Socket不能對外串連,錯誤不會被報出,調試的時候,能看到Exception, 這個Exception會有非常多變體。
Android預設不同意訪問網路,所以,在AndroidManifest.xml中,須要進行例如以下配置:
<uses-permission android:name="android.permission.INTERNET" />
以加入網路訪問許可權。
*********************************************************************************************************************************
*********************************************************************************************************************************
Android許可權在源碼編譯產生的檔案裡:out/target/common/R/android/Manifest.java,詳細內容例如以下:
public final class Manifest {
public static final class permission {
//詳細代碼略去
}
}
下面附Android 許可權大全中英對比,以備使用,依據網友提醒可能不全,只是知道了方法,找的也就easy了
android.permission.ACCESS_CHECKIN_PROPERTIES
同意讀寫訪問”properties”表在checkin資料庫中,改值能夠改動上傳( Allows read/write access to the “properties” table in the checkin database, to change values that get uploaded)
android.permission.ACCESS_COARSE_LOCATION
同意一個程式訪問CellID或WiFi熱點來擷取粗略的位置(Allows an application to access coarse (e.g., Cell-ID, WiFi) location)
android.permission.ACCESS_FINE_LOCATION
同意一個程式訪問精良位置(如GPS) (Allows an application to access fine (e.g., GPS) location)
android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
同意應用程式訪問額外的位置提供命令(Allows an application to access extra location provider commands)
android.permission.ACCESS_MOCK_LOCATION
同意程式建立類比位置提供用於測試(Allows an application to create mock location providers for testing)
android.permission.ACCESS_NETWORK_STATE
同意程式訪問有關GSM網路資訊(Allows applications to access information about networks)
android.permission.ACCESS_SURFACE_FLINGER
同意程式使用SurfaceFlinger底層特性(Allows an application to use SurfaceFlinger’s low level features)
android.permission.ACCESS_WIFI_STATE
同意程式訪問Wi-Fi網路狀態資訊(Allows applications to access information about Wi-Fi networks)
android.permission.ADD_SYSTEM_SERVICE
同意程式公布系統級服務(Allows an application to publish system-level services).
android.permission.BATTERY_STATS
同意程式更新手機電池統計資訊(Allows an application to update the collected battery statistics)
android.permission.BLUETOOTH
同意程式串連到已配對的藍牙裝置(Allows applications to connect to paired bluetooth devices)
android.permission.BLUETOOTH_ADMIN
同意程式發現和配對藍牙裝置(Allows applications to discover and pair bluetooth devices)
android.permission.BRICK
請求可以禁用裝置(很危急)(Required to be able to disable the device (very *erous!).)
android.permission.BROADCAST_PACKAGE_REMOVED
同意程式廣播一個提示訊息在一個應用程式套件組合已經移除後(Allows an application to broadcast a notification that an application package has been removed)
android.permission.BROADCAST_STICKY
同意一個程式廣播經常使用intents(Allows an application to broadcast sticky intents)
android.permission.CALL_PHONE
同意一個程式初始化一個電話撥號不需通過撥號使用者介面須要使用者確認(Allows an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call being placed.)
android.permission.CALL_PRIVILEGED
同意一個程式撥打不論什麼號碼,包括緊急號碼無需通過撥號使用者介面須要使用者確認(Allows an application to call any phone number, including emergency numbers, without going through the Dialer user interface for the user to confirm the call being placed)
android.permission.CAMERA
請求訪問使用照相裝置(Required to be able to access the camera device. )
android.permission.CHANGE_COMPONENT_ENABLED_STATE
同意一個程式是否改變一個組件或其它的啟用或禁用(Allows an application to change whether an application component (other than its own) is enabled or not. )
android.permission.CHANGE_CONFIGURATION
同意一個程式改動當前設定,如本地化(Allows an application to modify the current configuration, such as locale. )
android.permission.CHANGE_NETWORK_STATE
同意程式改變網路連接狀態(Allows applications to change network connectivity state)
android.permission.CHANGE_WIFI_STATE
同意程式改變Wi-Fi串連狀態(Allows applications to change Wi-Fi connectivity state)
android.permission.CLEAR_APP_CACHE
同意一個程式清楚緩衝從全部安裝的程式在裝置中(Allows an application to clear the caches of all installed applications on the device. )
android.permission.CLEAR_APP_USER_DATA
同意一個程式清除使用者佈建(Allows an application to clear user data)
android.permission.CONTROL_LOCATION_UPDATES
同意啟用禁止位置更新提示從無線模組(Allows enabling/disabling location update notifications from the radio. )
android.permission.DELETE_CACHE_FILES
同意程式刪除快取檔案(Allows an application to delete cache files)
android.permission.DELETE_PACKAGES
同意一個程式刪除包(Allows an application to delete packages)
android.permission.DEVICE_POWER
同意訪問底層電源管理(Allows low-level access to power management)
android.permission.DIAGNOSTIC
同意程式RW診斷資源(Allows applications to RW to diagnostic resources. )
android.permission.DISABLE_KEYGUARD
同意程式禁用鍵盤鎖(Allows applications to disable the keyguard )
android.permission.DUMP
同意程式返回狀態抓取資訊從系統服務(Allows an application to retrieve state dump information from system services.)
android.permission.EXPAND_STATUS_BAR
同意一個程式擴充收縮在狀態列,android開發網提示應該是一個類似Windows Mobile中的托盤程式(Allows an application to expand or collapse the status bar. )
android.permission.FACTORY_TEST
作為一個工廠測試程式,執行在root使用者(Run as a manufacturer test application, running as the root user. )
android.permission.FLASHLIGHT
訪問閃光燈,android開發網提示HTC Dream不包括閃光燈(Allows access to the flashlight )
android.permission.FORCE_BACK
同意程式強行一個後退操作是否在頂層activities(Allows an application to force a BACK operation on whatever is the top activity. )
android.permission.FOTA_UPDATE
臨時不瞭解這是做什麼使用的,android開發網分析可能是一個預留許可權.
android.permission.GET_ACCOUNTS
訪問一個帳戶列表在Accounts Service中(Allows access to the list of accounts in the Accounts Service)
android.permission.GET_PACKAGE_SIZE
同意一個程式擷取不論什麼package佔用空間容量(Allows an application to find out the space used by any package. )
android.permission.GET_TASKS
同意一個程式擷取資訊有關當前或近期執行的任務,一個縮減的任務狀態,是否活動等等(Allows an application to get information about the currently or recently running tasks: a thumbnail representation of the tasks, what activities are running in it, etc.)
android.permission.HARDWARE_TEST
同意訪問硬體(Allows access to hardware peripherals. )
android.permission.INJECT_EVENTS
同意一個程式截獲使用者事件如按鍵、觸摸、軌跡球等等到一個時間流,android 開發網提醒算是hook技術吧(Allows an application to inject user events (keys, touch, trackball) into the event stream and deliver them to ANY window.)
android.permission.INSTALL_PACKAGES
同意一個程式安裝packages(Allows an application to install packages. )
android.permission.INTERNAL_SYSTEM_WINDOW
同意開啟表單使用系統使用者介面(Allows an application to open windows that are for use by parts of the system user interface. )
android.permission.INTERNET
同意程式開啟網路通訊端(Allows applications to open network sockets)
android.permission.MANAGE_APP_TOKENS
同意程式管理(建立、催後、 z- order預設向z軸推移)程式引用在表單管理器中(Allows an application to manage (create, destroy, Z-order) application tokens in the window manager. )
android.permission.MASTER_CLEAR眼下還沒有明白的解釋,android開發網分析可能是清除一切資料,類似硬格機
android.permission.MODIFY_AUDIO_SETTINGS
同意程式改動全域音頻設定(Allows an application to modify global audio settings)
android.permission.MODIFY_PHONE_STATE
同意改動話機狀態,如電源,人機介面等(Allows modification of the telephony state – power on, mmi, etc. )
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
同意掛載和反掛載檔案系統抽取式存放裝置(Allows mounting and unmounting file systems for removable storage. )
android.permission.PERSISTENT_ACTIVITY
同意一個程式設定他的activities顯示(Allow an application to make its activities persistent. )
android.permission.PROCESS_OUTGOING_CALLS
同意程式監視、改動有關播出電話(Allows an application to monitor, modify, or abort outgoing calls)
android.permission.READ_CALENDAR
同意程式讀取使用者行事曆資料(Allows an application to read the user’s calendar data.)
android.permission.READ_CONTACTS
同意程式讀取使用者連絡人資料(Allows an application to read the user’s contacts data.)
android.permission.READ_FRAME_BUFFER
同意程式螢幕波或和很多其它常規的訪問幀緩衝資料(Allows an application to take screen shots and more generally get access to the frame buffer data)
android.permission.READ_INPUT_STATE
同意程式返回當前按鍵狀態(Allows an application to retrieve the current state of keys and switches. )
android.permission.READ_LOGS
同意程式讀取底層系統記錄檔(Allows an application to read the low-level system log files. )
android.permission.READ_OWNER_DATA
同意程式讀取全部者資料(Allows an application to read the owner’s data)
android.permission.READ_SMS
同意程式讀取簡訊息(Allows an application to read SMS messages.)
android.permission.READ_SYNC_SETTINGS
同意程式讀取同步設定(Allows applications to read the sync settings)
android.permission.READ_SYNC_STATS
同意程式讀取同步狀態(Allows applications to read the sync stats)
android.permission.REBOOT
請求可以又一次啟動裝置(Required to be able to reboot the device. )
android.permission.RECEIVE_BOOT_COMPLETED
同意一個程式接收到 ACTION_BOOT_COMPLETED廣播在系統完畢啟動(Allows an application to receive the ACTION_BOOT_COMPLETED that is broadcast after the system finishes booting. )
android.permission.RECEIVE_MMS
同意一個程式監控將收到MMS多媒體訊息,記錄或處理(Allows an application to monitor incoming MMS messages, to record or perform processing on them. )
android.permission.RECEIVE_SMS
同意程式監控一個將收到簡訊息,記錄或處理(Allows an application to monitor incoming SMS messages, to record or perform processing on them.)
android.permission.RECEIVE_WAP_PUSH
同意程式監控將收到WAP PUSH資訊(Allows an application to monitor incoming WAP push messages. )
android.permission.RECORD_AUDIO
同意程式錄製音頻(Allows an application to record audio)
android.permission.REORDER_TASKS
同意程式改變Z軸排列任務(Allows an application to change the Z-order of tasks)
android.permission.RESTART_PACKAGES
同意程式又一次啟動其它程式(Allows an application to restart other applications)
android.permission.SEND_SMS
同意程式發送SMS簡訊(Allows an application to send SMS messages)
android.permission.SET_ACTIVITY_WATCHER
同意程式監控或控制activities已經啟動全域系統中Allows an application to watch and control how activities are started globally in the system.
android.permission.SET_ALWAYS_FINISH
同意程式控制是否活動間接完畢在處於後台時Allows an application to control whether activities are immediately finished when put in the background.
android.permission.SET_ANIMATION_SCALE
改動全域資訊比例(Modify the global animation scaling factor.)
android.permission.SET_DEBUG_APP
配置一個程式用於調試(Configure an application for debugging.)
android.permission.SET_ORIENTATION
同意底層訪問設定螢幕方向和實際旋轉(Allows low-level access to setting the orientation (actually rotation) of the screen.)
android.permission.SET_PREFERRED_APPLICATIONS
同意一個程式改動列表參數PackageManager.addPackageToPreferred() 和PackageManager.removePackageFromPreferred()方法(Allows an application to modify the list of preferred applications with the PackageManager.addPackageToPreferred() and PackageManager.removePackageFromPreferred() methods.)
android.permission.SET_PROCESS_FOREGROUND
同意程式當前執行程式強行到前台(Allows an application to force any currently running process to be in the foreground.)
android.permission.SET_PROCESS_LIMIT
同意設定最大的執行進程數量(Allows an application to set the maximum number of (not needed) application processes that can be running. )
android.permission.SET_TIME_ZONE
同意程式設定時間地區(Allows applications to set the system time zone)
android.permission.SET_WALLPAPER
同意程式設定壁紙(Allows applications to set the wallpaper )
android.permission.SET_WALLPAPER_HINTS
同意程式設定壁紙hits(Allows applications to set the wallpaper hints)
android.permission.SIGNAL_PERSISTENT_PROCESSES
同意程式請求發送訊號到全部顯示的進程中(Allow an application to request that a signal be sent to all persistent processes)
android.permission.STATUS_BAR
同意程式開啟、關閉或禁用狀態列及表徵圖Allows an application to open, close, or disable the status bar and its icons.
android.permission.SUBSCRIBED_FEEDS_READ
同意一個程式訪問訂閱RSS Feed內容提供(Allows an application to allow access the subscribed feeds ContentProvider. )
android.permission.SUBSCRIBED_FEEDS_WRITE
系統臨時保留改設定,android開發網覺得未來版本號碼會增加該功能。
android.permission.SYSTEM_ALERT_WINDOW
同意一個程式開啟表單使用 TYPE_SYSTEM_ALERT,顯示在其它全部程式的頂層(Allows an application to open windows using the type TYPE_SYSTEM_ALERT, shown on top of all other applications. )
android.permission.VIBRATE
同意訪問震動裝置(Allows access to the vibrator)
android.permission.WAKE_LOCK
同意使用PowerManager的 WakeLocks保持進程在休眠時從螢幕消失( Allows using PowerManager WakeLocks to keep processor from sleeping or screen from dimming)
android.permission.WRITE_APN_SETTINGS
同意程式寫入API設定(Allows applications to write the apn settings)
android.permission.WRITE_CALENDAR
同意一個程式寫入但不讀取使用者行事曆資料(Allows an application to write (but not read) the user’s calendar data. )
android.permission.WRITE_CONTACTS
同意程式寫入但不讀取使用者連絡人資料(Allows an application to write (but not read) the user’s contacts data. )
android.permission.WRITE_GSERVICES
同意程式改動Google服務地圖(Allows an application to modify the Google service map. )
android.permission.WRITE_OWNER_DATA
同意一個程式寫入但不讀取全部者資料(Allows an application to write (but not read) the owner’s data.)
android.permission.WRITE_SETTINGS
同意程式讀取或寫入系統設定(Allows an application to read or write the system settings. )
android.permission.WRITE_SMS
同意程式寫簡訊(Allows an application to write SMS messages)
android.permission.WRITE_SYNC_SETTINGS
同意程式寫入同步設定(Allows applications to write the sync settings)
android平台上的許可權許可分得非常細,假設軟體無法正常運行時看看是不是缺少相關的permission聲明,終於我們還須要使用 android sign tools簽名產生的apk檔案。
為了您的安全,請僅僅開啟來源可靠的網址 來自: http://hi.baidu.com/spare_h/blog/item/10406ba303073eb8c9efd065.html
Android Permission denied 錯誤 ( 附Android許可權大全 )