You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Johnny Ray <jo...@johnnyray.me> on 2012/03/02 19:22:27 UTC

MAC Address and User Agent

Hi,  

I didn't see any messages come through here so per the wiki instructions I'd like to advocate for my two pull requests I made a couple hours ago:

https://github.com/apache/incubator-cordova-android/pull/9

https://github.com/apache/incubator-cordova-android/pull/10

Thanks, 

-- 
Johnny Ray
http://johnnyray.me/


Re: MAC Address and User Agent

Posted by Johnny Ray <jo...@johnnyray.me>.
Awesome. I'm still working to get the equivalent MAC functionality on the iOS side. Hopefully with the big two, I'll have a better chance of getting in the master branch. Also, I'll work to get the JS changes in the appropriate project. In terms of the core API change there looks to be a specification for the mac address of the current connection but my change returns all of the device's interfaces and their mac addresses. Any feedback on how to approach this would be great.

-- 
Johnny Ray
http://johnnyray.me/


On Friday, March 2, 2012 at 2:08 PM, Drew Walters wrote:

> I happened to briefly glance at your pull requests and thought I'd
> provide some comments which may be helpful for you and any others in
> the future. If you are aware of this already, then please ignore :-)
> 
> 1. The JS API is a separate project now and work is being done to use
> the common cordova-js layer across all platforms. The cordova.js file
> in the Android project was built from the cordova-js project and
> copied into the Android project for the 1.5 release. Development of
> JS API needs to occur in the cordova-js project though. For reference
> here is the github mirror and the Apache repo:
> 
> https://github.com/apache/incubator-cordova-js
> https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=summary
> 
> 2. Common API changes should have support for all platforms (or at
> least more then 1). We have some instances of platform specific API
> but we try to keep them at a minimum and they are done through
> platform overrides instead of in the common layer.
> 
> 3. We try to following specifications where they exist. I'm not sure
> if there is an active specification relating to MAC address (outdated
> one here: http://www.w3.org/TR/system-info-api/) but when there is not
> a spec we would need to discuss on this thread the proposed API and
> come to a collective agreement on it.
> 
> Also, looks like your pull request did send a note to the list so that
> functionality is working:
> 
> http://markmail.org/search/?q=johnny+ray&q=list%3Aorg.apache.incubator.callback-dev#query:johnny%20ray%20list%3Aorg.apache.incubator.callback-dev+page:1+mid:wczkzfspjdyyyu56+state:results
> 
> On Fri, Mar 2, 2012 at 12:22 PM, Johnny Ray <johnny@johnnyray.me (mailto:johnny@johnnyray.me)> wrote:
> > Hi,
> > 
> > I didn't see any messages come through here so per the wiki instructions I'd like to advocate for my two pull requests I made a couple hours ago:
> > 
> > https://github.com/apache/incubator-cordova-android/pull/9
> > 
> > https://github.com/apache/incubator-cordova-android/pull/10
> > 
> > Thanks,
> > 
> > --
> > Johnny Ray
> > http://johnnyray.me/
> > 
> 
> 
> 



Re: MAC Address and User Agent

Posted by Drew Walters <de...@gmail.com>.
I happened to briefly glance at your pull requests and thought I'd
provide some comments which may be helpful for you and any others in
the future.  If you are aware of this already, then please ignore :-)

1. The JS API is a separate project now and work is being done to use
the common cordova-js layer across all platforms.  The cordova.js file
in the Android project was built from the cordova-js project and
copied into the Android project for the 1.5 release.  Development of
JS API needs to occur in the cordova-js project though.  For reference
here is the github mirror and the Apache repo:

    https://github.com/apache/incubator-cordova-js
    https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=summary

2. Common API changes should have support for all platforms (or at
least more then 1).  We have some instances of platform specific API
but we try to keep them at a minimum and they are done through
platform overrides instead of in the common layer.

