At very first launch of my app from the home screen, everything works fine - no freezing.
When I use the app at a later time, suddenly when I tap it from the home screen, sometimes it will freeze for 5 seconds (i.e. just stays on the home screen), and then it loads. This isn't the end of the story.
The app doesn't freeze every time after the first load; however, once it starts freezing from the home screen, it it will continue to do this until I Force Stop the app.
After it freezes like this, some Phonegap functionality doesn't work. For example, navigator.notification.alert fades the background, but no popup appears. The only way to exit is to tap the phone's back button.
How can I stop the app from freezing at opening, thereby causing other Phonegap functionality to stop working properly?
(This is Phonegap 2.9.0; however, I had the same issues 2.5.0)
All help is appreciated, thank you
Adding
super.setBooleanProperty("keepRunning", false);
right before super.loadUrl in your main .java-file worked for me.
In the meantime, due to many (!) hours of debugging, my app has an overload on "possible bug fixes". I think the code above is the real fix, but here are some other changes I made:
Added to main .java-file (before super.loadUrl):
super.setIntegerProperty("loadUrlTimeoutValue", 60000);
Added to the android manifest (in the application tag):
android:clearTaskOnLaunch="true"
Edit:
Also, try using these settings in your android manifest:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />
Related
Chrome apparently stops updating a page when you go idle (i.e. when the screen saver comes up).
My problem is I've written an alarm app, and it doesn't work because the Javascript stops running when the computer goes idle. Is there any way around this?
Update: After testing a few different things, it seems that Chrome doesn't stop updating a page, it just stops rendering it. So for my problem (an alarm app), this is solved.
Are you using requestAnimationFrame? I know Chrome explicitly pauses those callbacks, but it may not also pause setTimeout.
I'm getting a trouble while running JS code in a browser.
I've got a small web page which uses HTML5 location API for tracking a user.
User opens my website, logs in, and goes to a certain page on which I'm using location API to track user's location. Everything works fine until user's phone goes to sleep or user presses "home" button to minimize browser. The same thing happens on both Android and iPhone.
Is there any way to prevent the phone from going to sleep and let JS code work while browser is minimized?
one of the way I found is using video on a page where all JS located. but another problem is - screen became always ON, which can cause battery to discharge too fast (if I turn off screen manually using power button everything stops working)..
still looking for some ideas...
The web app is powered with require.js, jquery, underscorejs, signalR. MVVM with knockoutjs.
Working within one tab is fine. Trying to open a part of application in new tab, does not work. Looking in safari web inspector displays that different scripts / css are endless loading. If I switch back to first opened tab it still works fine and can be reloaded. If i close the first tab, the second is loaded then fine (without reloading, seems like it waits for something in the first tab).
Thank you for any help.
Edit:
I found that the reason is SignalR - after disabling it the second tabs works well. This is strange, because the ipad limit is 5 concurrent connections, and signalR keeps one open.
Any ideas ? SignalR is 1.1.2
Found the reason: IOS Safari is limited to one active connection per server, that causes second tab to wait until first is closed.
Using long pooling fixed the issue:
$.connection.hub.start({ transport: 'longPolling' });
My page is hanging up with a blank/white screen until I touch it. The problem goes away when I comment out the following line:
<script type='text/javascript' src='https://static-na.payments-amazon.com/OffAmazonPayments/us/sandbox/js/Widgets.js?sellerId=ANQ73XOZ7PBIK'></script>
I am able to display an alert box both before and after the above line of code. Also, the problem goes away as soon as I re-load the app! It's only the first time the app is run that I have a problem.
My page uses PhoneGap and jQuery Mobile. I have tried moving the above line of code to before/after the PhoneGap/jQuery stuff. No difference.
Thank you for your help :)
P.S. I have also seen this problem occur off and on when loading my page within Android's regular browser. So I'm thinking it's more than a PhoneGap issue.
P.S.S Here is the page link https://www.mytrafficman.net/app/android/
Oftentimes my app will hang on the "trigger.io FORGE" splash screen and never display my UI.
I have this happening both in the simulator and on a real device. It's intermittent which leads me to think maybe it's a race condition somewhere (do I need to be waiting for forge to initialize?).
I have no idea how to debug this as the trigger console isn't spitting out an error even when showing the debug output.
Anything I should check? It's weird because if I put in a call like this:
setInterval(function() {
forge.logging.log('hi');
}, 1000);`
I can see that my JavaScript code is being executed (and continues to execute as this is successfully logged until I kill the app).. but it's still hung on the splash screen. Oftentimes hitting the home button and re-entering the app will work. But sometimes it takes a few rebuilds before it will get past the splash screen.
I've now seen this on 2 different dev environments, 2 different physical devices, and the iOS simulator.
This sounds like a rare issue on iOS that causes the DOM event Forge listens for to hide the splash screen not to fire.
The easiest way to fix this is to make sure the splash screen is hidden by calling forge.launchimage.hide() at the point your code is ready. See http://docs.trigger.io/en/v1.4/modules/launchimage.html#hide for more details.
If that doesn't help then let us know and we can try to track down what else it could be.