I am facing one typical issue where our application(built with cordova 3.4.0) working for all versions from 2.3.x to 4.4.x however on following device because of splash screen plugin the app is not able to load
Samsung Android SGH-1747M
Version 4.1.1
When we remove splash plugin it works fine.
Issue : We have a splash screen open for 30 seconds before we redirect user to our login page (load from server side)
If we add splash plugin it doesn't load the login page it shows half black and half white screen forever, but if i remove splash screen plugin it works.For all other versions app working fine with splash screen plugin.
Thanks in advance for your help.
Since its 4.1.1 i am not able to get stack trace or logging statements on aLogcat , but below is the onCreate method that we have
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (appView == null) {
init();
}
appView.setWebChromeClient(new CordovaChromeClient(this, appView));
String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
appView.getSettings().setAllowFileAccess(true);
super.loadUrl(getString(R.string.app_url), 30000);
}
and using the same cordova pluing for splash screen as standard one (cordova version 3.4.0)
<preference
name="SplashScreen"
value="splash"/>
Related
I've a really weird behavior with the App widget:
I've a home screen widget with a ListView showing data from internet.
It's working fine with no problem at all on the debug version,
but when I install release:
when I drag the widget to the home screen it shows "problem loading widget" and in the Logcat:
E/ResourcesManager: failed to add asset path /data/app/com.askelp.askelp-u7QWKA4gT6KmeGou17fWHw==/base.apk
E/RemoteViews: Package name com.askelp.askelp not found
BUT if I left it in the home screen and reinstalled the app it works then, and if I removed the widget from the home screen and reinstalled it again and dragged it again to the home screen it shows the same error and "problem loading widget"
Anyone has any idea?
EDIT:
I tried now to run it on my phone it's working, so it's working on my phone but not working in the emulator!
Solution1 :
Have you try to invalidate cache/restart?
Solution 2:
From the Documentation Link , You can only use this as widgets
A RemoteViews object (and, consequently, an App Widget) can support the following layout classes:
*FrameLayout
*LinearLayout
*RelativeLayout
*GridLayout
And the following widget classes:
*AnalogClock
*Button
*Chronometer
*ImageButton
*ImageView
*ProgressBar
*TextView
*ViewFlipper
*ListView
*GridView
*StackView
*AdapterViewFlipper
I'm having issue of missing signout button from the header toolbar in android devices. In simulator and apple device I do see the signout button but not on android tablet/phone. This wasn't the case before 3-4 days. Is there any change in the android build server that causing this issue. This is happening when more than one control in the toolbar. if the toolbar has one control to the right then it displays without any issue. Please let me know if anyone else have same issue.
Android Simulator Screenshot
Android Tablet Screenshot
public static void addSignout(Form f) {
f.getToolbar().addMaterialCommandToRightBar("", FontImage.MATERIAL_LOCK, 6.5f, e -> {
Server.instance.logout();
new LoginForm().show();
});
}
I have created a small game and created build using Intel XDK. I installed it in device and can see the splash screen. I tried what is mentioned in other topics but unable to remove the splash screen.
function onDeviceReady(){
if( navigator.splashscreen && navigator.splashscreen.hide ) {
navigator.splashscreen.hide();
}
if( window.intel && intel.xdk && intel.xdk.device ) {
if( intel.xdk.device.hideSplashScreen ) {
intel.xdk.device.hideSplashScreen();
}
intel.xdk.device.setRotateOrientation("landscape");
intel.xdk.device.setAutoRotate(false);
intel.xdk.device.hideStatusBar();
}
}
document.addEventListener("intel.xdk.device.ready", onDeviceReady, false);
This is how it looks initially when I launch the app.
I have this plugin added in the project
cordova-plugin-splashscreen
Please help me resolve this issue.
Received this answer on XDK forum
The purpose of the splashscreen is to hide the details of the
initialization process (even before your device ready fires). The
splashscreen you see is the default cordova splash screen, you can
replace it by your own graphics. You can upload custom splashscreen
through Launch Icons and Splash screens on Projects page. The
hidesplashscreen() method will hide the splashscreen that is displayed
at the initialization and the contents of your app will appear (which
happens when device is ready).
I'm using IBM Worklight 6.1 for my mobile app project. My question is how to reduce splash screen duration around 1 second. I and my colleague already try many solutions from stackoverflow regarding to this issue.
IBM Worklight 5.0.6 - How to add a splash screen to Android environment? - stay on splash screen
phonegap - splash screen for Android app - not working
Worklight App Splash Screen on Android - blank screen
Until now the splash screen takes a lot around 10 seconds. We test it on Samsung Note 2 and compile it using eclipse Juno.
This is our source code for splash screen.
package com.WorklightMobile;
import android.os.Bundle;
import com.worklight.androidgap.WLDroidGap;
public class WorklightMobile extends WLDroidGap {
#Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
}
/**
* onWLInitCompleted is called when the Worklight runtime framework initialization is complete
*/
#Override
public void onWLInitCompleted(Bundle savedInstanceState){
super.loadUrl(getWebMainFilePath(), 1000);
// Add custom initialization code after this line
}
}
Check this out my repo - https://github.com/datomnurdin/worklight-mobile
You cannot.
The current mechanism in Worklight 6.1.0 is remove the splash image on EnvInit.
What you can try to do is to remove the splash image Worklight uses (native\res\drawable\splash.9.png) and implement your own splash mechanism.
I have an iOS/Android app built on cordova 2.6 and jqm 1.3. I need to open a link to an external website after the user clicks on a button. The code I am using is:
var ref = window.open('http://google.com','_self','location=yes');
ref.addEventListener('loadstart',function(event) {
console.log('load started');
});
ref.addEventListener('loadstop',function(event) {
console.log('load stopped');
});
ref.addEventListener('loaderror',function(event) {
console.log('load error = ' + JSON.stringify(event));
});
On iOS everything performs like I would expect. A new browser window opens with the google website loaded. But I cannot get anything to to load in Android. When I click on the button, nothing happens. I have put in console statements before and after the window.open, so I know the code is at least being executed.
My config.xml should be wide open for white listed sites:
<access origin=".*"/>;
I have tested on a Nexus 7 (android 4.2) and an android 2.2 emulator with the same results on both.
Does anyone know why window.open would not be firing correctly on android?
It looked like it was a problem with 2.6 loading plugins on Android. I upgraded to 2.7 and everything started to work.
Perhaps it's a solution to use the ChildBrowser plugin? This gives you a bit more control over the operation itself, while still preserving platform compatibility between iOS and Android.
In most cases, I use something like the following snippet to use the childbrowser to display an external page.
function openBrowser(url) {
// determine if the childbrowser plugin is available
var useChildBrowser = ('plugins' in window && window.plugins.childBrowser);
if (useChildBrowser) {
popup = window.plugins.childBrowser;
popup.showWebPage(url, { showLocationBar: false, showAddress: false });
} else {
popup = window.open(url, 'Share', "['width=600px', 'height=400px', 'resizable=0', 'fullscreen=yes']");
}
}
Note that this falls back to using window.open if the ChildBrowser plugin isn't available, so you won't break anything else with this. Could be worth a shot, perhaps?