Force phonegap disconnect - extjs

I need to test the online and offline events written in my app. I'm testing the app through my browser so I'd like some code that simulates a disconnect from the internet in phonegap. As in forcing it to go offline then back online, client side. How can I do this?

Have you already tried use PhoneGap Emulation? There is a lot of features.
You can also test directly on device. Android logcat can receive the console.log of browser. I belive this works with xcode too.

Related

React UI does not make a request to an API on Android device but it does it in Linux

I am writing an app in React in order to make a beautiful UI for my API. When I run it in Arch Linux's Firefox it works well. However, when I run it in my Android device, it seems like the initial API call (inside the useEffect of the App.js) is not done, not in Firefox neither in Chrome.
I am serving the app in the computer and then opening it with my local IP address (not localhost, obviously) with my phone.
Does anyone know why isn't that working in the phone even though it is working in my Linux machine?
The source code (of the UI and of the API) is in my Github (https://github.com/ToniIvars/Localdrive).
Thank you in advance.
I suffer a similar problem recently, may relate to unreachable IP address or some security problem.
I recommend using the chrome remote debug tool to make everything clear, in short that's how to do that:
First, open your phone debug mode, connect it to the PC with adb debug enable
Open chrome on your phone
Open chrome on your PC, go to 'chrome://inspect#devices'
Wait for a second and you should see your device, click inspect on it
Soon you can find out what cause the problem
Here's a full tutorial: https://developer.chrome.com/docs/devtools/remote-debugging/

Background task on iOS

I plan to create a business app that runs on iOS and communicates with a webservice. The app is meant to be an online app, but when there is no internet connection, the user should still be able to register a notification locally and the app should send the notification automatically (without further user intervention) as soon as there is an internet connection again. This should also work when the user closes the app while he has no internet connection.
Is it possible to do this on iOS? (I know it works on Android with a service)
Does this need a special permission ?
Thanks
Check out this developer guide section, specifically the part about local notifications in iOS and Android.
Notice that services can work in native code but the local notifications are portable.

Cordova Console Log when Beta Testing

I am interested to know if there is any tool to track the js console log of multiple devices for both ios and android.
Basically I am about to beta test my new cordova/ionic/angular app with beta testers and since they are quite a few I want to be able to check the console log of each and every device to see how the app is performing.
If such a tool is not available fire away ideas or current possible approaches you would take?
Thanks
You can configure your own Google Analytics and send whatever you want in it.
https://support.google.com/analytics/answer/2709828?hl=en
For getting your messages:
https://docs.angularjs.org/api/ngMock/service/$log
https://coderwall.com/p/_zporq/logging-in-angular-apps-and-how-to-filter-those-log-messages

App don't work under IE 9

I deployed my app successfully on GAE (Java), and the thing works as expected under Chrome (and others) under MacOS X. Today at work I wanted to test my app on IE 9.0.8 / Vista, and the app won't load.
My app displays a "loading" message on the page until all objects of the UI are loaded. When I load the UI I also fetch some data using RPC. When the job gets done the loading message disapears and my app shows up.
As I don't see any error or Exception / nothing special in the app engine logs, how can I start to find the bug ?
The only difference I see is that, at work, my computer goes online trough many firewall and proxys, but as i can open the page and login it should not be a problem. But anyway, just after I login (using google accounts, not openID) the app "hangs". Ideas ?
You should start by inspecting network connections in IE9 to see if everything loads as expected. See also GWT tricks for IE9.
Try running your GWT app in dev mode, this way you should be able to see the client-side errors in the GWT console. Client-side error messages are not displayed in Web mode, unless you implemented code to handle them.

WP7 Emulator and Fiddler

I know there are a LOT of blog posts on this. But I can't seem to find an answer. I'm trying to debug an application that communicates with some services I have running locally. Right now, I have two services. One of them works. One of them does not. Both are running in http://localhost:90. To help me resolve this, I turned to Fiddler.
Oddly, Fiddler shows traffic in Internet Explorer in the emulator, but it does not show traffic from my application. With my application running, I launch Fiddler and nothing appears. I do not see any traffic. I have been able to confirm that I am successfully accessing the one service. However, no traffic appears in Fiddler. To see if Http traffic is running, I exited my Silverlight application and started Internet Explorer on the emulator. When I visit websites in IE on the emulator, I see traffic being written to Fiddler.
I'm totally confused. What am I doing wrong?
You need to actually configure Fiddler to be able to access localhost. Here is a workaround that needs to be done in the application.
Basically, what you need is the extra dot when accessing the location. So in your case it will be:
http://localhost.:90
Also, you might want to try some additional config settings.

Resources