Android - Using Reflection for Admob Libraries -


how can use reflection admob libraries code compile , run if admob jar not included?

try{             class arcls = class.forname("com.google.ads.adrequest");             constructor ct = arcls.getconstructor(new class[0]);             object adrequest = ct.newinstance();                         class avcls = class.forname("com.google.ads.adview");              //testmode     method methtestmode = arcls.getmethod("settesting", new class[]{boolean.type});      methtestmode.invoke(adrequest, new object[]{new boolean(true)});                      //end testmode      method methloadad = avcls.getmethod("loadad", new class[]{arcls});             object adview = act.findviewbyid(r.id.adview);                        methloadad.invoke(adview, new object[]{adrequest});           }catch (exception e){} 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -