diff --git a/code/boot.js b/code/boot.js index 683e36f4..69bd6f23 100644 --- a/code/boot.js +++ b/code/boot.js @@ -506,8 +506,8 @@ function boot() { window.iitcLoaded = true; window.runHooks('iitcLoaded'); - if (typeof android !== 'undefined' && android && android.iitcLoaded) { - android.iitcLoaded(); + if (typeof android !== 'undefined' && android && android.removeSplashScreen) { + android.removeSplashScreen(); } } diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index f44e7286..7c4be5bd 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="35" + android:versionName="0.5.4"> { + + private IITC_JSInterface mJsInterface; + + public CheckHttpResponse(IITC_JSInterface jsInterface) { + mJsInterface = jsInterface; + }; + + @Override + protected Void doInBackground(String... urls) { + // check http responses and disable splash screen on error + HttpGet httpRequest = new HttpGet(urls[0]); + HttpClient httpclient = new DefaultHttpClient(); + HttpResponse response = null; + try { + response = httpclient.execute(httpRequest); + int code = response.getStatusLine().getStatusCode(); + if (code != HttpStatus.SC_OK) { + Log.d("iitcm", "received error code: " + code); + mJsInterface.removeSplashScreen(); + } + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + +}