Is it possible to block installing apps from apk file directly. How can do this using code, not by using some setting on the phone.
I just need to block installation of apps outside of the play store. That is stop the user from copying a apk file to the phone and install it. But still allow them to install apps through the Play Store.
This isn’t possible on AOSP Android.
The Install from unknown sources option is a setting in
Settings.Global(previously inSettings.Secure) and cannot be controlled by third party applications.However, it is possible do achieve this if you’re willing to modify and compile Android itself for each and every device you want to use this on, as is done by AT&T on some of their devices.