I am implementing an android application which checks whether an installed application can show ads or not. What is the safest way to achieve this? Thanks in advance.
Asked
Active
Viewed 804 times
0
-
There is no guaranteed way to do that. After all, an ad is text or an image, and pretty much every app shows text and/or images. – CommonsWare Jul 17 '19 at 13:13
-
yes but there must some way to check if app uses adsense or admob, etc – Amin Pinjari Jul 17 '19 at 13:20
2 Answers
2
Get All Applicaitons that are installed.
final PackageManager pm = getPackageManager();
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
Check The Appstore using the app id to check if it has ads
Home Page For Apps: https://play.google.com/store/apps?hl=en
App Page: https://play.google.com/store/apps/details?id=com.bandainamcogames.dbzdokkanww&hl=en
just replace the id's value of com.bandainamcogames.dbzdokkanww
with the app package from the packages list
then check the page for "Contains Ads"
Refs:

Dean Van Greunen
- 5,060
- 2
- 14
- 28
-1
An ad is an element from the Web. Every element loaded from the web is essentially a HTTP request. You could implement in your application some mechanism to check the HTTP requests generated in real time by other applications and block them.

Aimery
- 1,559
- 1
- 19
- 24