Android : create simulator without GPS hardware

蓝咒 提交于 2019-12-23 04:55:11

问题


As I got notification from google about the ACCESS_FINE_LOCATION permissions. As I understand if we don't add "android.hardware.location.gps" uses-feature to your manifest it will visible to non GPS hardware device also.

If I add that my application wont display to them and I don't want to do that.

I want to check that how app is reacting on device that not having GPS Hardware. How can I create simulator for this?

Actual message from Google Play Store

Action required: If your app requires GPS hardware to operate properly, you will need to explicitly add the "android.hardware.location.gps" uses-feature to your manifest.

What’s changing

We’re making a change on October 15th, 2016 that will affect apps targeting API version 21 (Android 5.0, Lollipop) or higher that use ACCESS_FINE_LOCATION but don't explicitly have the "android.hardware.location.gps" uses-feature. Going forward, these apps will be available to install on devices that don't have GPS hardware. In most cases this won't be an issue since Wi-Fi and Cell-ID based location provides high enough fidelity for the typical operation of these apps. However, any apps that require GPS hardware, such as GPS navigators, should explicitly add the "android.hardware.location.gps" uses-feature to their manifest.

If your app requires GPS to function properly and you do not include android.hardware.location.gps in your manifest declaration, your users may have a poor app experience.

Read More about this change here


回答1:


You can try this on the real device. For example, Lenovo A369i doesn't have GPS Hardware. If you don't have real device without GPS you can create corresponding virtual device. Go to Android Virtual Device Manager -> Create Virtual Device -> New Hardware Profile. There you can find GPS checkbox, so you should switch off it and you will create device without GPS.



来源:https://stackoverflow.com/questions/39609676/android-create-simulator-without-gps-hardware

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!