Re: [android-developers] Re: How to detect tablet devices

2011-02-25 Thread Mark Murphy
On Wed, Feb 23, 2011 at 12:47 PM, Carlo Codega sazi...@gmail.com wrote:
 Is there any numeric size about XLARGE screens? AFAIK there could be
 smartphone devices with xlarge screens, or not? I don't see any
 documentation which says that XLARGE screens are  6 inches

 Does xlarge refer to the phisical size? or resolution?

Neither, though physical size is more relevant.

Screen size, in terms of small/normal/large/xlarge, will be determined
by device manufacturers based upon physical screen size and the
distance that screen will be from the user. A phone is held closer to
the user's eyes than is a tablet, and both are held closer to the
user's eyes than is an LCD TV.

At best, Google might come up with a size guideline per form factor --
10 tablets are xlarge, for example. However, in the end, the device
manufacturer will choose the value for the device. How the device
manufacturer makes that choice, AFAIK, is up to the device
manufacturer.

-- 
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 *Advanced* Android Development_ Version 1.9
Available!

-- 
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: How to detect tablet devices

2011-02-24 Thread Carlo Codega
Is there any numeric size about XLARGE screens? AFAIK there could be
smartphone devices with xlarge screens, or not? I don't see any
documentation which says that XLARGE screens are  6 inches

Does xlarge refer to the phisical size? or resolution?

Carlo

On Wed, Feb 23, 2011 at 6:27 PM, Dianne Hackborn hack...@android.comwrote:

 No no no no no.

 getResources().getConfiguration() tells you this kind of stuff about the
 device.

 Look for LARGE or XLARGE screen size, depending on what you want to do.

 And of course you can have your resources adjust automatically by using
 things like layout-xlarge.

 On Mon, Feb 21, 2011 at 6:09 AM, carlo sazi...@gmail.com wrote:

 Thank you all

 Here is the code I use for my app:

 public boolean isTablet() {
try {
// Compute screen size
DisplayMetrics dm =
 context.getResources().getDisplayMetrics();
float screenWidth  = dm.widthPixels / dm.xdpi;
float screenHeight = dm.heightPixels / dm.ydpi;
double size = Math.sqrt(Math.pow(screenWidth, 2) +
Math.pow(screenHeight, 2));
// Tablet devices should have a screen size greater than 6
 inches
return size = 6;
} catch(Throwable t) {
Log.error(TAG_LOG, Failed to compute screen size, t);
return false;
}
 }

 Any comments/suggestions?

 On 16 Feb, 12:07, carlo sazi...@gmail.com wrote:
  The question is simple... is there a (simple) way todetectif the
  current device, on which my application is running, is atablet?
  I know I could rely on the screen resolution, but I was wondering if
  there is a more deterministic way...
 
  Thanks in advance
  Carlo

 --

 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




 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.



-- 
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: How to detect tablet devices

2011-02-23 Thread TreKing
On Mon, Feb 21, 2011 at 8:09 AM, carlo sazi...@gmail.com wrote:

 Any comments/suggestions?


Read Dianne's post.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
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: How to detect tablet devices

2011-02-23 Thread Dianne Hackborn
No no no no no.

getResources().getConfiguration() tells you this kind of stuff about the
device.

Look for LARGE or XLARGE screen size, depending on what you want to do.

And of course you can have your resources adjust automatically by using
things like layout-xlarge.

On Mon, Feb 21, 2011 at 6:09 AM, carlo sazi...@gmail.com wrote:

 Thank you all

 Here is the code I use for my app:

 public boolean isTablet() {
try {
// Compute screen size
DisplayMetrics dm =
 context.getResources().getDisplayMetrics();
float screenWidth  = dm.widthPixels / dm.xdpi;
float screenHeight = dm.heightPixels / dm.ydpi;
double size = Math.sqrt(Math.pow(screenWidth, 2) +
Math.pow(screenHeight, 2));
// Tablet devices should have a screen size greater than 6
 inches
return size = 6;
} catch(Throwable t) {
Log.error(TAG_LOG, Failed to compute screen size, t);
return false;
}
 }

 Any comments/suggestions?

 On 16 Feb, 12:07, carlo sazi...@gmail.com wrote:
  The question is simple... is there a (simple) way todetectif the
  current device, on which my application is running, is atablet?
  I know I could rely on the screen resolution, but I was wondering if
  there is a more deterministic way...
 
  Thanks in advance
  Carlo

 --
 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




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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: How to detect tablet devices

