티스토리 뷰

모바일/Android

PhoneGap splash screen

공허공자 2011. 12. 20. 16:04

*
For the splash screen, it is kinda documented, but not at PhoneGap, rather on Android's docs, which makes sense.

Do not take this for gospel truth, but it worked for me: Make your image, then drop it in res/drawable-*. Ie, a copy in each. I believe you are supposed to use different DPIs, but I didn't bother. Then, in your main activity Java file, do something like so:


public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setIntegerProperty("splashscreen", R.drawable.splash);
    super.loadUrl("file:///android_asset/www/index.html",700);
}

The 700 is the # of milliseconds to let the splash screen wait around. 

*
You can use Dreamweaver CS5.5 with PhoneGap to do this by simply setting up the splash screen on: Site> Mobile Application > Application Setting. No coding required. You will only have to create a nice looking splash screen design in PNG format.
댓글