Sunday, September 29, 2013

android phonegap developer log

1.add one ad in phonegap in android

FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(

params.gravity = Gravity.BOTTOM;

LinearLayout layout = super.root;
layout.addView(new AdView(this, AdSize.BANNER, AdMob_Ad_Unit),params);

see here:PhoneGap-Android-Native-AdMob

2.add one splashscreen in phonegap

when java onCreate

super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/index.html", 10000);

when javascript hide splashscreen:


see here: Splashscreen startActivity in phonegap

Intent intent = new Intent();
intent.setClassName(packageName, className);

check has app:

public static Boolean hasApp(String packageName, String className) {
Boolean f = false;
try {
if ((null != className) && (className.length() > 0)) {
if (null != PkrssActivity.s_pkrss.getPackageManager().getPackageInfo(packageName, 0))
f = true;
return f;

try {
PackageInfo pi = PkrssActivity.s_pkrss.getPackageManager().getPackageInfo(packageName, 0);

Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null);

List<ResolveInfo> apps = PkrssActivity.s_pkrss.getPackageManager().queryIntentActivities(resolveIntent, 0);

ResolveInfo ri = apps.iterator().next();
if (ri != null) {
if ( == className)
return true;
} catch (Exception e) {
} catch (Exception e) {

return f;

1 comment:

java development company said...

Heya i'm just initially the following. I stumbled upon the following aboard i find It really useful & this solved the problem outside a great deal. I'm hoping to offer anything just as before in addition to support other folks as if you made it easier for me.