Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 83354D04F for ; Tue, 13 Nov 2012 14:01:49 +0000 (UTC) Received: (qmail 54181 invoked by uid 500); 13 Nov 2012 14:01:49 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 53965 invoked by uid 500); 13 Nov 2012 14:01:44 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 53916 invoked by uid 99); 13 Nov 2012 14:01:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 14:01:42 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [15.201.24.19] (HELO g4t0016.houston.hp.com) (15.201.24.19) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 14:01:34 +0000 Received: from G4W3011G.americas.hpqcorp.net (g4w3011g.houston.hp.com [16.234.25.125]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by g4t0016.houston.hp.com (Postfix) with ESMTPS id B1C08146AE for ; Tue, 13 Nov 2012 14:01:11 +0000 (UTC) Received: from G9W0366G.americas.hpqcorp.net (16.216.193.230) by G4W3011G.americas.hpqcorp.net (16.234.25.125) with Microsoft SMTP Server (TLS) id 14.2.283.4; Tue, 13 Nov 2012 14:00:27 +0000 Received: from G9W0729.americas.hpqcorp.net ([169.254.9.36]) by G9W0366G.americas.hpqcorp.net ([16.216.193.230]) with mapi id 14.02.0283.004; Tue, 13 Nov 2012 14:00:25 +0000 From: "Leutwyler, Markus" To: "dev@cordova.apache.org" Subject: RE: online/offline Events Thread-Topic: online/offline Events Thread-Index: Ac289SueqHh7DupZTE6oejSYa4oLbwAAH8MAAABBX7AAAFA3gAAADxlwAAEJ8IABKp+/QA== Date: Tue, 13 Nov 2012 14:00:25 +0000 Message-ID: <7EC783583A3638449E13002CFE331D3A32D25E8C@G9W0729.americas.hpqcorp.net> References: <7EC783583A3638449E13002CFE331D3A32D2384B@G9W0729.americas.hpqcorp.net> <7EC783583A3638449E13002CFE331D3A32D23A76@G9W0729.americas.hpqcorp.net> <7EC783583A3638449E13002CFE331D3A32D23AA2@G9W0729.americas.hpqcorp.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.210.48.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org I'm able to successfully setup a webOS specific service call in the initia= lize() function in platform.js ... this will keep track of any connection c= hanges but fires multiple events in case Wifi is turned on (and not connect= ed to an AP) and then again if connected with an AP. I convert those events= to offline/online document events (via cordova.fireDocumentEvent). Is ther= e a way to add a global online/offline status/variable somewhere and only f= ire document events if there's an actual change from offline to online?=20 Markus -----Original Message----- From: agrieve@google.com [mailto:agrieve@google.com] On Behalf Of Andrew Gr= ieve Sent: Mittwoch, 7. November 2012 16:27 To: dev Subject: Re: online/offline Events Here's the Android impl: https://git-wip-us.apache.org/repos/asf?p=3Dincubator-cordova-android.git;a= =3Dblob;f=3Dframework/src/org/apache/cordova/NetworkManager.java;h=3D5d8791= 809227877d604c98cf029c26242d9642b8;hb=3DHEAD The JS performs a Connection.getConnectionInfo(), and then the native plugi= n returns the connection status but sets "keepCallback" to true. Then, when= ever the connection type changes, it sends another plugin result and always= sets keepCallback to true. On Wed, Nov 7, 2012 at 9:57 AM, Leutwyler, Markus wrote: > I saw that ... but how is that handled by the platform specific plugins? > > Markus > > -----Original Message----- > From: Simon MacDonald [mailto:simon.macdonald@gmail.com] > Sent: Mittwoch, 7. November 2012 15:56 > To: dev@cordova.apache.org > Subject: Re: online/offline Events > > lolz I didn't read what list this was on. The src for network.js is at: > > > https://git-wip-us.apache.org/repos/asf?p=3Dincubator-cordova-js.git;a=3D= b > lob;f=3Dlib/common/plugin/network.js;h=3Dadaba5ae8b6ec825986712d8b99e6601= 0 > 5e56ae9;hb=3DHEAD > > The way we have it setup is the native side sends the JS side an=20 > update whenever the network connection changes. If the type =3D=3D 'none'= =20 > then we fire an offline event. Otherwise you fire the online event. > > Simon Mac Donald > http://hi.im/simonmacdonald > > > On Wed, Nov 7, 2012 at 9:47 AM, Leutwyler, Markus > wrote: > > > I was actually looking for a code example (in cordova-js) of a=20 > > platform that sends out those events (because I'm investigating how=20 > > to add support for those to webOS) > > > > Markus > > > > -----Original Message----- > > From: Simon MacDonald [mailto:simon.macdonald@gmail.com] > > Sent: Mittwoch, 7. November 2012 15:39 > > To: dev@cordova.apache.org > > Subject: Re: online/offline Events > > > > http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#onli > > ne=20 > > http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#offl > > in > > e > > > > Simon Mac Donald > > http://hi.im/simonmacdonald > > > > > > On Wed, Nov 7, 2012 at 9:36 AM, Leutwyler, Markus > > wrote: > > > > > Is there a platform that sends out online/offline event to the=20 > > > document when the connection status changes? I didn't find any=20 > > > examples > > > > > > Thanks > > > > > > Markus > > > > > >