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 6761345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:10:38+00:00 2026-05-26T14:10:38+00:00

Hi guys, I am developing an application for both tablets as well as mobile,Till

  • 0

Hi guys,
I am developing an application for both tablets as well as mobile,Till now every thing is fine to me. Here is my problem,I can’t get the height and width of Samsung Galaxy Tab?

  • I want what is configuration for 7 inch tablet i have declared as
    config.orientation == Configuration.SCREENLAYOUT_SIZE_LARGE. It is not working for me.
  • if else how i need to declare this.

  • here i have declared i n the layout as layout-large it’s working for me, but i am having both design for landscape and protrait.

  • 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-26T14:10:39+00:00Added an answer on May 26, 2026 at 2:10 pm

    If you need the size classification — ”small”, “normal”, “large”, “xlarge” — use the Configuration class:

    Configuration config = getResources().getConfiguration();
    int size = config.screenLayout & config.SCREENLAYOUT_SIZE_MASK;
    
    if (size == config.SCREENLAYOUT_SIZE_SMALL)
    {
        // use special layout for small screens
    }
    

    If you need check for a orientation then you can use:

    public int getScreenOrientation()
    {
        Display getOrient = getWindowManager().getDefaultDisplay();
        int orientation = Configuration.ORIENTATION_UNDEFINED;
    
        if(getOrient.getWidth() == getOrient.getHeight()) {
            orientation = Configuration.ORIENTATION_SQUARE;
        } else { 
            if(getOrient.getWidth() < getOrient.getHeight()){
                orientation = Configuration.ORIENTATION_PORTRAIT;
            } else { 
                 orientation = Configuration.ORIENTATION_LANDSCAPE;
            }
        }
    
        return orientation;
    }
    

    I don’t really get it, why you need check for a screen size, because if you add your layouts in different layout folders, then Android automatically selects most suitable depending on screen size.

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

Sidebar

Related Questions

I need your advice guys. I am developing a web browser application for mobile
Some of the guys here are developing an application which incorporates some 'secure areas'
H guys. I'm developing a custom component for SSIS. I'm having a problem when
Guys, I've came across this problem I can't resolve myselg, I'm pretty sure I
I am developing a mobile application in android using eclipse and phonegap. and my
Guys I am currently developing a web application, in which rules, which are basically
When developing bigger systems in team, often, there are separate guys for implementing application
hey guys here at stackoverflow.com I'm a student and developing a small todo app
i have been working on developing an blackberry application. as per now i want
Recently we were developing web application based on Vaadin and Spring (Core). Now we

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.