Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid splash screen - Image from SD card?
    primarykey
    data
    text
    <p>I've been playing around with android and some phonegap code for the last week and through stumbling around, have been quite successful in my application creation.</p> <p>My app loads using a default splash screen and then calls out to various JSON feeds to download a local copy of all the data required. In doing this it also checks to see if there is an updated version of the splash screen image (Which is editable from a CMS website). If there is, then it downloads it and stores in on to the SD card. This works perfectly.</p> <p>The problem I then have is the next time the app is loaded I want to show the new splash screen. My code below checks to see if the newer one exists but I don't know the code to then replace the default with the new one :(</p> <p>My code so far is:</p> <pre><code>package com.interdirect.Harlequin; import java.io.File; import android.app.Activity; import android.os.Bundle; import android.os.Environment; import com.phonegap.*; public class App extends DroidGap { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String newFolder = "/Harlequin"; String extStorageDirectory = Environment.getExternalStorageDirectory().toString(); File appDirectory = new File(extStorageDirectory + newFolder); appDirectory.mkdirs(); File f = new File(extStorageDirectory + newFolder + "/Images/splash.jpg"); if (f.exists()){ //USE THE FILE ABOVE AS THE SPLASH }else{ super.setIntegerProperty("splashscreen", R.drawable.splash); } super.loadUrl("file:///android_asset/www/index.html",2000); }; }; </code></pre> <p>If anyone could help on the above it would awesome as I'm pulling my hair out on something I don't even know if possible :(</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload