Detecting connection on Windows Phone 8 with Sencha+PhoneGap - windows-phone-8

I'm trying to detect whether a connection is available on my Sencha Touch+PhoneGap app that's running on Windows Phone 8. Problem is, any check I make (using both Ext.device.Connection.isOnline() from Sencha and navigator.network.connection from PhoneGap) results in the state of the connection when the app was launched. I do have ID_CAP_NETWORKING checked on WMAppManifest.xml, by the way.
So if I launched the app while there was no connection, Ext.device.Connection.isOnline() and navigator.network.connection will both always say that there is no connection, even if I get a connection while the app is running. If I launched the app while there was a connection, even if I lose the connection the calls will always say that there is a connection.
I have a hack for this (using simple ajax calls and seeing if they fail), but it's definitely not a great solution. Has anyone else encountered this problem? I have limited understanding of this part of mobile development and really don't even know where to start.

Related

Remote Debugging won't connect

I sort of make shift followed this guide on how to setup remote debugging. Since I am using Adobe Animate to compile my app I assume it has done the majority of the build steps already as I get a similar screen described.
I don't understand though. Here I have port forwarding up on my router so that it goes to my PC. I have TCP port 7935 up and open. Windows firewall on or off doesn't seem to make difference. Windows firewall even prompted me to allow or deny fdb after I ran it. I can't get my phone to connect via remote debugging. I want to be able to send this to my client who is having issue with the app so I can see what's going on under the hood instead of relying on a giant sum of try/catch statements and screenshots. Any help?
I tried a dummy domain and it seems to know that it can't connect to it. When I try mine or my IPv4 it doesn't let me connect. It just freezes up the app.
I don't know whether it works or not in Animate CC, but it works via Flash Builder. I'm using Android real device and I have Android SDK tools installed on my PC
Yes, I have followed that tuts from official Adobe docs, but that doesn't work
First: Simply connect your device to your PC
Actually , you can debug your app remotely as long as your device has been connected with your PC. This step, doesn't necessarily requires FDB.
In my case , all I need was things like
adb connect 192.168.xx.xx:port
this will connect your Android device with your PC on your default network .
Second, set debug setting over network
You've done it in Animate CC, with addition you might want to check "install application on the connected device'
Third, just debug as usual
You can get all those debugging stuff including traces

nc.call() closes the netconnection

i have made a flash chat application on Flash Builder 4.6 which connects to Flash Media (Development) Server on my centos5 32bit server, the problem is when i leave it open in browser about 2 minutes idle, then trying to call the netconnection to get the chat history or to send a public message or to invoke a function at the serverside with the nc.call() method, it suddenly says netconnection.connect.closed.. UNLESS i call, it doesnt gives me a connenction.closed event..
while this happening, i am looking at the fms admin console for active users, but the client doesnt drop and seems still connected to server..even i close the browser, client is still there in the fms console.. (normally, when i close the browser or when i use the nc.close() the client disconnects and i see the quick change in the fms admin console..
then still watching the fms admin console, after about 10 minutes the client drops..(it is normal i think)
i tried the same app with the connection to localhost, it works very well, i left the app open for a very long time idle, and then tried the nc.call() it worked fine.. but when i try the app on the my server, i had the problem.. i tried both fms 3.5 and 4.0.3 on my server but i had the problem too.. but on localhost it works so i think the problem is not about versions it is about something different with the connection to the server..
also the pepper flash player is disabled..and the problem is not about the autocloseidleclients property in the server.xml, application.xml vhost.xml config files. the problem is something different with the connection may be about firewall, tcp, router etc.. i dont know but i really need help..
thanks for reading..
Hm, if NetConnection works using sockets, then as far as I know, on Windows, the only way you can determine if a socket is closed is to try and write something to it; if it fails, then it's been closed - hence call() actually closing the connection after it's been idle for too long.
When you close the browser or call nc.close(), it's a specific request - normally on the server you'd also implement something like "if I haven't received anything in X seconds, disconnect the socket", which would trigger a callback on the client end.
I'd implement a sort of keep-alive; every 15/30 seconds, send a simple ping to the server, which will keep your connection open.

Windows phone 8 init failure with IBM Worklight

I have a strange behaviour in my Windows phone 8 application based on Worklight.
it works locally but when I deploy it in the production environment sometimes it works and sometimes not. Obviously, the behaviour I have is that the app init success in the first launch, it doesn't work in the seconde launch, it works in the third launch, doesn't work in the forth launch ... one by one.
the difference between the development environment and the production environment is that the first one is running over HTTP and the seconde one is running ever HTTPS.
Notice that it works in the other environments (Android, iOS, BlackBerry)
Any help?
I figured out how to fix the problem.
So to explain, here, what I did:
Before calling WL.client.init, I added a procedure call first (It's like a fake call) and then I initialized the WL Client.
Obviously, It fixed my problem. I think calling a procedure does initialize the connection between the client and the server.
So when the client call WL.Client.init or WL.Client.connect, succeeds to reach the server cause the connection is already initialized.

Application Error: Application Launch was not detected for application App

When I was validation my Windows Store App I got the following error:
Application Error: Application Launch was not detected for application
App. This could be because your application failed to launch
correctly. Please consider re-running the test and avoid interacting
with the application while tests are running.
What does this mean? The app will not validate.
I thought it was a bit weird and I couldn't find anything when I googled it but people who had almost the same problem as me, though rather than launching it was failing to sleep. This was just plain odd.
I tried to launch the app from Visual Studio 2012 just to prove to myself that it did start properly and for some crazy reason it didn't work. I usually test the game on my Local Machine rather than the Simulator but now, for some reason, it was set to the Simulator and I have been having problems getting it to start lately (the simulator).
I changed it back to the local machine and ran the tests again. This time it worked.
So, if you get this error it might be time to see if your simulator works and if not, have the Local Machine set as default to run with.

IIS 7.0 ASP.Net 3.5 Application fails when multiple users log on

I have an ASP.Net 3.5 Application hosted on Windows Server 2008 machine using IIS 7. There is a seperate application pool for this application.
The problem I have is that as soon as 2-3 users access website simultaneously, it starts throwing exceptions on almost any task performed say e.g. an exception during logging in the user using built in aspnet_membership. The same things work fine when there is only one user using it.
Any suggestions what things I need to test for?
Thanks,
Ali
I had some problem like this for some web-application, but in my case I was using IIS 6.0. After analyzing the application by means of some DevPartner tools for analyzing memory usage we realize that some components were consuming excessive resources, by replacing the toolkit we were using for simple .Net controls the applications stop crashing. Most of the crashes are due to problems in code. Also check the web config in the following points: sessionState, authentication. Disable custom errors (customErrors) to view the error details. See the application event's log to check the error description.
The first thing I do when setting up a website of this nature is to uncouple the session state from InProc to StateServer. Oftentimes I find that an application recycle or even an application level exception can cause the w3wp.exe process to crash and reload which dumps session errors. As with #Arce Brito's recommendation, you should do everything you can to find the root cause of the exception as decoupling the session will really only mask the symptom.