I had no reply from Mobfox, but somehow I solved the problem myself.
Yes, they COULD send banners smaller than the default size, but the rendering problem is present only on ICS phones with hardware acceleration enabled. A similar problem was present in AbMob 6.0.0 but has been fixed in 6.0.1.
To fix it, leaving the HW acceleration enabled at application level, put the AdMob's AdView in a container LinearLayout view, and set it with:
// disable hardware acceleration to avoid flashing white background bug // NOTE: this is no longer needed after AdMob 6.0.1 release, but still needed for MobFox Reflect.setLayerType(this, 1, null); // setLayerType(View.LAYER_TYPE_SOFTWARE, null); // set the background color to black, as MobFox does not always provide a full banner size, and // with HW acceleration enabled at application level the background will not be solid black setBackgroundColor(Color.BLACK);where
/** Wrapper class for methods which could not be supported */public class Reflect { // method View.setLayerType private static Method view_setLayerType; static { try { view_setLayerType = View.class.getMethod("setLayerType", int.class, Paint.class); } catch (NoSuchMethodException nsme) { /* failure, must be older device */ } }; public static void setLayerType(View v, int layerType, Paint paint) { // if unsupported operation just return if (view_setLayerType == null) return; try { view_setLayerType.invoke(v, Integer.valueOf(layerType), paint); } catch (Exception e) {} }}/Giuseppe
On Friday, July 13, 2012 8:56:31 PM UTC+2, Eric Leichtenschlag wrote:
Hey Gicci,
This issue seems to be related to the Mobfox SDK/adapter; it looks like they're not providing the 480x75 px version of the image when the screen density is 1.5. Both the SDK and adapter were written by MobFox, so I would recommend sending them an email at their support address (
sup...@mobfox.com) to ask for help on this issue.
Thanks,
Eric