Reputation: 1
I am building an APK website similar to APKPure.com. The APKs will be served from my CDN. Is there a way to check if the device downloading the APK has 'Unknown Sources' enabled? Are there better methods to do this? I'd like to minimize friction from website visit to install.
Thanks.
Upvotes: 0
Views: 1430
Reputation: 1866
Through your browser, you can't. If you access your website through an Android app, you can do the following:
boolean isNonPlayAppAllowed = Settings.Secure.getInt(getContentResolver(), Settings.Secure.INSTALL_NON_MARKET_APPS) == 1;
(Source: https://stackoverflow.com/a/16675266/3673616)
http://yoursite.com/somefile.apk/?unknown=true
This is the only way I can think of - however, it is definitely not possible simply through the browser.
Upvotes: 1