ericburnley
unread,Oct 6, 2011, 12:36:07 PM10/6/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to phonegap
I know the Connection API has had some work done in 1.1.0 for Android,
and it's definitely working better. But I'm still having an issue
with it running right away upon page load. I've used the example code
from the Connection API page (checkConnection()).
I'm seeing different behavior between the emulator (2.3.3) and my
phone (Droid Incredible, 2.3.4):
Emulator behavior: Page loads, checkConnection() is fired, returns
Cell 3G. Things work.
Phone behavior: Page starts loading, PG/DOM loads, hits
checkConnection() function and chokes on the following line: var
networkState = navigator.network.connection.type; If I hit my
refresh button (my own button, which calls the same Load function with
the checkConnection function in it first), it runs through the
navigator.network.connection.type line and I get an alert that is
placed inside that function, but the networkState returned is
undefined. If I hit the back button (this is a multi-page app), and
then come back in and refresh, things work fine and I receive the Cell
3G connection.
I'm using deviceready to trigger the initial Load function call, which
calls the checkConnection function. I've switched some things around
recently to try and get the connection checking in place, so I realize
I may just have a stupid mistake someplace, but I *think* I've gone
over this enough to have ruled that out.
Just wondering if anyone's seen anything related to Connection API on
Android 2.3.4 or if there are any ideas.