3. We try to following specifications where they exist.  I'm not sure
if there is an active specification relating to MAC address (outdated
one here: http://www.w3.org/TR/system-info-api/) but when there is not
a spec we would need to discuss on this thread the proposed API and
come to a collective agreement on it.

Also, looks like your pull request did send a note to the list so that
functionality is working:

http://markmail.org/search/?q=johnny+ray&q=list%3Aorg.apache.incubator.callback-dev#query:johnny%20ray%20list%3Aorg.apache.incubator.callback-dev+page:1+mid:wczkzfspjdyyyu56+state:results

On Fri, Mar 2, 2012 at 12:22 PM, Johnny Ray <jo...@johnnyray.me> wrote:
> Hi,
>
> I didn't see any messages come through here so per the wiki instructions I'd like to advocate for my two pull requests I made a couple hours ago:
>
> https://github.com/apache/incubator-cordova-android/pull/9
>
> https://github.com/apache/incubator-cordova-android/pull/10
>
> Thanks,
>
> --
> Johnny Ray
> http://johnnyray.me/
>

Re: MAC Address and User Agent

Posted by Johnny Austin <jo...@johnnyray.me>.
The code in my pull request does just that - it sets the UA for that web
view by simply appending cordova/phone gap to the end (keeping everything
else in tact). Its a simple yet very useful change.
On Mar 3, 2012 2:06 AM, "Brion Vibber" <br...@pobox.com> wrote:

> On Fri, Mar 2, 2012 at 11:00 AM, Filip Maj <fi...@adobe.com> wrote:
>
> > I like the idea of adding cordova/phonegap to the end of the user agent
> > string. If purely for analytics it makes sense to me. Not entirely
> > clobbering that string, just adding a "Cordova Web View" or something
> like
> > that to the end of the UA string.
> >
>
> What I would find useful as an application developer is a reliable way to
> tell that I'm being loaded in a Cordova view as opposed to a web browser,
> so I know if I should load up the relevant phonegap.js/cordova.js etc.
> (Having an app that works as-is in a browser is *hugely* helpful for
> debugging when possible!)
>
> What our Wikipedia app does now is to check the user-agent, and assumes
> that Android or iPhone user-agents are running in PhoneGap, while other
> things initialize without PhoneGap.
>
> -- brion vibber (brion @ pobox.com / brion @ wikimedia.org)
>

Re: MAC Address and User Agent

Posted by Brion Vibber <br...@pobox.com>.
On Fri, Mar 2, 2012 at 11:00 AM, Filip Maj <fi...@adobe.com> wrote:

> I like the idea of adding cordova/phonegap to the end of the user agent
> string. If purely for analytics it makes sense to me. Not entirely
> clobbering that string, just adding a "Cordova Web View" or something like
> that to the end of the UA string.
>

What I would find useful as an application developer is a reliable way to
tell that I'm being loaded in a Cordova view as opposed to a web browser,
so I know if I should load up the relevant phonegap.js/cordova.js etc.
(Having an app that works as-is in a browser is *hugely* helpful for
debugging when possible!)

What our Wikipedia app does now is to check the user-agent, and assumes
that Android or iPhone user-agents are running in PhoneGap, while other
things initialize without PhoneGap.

-- brion vibber (brion @ pobox.com / brion @ wikimedia.org)

Re: MAC Address and User Agent

Posted by Filip Maj <fi...@adobe.com>.
Thanks for the pull requests!

I like the idea of adding cordova/phonegap to the end of the user agent
string. If purely for analytics it makes sense to me. Not entirely
clobbering that string, just adding a "Cordova Web View" or something like
that to the end of the UA string.

Not too sure about the MAC info - it's not part of the W3C spec that we
adhere to for the Connection object. The latest draft of the Connection
object is here:

http://dvcs.w3.org/hg/dap/raw-file/tip/network-api/index.html#the-connectio
n-interface


Š whereas we are following the last stable draft which is:

http://www.w3.org/TR/2011/WD-netinfo-api-20110607/#idl-def-Connection


The MAC address info I think would be more appropriate to leave separate
from the core Cordova network connection API, and implement as a separate
plugin.

Just my $0.02.

On 3/2/12 10:22 AM, "Johnny Ray" <jo...@johnnyray.me> wrote:

>Hi,  
>
>I didn't see any messages come through here so per the wiki instructions
>I'd like to advocate for my two pull requests I made a couple hours ago:
>
>https://github.com/apache/incubator-cordova-android/pull/9
>
>https://github.com/apache/incubator-cordova-android/pull/10
>
>Thanks, 
>
>-- 
>Johnny Ray
>http://johnnyray.me/
>