On Wed, Mar 14, 2012 at 2:06 PM, David Karr <[email protected]> wrote:
> I would also assume it is disabled by default, and I'm fine with that. I'm
> considering this for a situation where the user is at least cooperative, and
> is willing to have the phone provide this information, if there's any way to
> do that.

I'm not aware of anything. There are plenty of HTML5 proposals brewing
at W3C, and it's possible one covers this, and it's possible that some
version of Android's WebKit supports that particular proposed
standard. But even PhoneGap doesn't offer this, and if anyone would,
they would.

> It's starting to look like my only option is an android app with a WebView,
> with Java classes tied to the Javascript.

Bear in mind that you can't get the device's phone number from Java,
either. A device does not have to know its phone number to function,
particularly if it is GSM. While TelephonyManager has a tantalizing
getLine1Number(), it frequently returns null or the wrong number.

>> Model information may be included as part of the User-agent HTTP
>> header, so navigator.userAgent or navigator.appVersion in theory
>> should be able to provide that to you. Whether any given browser
>> provides model information, of course, is up to that browser maker.
>
> Acknowledged. We'll consider that.

And if you do go down the addJavaScriptInterface() route with WebView,
you could expose everything from android.os.Build to your app.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.7 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to