online- and offline-event capture (HTML5) and phonegap

245 views
Skip to first unread message

TK

unread,
Jun 29, 2011, 3:59:29 AM6/29/11
to phonegap
hey guys

im still writing on my app for iphone 4.x and android 2.3.x and i got
new issues.
im trying to use the on-/offline-event of html5 for knowing when the
network connection is available.

im using this test, to see if its working on the devices:
http://html5demos.com/offline-events

if im testing it directly in the browser windows it works on both
devices.
but at the moment im making native apps, nothing happens..

if you want to see the code im using, u can find it here:
http://nopaste.info/1b815cd0ad.html

edit:
ive tested the phonegap method for that too, but with the native
iphone app, it isnt working:
http://docs.phonegap.com/phonegap_connection_connection.md.html#connection.type

thanks in advance..
regards

edit:
maybe somebody knows a solution for the orientationchange-issue with
native iphone apps?
https://groups.google.com/group/phonegap/browse_thread/thread/6bad835fdd86ba35/94c0bc463c93425c

Shazron Abdullah

unread,
Jun 29, 2011, 4:22:37 AM6/29/11
to phon...@googlegroups.com
What version of PhoneGap?
You'll have to wait for the deviceready event before using any PhoneGap functions, doesn't look like you are in your code.

http://docs.phonegap.com/phonegap_events_events.md.html#deviceready

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

TK

unread,
Jun 30, 2011, 12:26:07 PM6/30/11
to phonegap
thank you very much for your answer.
im using phonegap.0.9.5.1.min.js

ive used this index.html: http://nopaste.info/6d1ad6f239.html

my testing devices are:
android 2.3.3
ipod touch 2g (4.2.1)

ive tested it in both browsers as website and as native apps.
on the android device nothing happens, with both methods.
on ipod touch it works when im using the native app, but it always
just says: "unknown connection". doesnt matter if im using wlan, umts
or no internet connection.

On 29 Jun., 10:22, Shazron Abdullah <shazron.abdul...@nitobi.com>
wrote:
> What version of PhoneGap?
> You'll have to wait for the deviceready event before using any PhoneGap functions, doesn't look like you are in your code.
>
> http://docs.phonegap.com/phonegap_events_events.md.html#deviceready
>
> On 2011-06-29, at 12:59 AM, TK wrote:
>
>
>
>
>
>
>
> > hey guys
>
> > im still writing on my app for iphone 4.x and android 2.3.x and i got
> > new issues.
> > im trying to use the on-/offline-event of html5 for knowing when the
> > network connection is available.
>
> > im using this test, to see if its working on the devices:
> >http://html5demos.com/offline-events
>
> > if im testing it directly in the browser windows it works on both
> > devices.
> > but at the moment im making native apps, nothing happens..
>
> > if you want to see the code im using, u can find it here:
> >http://nopaste.info/1b815cd0ad.html
>
> > edit:
> > ive tested the phonegap method for that too, but with the native
> > iphone app, it isnt working:
> >http://docs.phonegap.com/phonegap_connection_connection.md.html#conne...
>
> > thanks in advance..
> > regards
>
> > edit:
> > maybe somebody knows a solution for the orientationchange-issue with
> > native iphone apps?
> >https://groups.google.com/group/phonegap/browse_thread/thread/6bad835...

Simon MacDonald

unread,
Jun 30, 2011, 12:38:44 PM6/30/11
to phon...@googlegroups.com
That's because the functionality didn't get introduced until 0.9.6.
Update your version of PhoneGap and give it another go.

Simon Mac Donald
http://hi.im/simonmacdonald

TK

unread,
Jul 5, 2011, 10:58:20 AM7/5/11
to phonegap
Thank you very much, ill test it in a few days. i also started a new
thread on phonegap build forum.

On 30 Jun., 18:38, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> That's because the functionality didn't get introduced until 0.9.6.
> Update your version of PhoneGap and give it another go.
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald
Reply all
Reply to author
Forward
0 new messages