Friday, September 9, 2011

[android-developers] Re: How reliable is Google Marketplace Device Compatibility Report?

Anything pre Honeycomb 3.2 will fall into the else:

return (getResources().getConfiguration().screenLayout &
Configuration.SCREENLAYOUT_SIZE_MASK) >=
Configuration.SCREENLAYOUT_SIZE_XLARGE;

My testing so far seems to work on all the platforms I tried. I
havn't bothered with those crappy supermarket Android 2.2 "tablets",
but have tried with Gingerbread/Froyo phones and Honeycomb 3.0 and 3.1
tablets.

On Sep 10, 12:14 am, Dianne Hackborn <hack...@android.com> wrote:
> This will probably crash on older version of the platform, where
> smallestScreenWidthDp isn't defined.  Is suggest using reflection to
> retrieve that.
>
>
>
>
>
> On Fri, Sep 9, 2011 at 3:24 PM, MarkG123 <mark.gilles...@gmail.com> wrote:
> > This is what I am using now to have a my single APK support tablets
> > and smartphones on-the-fly.   I use if from my start activity, which
> > decides which activity to use (my app differences are more than just
> > layout).
>
> >   public boolean isTablet()
> >    {
> >        if (Build.VERSION.SDK_INT >=
> > Build.VERSION_CODES.HONEYCOMB_MR2)
> >        {
> >            return
> > (getResources().getConfiguration().smallestScreenWidthDp >= 600);
> >        }
>
> >        return (getResources().getConfiguration().screenLayout &
> > Configuration.SCREENLAYOUT_SIZE_MASK) >=
> > Configuration.SCREENLAYOUT_SIZE_XLARGE;
> >    }
>
> > This seems to work very well for me.
>
> > --
> > 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+unsubscribe@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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment