• In-App Monetization
  • Product and Technology

InMobi to the rescue: Optimizing Android Apps for Tablets

Mohan Narayanaswamy
5 min read
Posted on May 14, 2013

In our earlier blog post , we talked about 3 mistakes developers commonly make. Ad monetization on tablets can potentially jump 3-4 times when these mistakes are eliminated or rectified. In this blog we focus more specifically on Android apps and a couple of tricks to optimize them for tablets. The fragmentation of devices on the Android platform across the of continuum form factors, resolutions and OS versions can make the task of selecting and requesting the right slot size seem fairly daunting. This is compounded by the fact that Android apps usually use the same APK to render advertisements both on smart phones and tablets. The key to picking the right ad slot to get maximum results on your app is in understanding the size of the device, its screen density and size available to render the ad slot in Density-independent pixels (dp)

. Click here to know more: Android documentation

Optimizing Android apps for tablets We have created a function that returns an optimal slot value when requesting for a banner ad from the Inmobi network. Any publisher who would like to request the optimal slot based on the screen dimensions, can use the code below.

public static Integer getOptimalSlotSize(Activity ctxt) { Display display = ((WindowManager) ctxt .getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); DisplayMetrics displayMetrics = new DisplayMetrics(); display.getMetrics(displayMetrics); double density = displayMetrics.density; double width = displayMetrics.widthPixels; double height = displayMetrics.heightPixels; int[][] maparray = { { IMAdView.INMOBI_AD_UNIT_728X90, 728, 90 }, { IMAdView.INMOBI_AD_UNIT_468X60, 468, 60 }, { IMAdView.INMOBI_AD_UNIT_320X50, 320, 50 } }; for (int i = 0; i < maparray.length; i++) { if (maparray[i][1] * density <= width && maparray[i][2] * density <= height) { return maparray[i][0]; } } return IMAdView.INMOBI_AD_UNIT_320X50; }

To initialize and use the above method, the publisher must call the method as below:

private IMAdView mInMobiBanner = new IMAdView(this, getOptimalSlotsize(this), inMobiAppId);


Our android app publishers who have made this change have seen fabulous results with a 3- 4x increase in CTR on tablets compared to when they were rendering ads of phone optimal sizes on tablets.

Note: All images in this blog have been engineered for the purpose of explaining the content of the blog. Any resemblance to a real app, active or inactive, is purely coincidental.

Stay Up to Date

Register to our blog updates newsletter to receive the latest content in your inbox.