How to stop sideloading a tablet only app on a handset in Android

拥有回忆 提交于 2019-12-25 01:35:06

问题


How can I stop the user from sideloading a tablet only application on a phone?


回答1:


There are no mechanisms in the core Android OS to disable the ability to install an application based on the manifest filtration data for features like screen size, these values are only used by Google Play to determine which apps to show on which device. If a user somehow gets ahold of your APK through back channels, you cannot stop them from installing it.

However, after the application is installed, you can make use of technologies like the License Verification Library (LVL) to keep applications that have been improperly installed (i.e. not through Google Play) from being used.




回答2:


You want to declare the following in the manifest: (source)

<supports-screens android:smallScreens="false"
                  android:normalScreens="false"
                  android:largeScreens="false"
                  android:xlargeScreens="true"/>

Beyond that, just make sure the app is licensed.



来源:https://stackoverflow.com/questions/13771343/how-to-stop-sideloading-a-tablet-only-app-on-a-handset-in-android

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