Search code examples
androidcordovasencha-touchnine-patch

9-patch image stops app to work in Android


I have created a 9-patch image (splash.9.png) for my splash screen. The issue is, whenever I use this splash image, the app doesn't go past the splash screen. However, using a non-9patch image makes the app work. The same 9-patch image without that .9 extension also makes the app work. What is possibly wrong??

Code:

public class NafapplicationActivity extends DroidGap {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setIntegerProperty("splashscreen", R.drawable.splash);
        super.loadUrl("file:///android_asset/www/index.html"); 
    }
}

index.html :

<!DOCTYPE html>
<!--<html  manifest="naf.manifest">-->
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Naf</title>
        <script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
    </head>
    <body>
        Hello World!!
    </body>
</html>

Solution

  • Official Rep from PhoneGap says, in response to the question "Does PhoneGap Build support the use of 9-patch images":

    The only platform that seems to support them is Android. Since we strive for cross platform currently it seems to be a bit of a toss up. However it is something we may look into further down the road.

    Taken from: http://community.phonegap.com/nitobi/topics/does_phonegap_build_support_the_use_of_9_patch_images

    So, to answer your question: Your splash doesn't work when it is a .9.png because PhoneGap doesn't, and may never, support 9-patch images because Android is the only major Platform to support them and PhoneGap is a Cross-Platform Framework.

    Hope that helps!