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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:01:55+00:00 2026-05-26T16:01:55+00:00

In my android app I have a background image which is longer than the

  • 0

In my android app I have a background image which is longer than the screen width for all the three types of screens.This implies that I have got 3 drawables each for different screen type(mdpi,ldpi,hdpi) and hence I have included a horizontal scroll bar in my app.

Now I want to know that how much does the actual background image extends beyond the visible screen.How do I calculate this?

Is the actual width and height of background image visible on the screen is same as the dimension of the image in the drawable folder or do i need to calculate this.If yes please tell me how to calculate the dimensions of a background image in such scenarios.

  • 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-26T16:01:56+00:00Added an answer on May 26, 2026 at 4:01 pm

    Well, you can get the dimensions of your image from this:

    Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.image_resource);
    int width = bitmap.getWidth();
    int height = bitmap.getHeight();
    

    And you can get the dimensions of the screen from this:

    DisplayMetrics displaymetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
    int screenWidth = displaymetrics.widthPixels; 
    int screenHeight = displaymetrics.heightPixels;
    

    Now you can do your calculation.

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

Sidebar

Related Questions

I am building an android app in which I have to add a background
I have a problem with my Android app. I have three Activities that all
I want to develop an Android application which can run on all ,screen type
SETUP : I have this app which has 4 activities in a linear path,
I have set a background image in my app, but the background image is
I have an Android app, in which Activities fire long running operations that run
In my android app I have a login screen. A graphic designer has given
In my app i have to set up a small image as background, to
We have an Android app and a Web Service. We want to download part
I have an Android app with a ListActivity in the main view. The list

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.