I am using the Google Android Development Tools (Eclipse) with the Phonegap 2.9 plugin to build an Android app. I want to get my app to show a splash screen. I am trying to follow the instructions on the Phonegap documentation for splash screens.
Problem one: I edited app/res/xml/config.xml
accordingly. But, the instructions get vague at a point. It says:
Copy the splash screen image into the Android project's res/drawable directory.
However, it doesn't tell mew what to name the files, and is unclear how to implement them. What I do have are directories named drawable-mdpi
, drawable-ldpi
, drawable-hdpi
, and drawable-xhpdi
, I tried placing a splash.png
file with the right dimensions in each of them.
Problem 2: When I build the .APK
file, and test it on my phone, what I get is a default screen with a black bar at the top that contains the name of my app. This screen seems to be generated from a file called /res/layout/activity_main.xml
:
How do I remove this default layout and get my own splash screens to display?
Note: Based on information in this answer, have this code in my MainActivity.java
:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl(Config.getStartUrl(), 2000);
super.loadUrl("file:///android_asset/www/index.html");
adView = new AdView(this, AdSize.BANNER, AdMob_Ad_Unit);
LinearLayout layout = super.root;
layout.addView(adView);
AdRequest request = new AdRequest();
adView.loadAd(request);
}
Unfortunately, it has not changed anything.
Update: I'mnot sure exactly what has changed, but right now my splash screen does seem to show, but I'm still getting this default screen with the black bar at top flickering and appearing before my splash screen. How do I kill this screen from appearing?