Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6988953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:08:58+00:00 2026-05-27T19:08:58+00:00

When making apps for Android 3.x, you could basically just check if the device

  • 0

When making apps for Android 3.x, you could basically just check if the device was in landscape to see if it could fit multiple fragments side by side. But this is only because you were basically guaranteed that the device is a tablet.

With the introduction of the compatibility library and android 4.0, I can’t think of what I would consider as a ‘good’ way to determine if I can get away with side by side fragments or should revert to standard one fragment per ‘screen.’

In the NewsReader example app, Google has a special values file for every common resolution, each with a Boolean value for whether the resolution should support the 2 fragment layout, but I think this way is poorly conceived. The only way I can think of is to check the size of the screen (to guess if it is a tablet or at least big enough to not ruin the layout), and then check the orientation.

So if anyone out there has an idea how to easily and efficiently check this, please let me know!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:08:59+00:00Added an answer on May 27, 2026 at 7:08 pm

    You can actually see the screen size type (small, normal, large, etc) by using the following:

    getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK
    

    That’ll return an int that you can check against any of the following:

    Configuration.SCREENLAYOUT_SIZE_SMALL
    Configuration.SCREENLAYOUT_SIZE_NORMAL
    Configuration.SCREENLAYOUT_SIZE_LARGE
    Configuration.SCREENLAYOUT_SIZE_UNDEFINED
    

    Then you can check for orientation, using

    getResources().getConfiguration().orientation
    

    Which will match any of the following possibilities

    Configuration.ORIENTATION_PORTRAIT
    Configuration.ORIENTATION_LANDSCAPE
    Configuration.ORIENTATION_SQUARE
    Configuration.ORIENTATION_UNDEFINED
    

    With this you can essentially simulate the multiple views by adding your fragments as space allows based on screen size and orientation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to start making cellphone apps with Android as first choice but not
I'm quite new to developing Android apps. Basically I'm making a webview template to
I like using Dashcode for making quick little web apps, but it specifically targets
I am new to developing android apps. I am making an app where simple
This could be a dumb question, but I have submitted a few apps where
I am an Android developer and I wish to begin making apps for the
I am trying to learn android so i am making some apps to play
I have just started learning about Android and I was planning on making a
i've been making an app for android in java, but i'm curious about convering
So, I'm both new to Java and to creating android apps, but not new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.