Re: [android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-23 Thread Mark Murphy
On Fri, Apr 22, 2011 at 11:46 PM, Zsolt Vasvari zvasv...@gmail.com wrote:
 However, I notice this does not work (returns false) for some devices that
 definitely do have telephony (e.g. HTC Legend and Motorola Milestone). In
 both cases, they are running SDK 7, so I wonder whether this particular
 feature is an SDK 8+ thing?

 I'd say these devices simply have a firmware bug or something
 returning the wrong value.

Agreed. I don't remember the Legend, but the Milestone would have
shipped with an earlier version of Android than 2.1, then got OTA
upgraded (or the equivalent). It may be that Motorola missed whatever
corner of the firmware has the value that gets returned here. For the
Milestone specifically, you might consider asking your question on the
MOTODEV support boards.

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

Android 3.0 Programming Books: http://commonsware.com/books

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


Re: [android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-23 Thread Mark Carter
I've experienced this with the following devices:

Motorola Milestone (7), Spice Mi-310 (8), HTC Desire (7), Samsung Galaxy
Apollo (7), T-Mobile myTouch 3G Slide (7), ZTE Racer (7), Nokia N90 (10),
Taiwan Mobile T2 (7), Samsung Galaxy 5 (7), HTC Legend (7)

I expect some more devices will pop up over the next few days.

Side note - Nokia N90!?

To summarise, I think there are too many devices to hardcode these special
cases. The sim card check may be enough though I'm still open to other
suggestions...

Actually, the main reason I'm checking for this is to know whether or not to
show a list of SMS messages. So maybe a better approach would be to do a
quick check for what the SMS content provider returns. Won't be good enough
to check for the presence of messages (i.e. no messages won't prove
anything) but maybe there is something else to check for in this regard to
discover whether SMS messages are applicable to the device?

2011/4/23 Mark Murphy mmur...@commonsware.com

 On Fri, Apr 22, 2011 at 11:46 PM, Zsolt Vasvari zvasv...@gmail.com
 wrote:
  However, I notice this does not work (returns false) for some devices
 that
  definitely do have telephony (e.g. HTC Legend and Motorola Milestone).
 In
  both cases, they are running SDK 7, so I wonder whether this particular
  feature is an SDK 8+ thing?
 
  I'd say these devices simply have a firmware bug or something
  returning the wrong value.

 Agreed. I don't remember the Legend, but the Milestone would have
 shipped with an earlier version of Android than 2.1, then got OTA
 upgraded (or the equivalent). It may be that Motorola missed whatever
 corner of the firmware has the value that gets returned here. For the
 Milestone specifically, you might consider asking your question on the
 MOTODEV support boards.

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

 Android 3.0 Programming Books: http://commonsware.com/books

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


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

Re: [android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-22 Thread Mark Carter
From what I have seen so far, TelephonyManager is never null (even for 
devices without telephony), so that check is no good.

Maybe (for SDK level 7 and where the telephony feature value is missing) 
check TelephonyManager.getSimState() for TelephonyManager.SIM_STATE_READY 
instead? This is not perfect because the user may simply be using their 
phone without a sim card (and so may still want to access old SMS messages) 
but I think it's a fairly unlikely scenario...

Any better ideas!?

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

[android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-22 Thread Zsolt Vasvari
 However, I notice this does not work (returns false) for some devices that
 definitely do have telephony (e.g. HTC Legend and Motorola Milestone). In
 both cases, they are running SDK 7, so I wonder whether this particular
 feature is an SDK 8+ thing?

I'd say these devices simply have a firmware bug or something
returning the wrong value.

I would simply check for the wrong devices as a workaround and return
true

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


[android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-21 Thread lbendlin
there is no such thing as telephony in the android.hardware section
 
http://developer.android.com/reference/android/hardware/package-summary.html

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

Re: [android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-21 Thread Mark Carter
http://developer.android.com/search.html#q=android.hardware.telephony;http://developer.android.com/search.html#q=

On 21 April 2011 18:34, lbendlin l...@bendlin.us wrote:

 there is no such thing as telephony in the android.hardware section


 http://developer.android.com/reference/android/hardware/package-summary.html

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


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

[android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-21 Thread String
Do you mean android.telephony (no hardware., as was pointed out)? The docs 
say since API level 1, but having the feature string wrong could be your 
problem.

String

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

Re: [android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-21 Thread Mark Carter
That last link was broken:
http://developer.android.com/search.html#q=android.hardware.telephonyt=0http://developer.android.com/search.html#q=

http://developer.android.com/search.html#q=This next link shows it's
definitely the correct feature:
http://developer.android.com/guide/practices/optimizing-for-3.0.html#Telephony

On 21 April 2011 18:55, String sterling.ud...@googlemail.com wrote:

 Do you mean android.telephony (no hardware., as was pointed out)? The
 docs say since API level 1, but having the feature string wrong could be
 your problem.

 String

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


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

Re: [android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-21 Thread Mark Carter
Interesting:
http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_TELEPHONY
suggests
that the telephony feature is since API level 7. Which makes it confusing
why the check is not working on API level 7.

I didn't see the (much more convenient) hasSystemFeature() method before,
but I doubt that is causing the problem...

On 21 April 2011 18:58:58 UTC+8, Mark Carter mjc1...@googlemail.com wrote:

 That last link was broken:
 http://developer.android.com/search.html#q=android.hardware.telephonyt=0http://developer.android.com/search.html#q=

 http://developer.android.com/search.html#q=This next link shows it's
 definitely the correct feature:
 http://developer.android.com/guide/practices/optimizing-for-3.0.html#Telephony

 On 21 April 2011 18:55, String sterling.ud...@googlemail.com wrote:

 Do you mean android.telephony (no hardware., as was pointed out)? The
 docs say since API level 1, but having the feature string wrong could be
 your problem.

 String

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




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

Re: [android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-21 Thread String
My apologies, it's an inconsistency between the feature strings and the 
android.* class hierarchy. Sorry for the misinformation.

String

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

Re: [android-developers] Re: Is there a min SDK level for android.hardware.telephony feature?

2011-04-21 Thread Mark Carter
Anyone know of a more brut-force check for the presence of telephony?

For example, maybe check Context.getSystemService(Context.TELEPHONY_SERVICE)
for null?

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