android uses-feature導致裝置在Android Market搜不到你的應用

來源:互聯網
上載者:User

這兩天發現我們的應用在Android Market 上,有的手機搜尋不到,原因是:

此應用只適用於具備相應功能的裝置

然後後面列出了許多硬體裝置的uses-feature

問題的原因是我們的應用中需要的許可權太多,導致沒有定義中提到的許可權的裝置無法搜尋到我們的應用。

經調查:我們的應用中並沒有使用到uses-feature標籤,那為什麼給出的提示會是“此應用只適用於具備相應功能的裝置”呢?

後來查了一下原因,在我們使用permission的時候,在需要某些硬體許可權的時候,其實已經隱含使用了uses-feature。

如下表:

Category This Permission... Implies This Feature Requirement
Bluetooth BLUETOOTH android.hardware.bluetooth

(See
Special handling for Bluetooth feature for details.)

BLUETOOTH_ADMIN android.hardware.bluetooth
Camera CAMERA android.hardware.camera and
android.hardware.camera.autofocus
Location ACCESS_MOCK_LOCATION android.hardware.location
ACCESS_LOCATION_EXTRA_COMMANDS android.hardware.location
INSTALL_LOCATION_PROVIDER android.hardware.location
ACCESS_COARSE_LOCATION android.hardware.location.network and
android.hardware.location
ACCESS_FINE_LOCATION android.hardware.location.gps and
android.hardware.location
Microphone RECORD_AUDIO android.hardware.microphone
Telephony CALL_PHONE android.hardware.telephony
CALL_PRIVILEGED android.hardware.telephony
MODIFY_PHONE_STATE android.hardware.telephony
PROCESS_OUTGOING_CALLS android.hardware.telephony
READ_SMS android.hardware.telephony
RECEIVE_SMS android.hardware.telephony
RECEIVE_MMS android.hardware.telephony
RECEIVE_WAP_PUSH android.hardware.telephony
SEND_SMS android.hardware.telephony
WRITE_APN_SETTINGS android.hardware.telephony
WRITE_SMS android.hardware.telephony
Wifi ACCESS_WIFI_STATE android.hardware.wifi
CHANGE_WIFI_STATE android.hardware.wifi
CHANGE_WIFI_MULTICAST_STATE android.hardware.wifi

 

這時我們又做了一下調查

我們的應用中有這樣一個feature,查看文檔後

 
  1. android.hardware.touchscreen 

注釋為:

 
  1. applications require the android.hardware.touchscreen feature by default 


可以修改:

 
  1. <uses-feature android:name="android.hardware.touchscreen" android:required="false" /> 

這樣我們就找到了問題的解決方案,即


 
  1. <uses-feature android:name="string" android:required="false" /> 

這樣就不會要求裝置必須具有該硬體裝置,這樣我們的應用程式就可以被更多的手機適配了。

本文出自 “雨軒印象” 部落格,請務必保留此出處http://zilla.blog.51cto.com/3095640/799727

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.