0

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.

Amin Pinjari
  • 2,129
  • 3
  • 25
  • 53

2 Answers2

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" enter image description here

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