2011-02-23 Thread Scott Davies
Dianne, I'm confused.

If your response had six no's, I'd know not to do this for sureĊ but with
just five ?

This appears to be a grey issueĊ  :)

- Scott

From:  Dianne Hackborn hack...@android.com
Reply-To:  android-developers@googlegroups.com
Date:  Wed, 23 Feb 2011 09:27:13 -0800
To:  android-developers@googlegroups.com
Cc:  carlo sazi...@gmail.com
Subject:  Re: [android-developers] Re: How to detect tablet devices

No no no no no.

getResources().getConfiguration() tells you this kind of stuff about the
device.

Look for LARGE or XLARGE screen size, depending on what you want to do.

And of course you can have your resources adjust automatically by using
things like layout-xlarge.

On Mon, Feb 21, 2011 at 6:09 AM, carlo sazi...@gmail.com wrote:
 Thank you all
 
 Here is the code I use for my app:
 
 public boolean isTablet() {
 try {
 // Compute screen size
 DisplayMetrics dm =
 context.getResources().getDisplayMetrics();
 float screenWidth  = dm.widthPixels / dm.xdpi;
 float screenHeight = dm.heightPixels / dm.ydpi;
 double size = Math.sqrt(Math.pow(screenWidth, 2) +
 Math.pow(screenHeight, 2));
 // Tablet devices should have a screen size greater than 6
 inches
 return size = 6;
 } catch(Throwable t) {
 Log.error(TAG_LOG, Failed to compute screen size, t);
 return false;
 }
 }
 
 Any comments/suggestions?
 
 On 16 Feb, 12:07, carlo sazi...@gmail.com wrote:
  The question is simple... is there a (simple) way todetectif the
  current device, on which my application is running, is atablet?
  I know I could rely on the screen resolution, but I was wondering if
  there is a more deterministic way...
 
  Thanks in advance
  Carlo
 
 --
 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
 mailto:android-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


-- 
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: How to detect tablet devices

2011-02-18 Thread rich friedel
that was posted days ago but sat in moderation and shortly thereafter I
found out I was incorrect but couldn't take it back... whoops!
On Feb 18, 2011 2:49 PM, SteveHM merr...@googlemail.com wrote:
 Wrong. My legit. european version of the Galaxy Tab has full
 telephony/GPRS alongside WiFi etc.

 On Feb 16, 9:01 pm, rich friedel rich.frie...@gmail.com wrote:
 telephony... however at the pace things are moving that might be an
obsolete test soon

 --
 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: How to detect tablet devices

2011-02-16 Thread Dianne Hackborn
In fact, you really shouldn't think target a tablet.  What does tablet
mean?  You will quickly find that this is an incredibly nebulous term.

Target screen size: adjust your UI for xlarge (or large).

Target other specific hardware aspects that make sense for you (does it have
a hardware keyboard?  Phone radio?  Etc).

On Wed, Feb 16, 2011 at 2:27 PM, String sterling.ud...@googlemail.comwrote:

 As a first approximation, if the device vendor has chosen to go with large
 (or xlarge) screen size, then it's a tablet. I know, other devices (like
 netbooks and Google TV) will also get picked up by this, but that's why I
 called it a first approximation.

 To detect this in code, take a look at this blog post:
 http://blog.alsutton.com/2010/12/07/android-tablet-phone-uis-in-one-apk-how-to/
 .

 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




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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