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

  • Home
  • SEARCH
  • 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 9215437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:12:17+00:00 2026-06-18T02:12:17+00:00

So i have a small problem, i’m writing a function which need to send

  • 0

So i have a small problem, i’m writing a function which need to send screen width to server. I got it all to work, and i use:

Display display = getWindowManager().getDefaultDisplay(); 
int width = display.getWidth();

to get width. However .getWidht() function is deprecated and it says u need to use:

Point size = new Point();
display.getSize(size);

But that function is only avaible for api level 13 or more, and my minimum sdk is 8. So what can i do? Is it safe if i stay with getWidth? Why adding new function and not make them backward compatible?

  • 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-06-18T02:12:18+00:00Added an answer on June 18, 2026 at 2:12 am

    May be this approach will be helpful:

    DisplayMetrics displaymetrics = new DisplayMetrics();
    mContext.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
    int screenWidth = displaymetrics.widthPixels;
    int screenHeight = displaymetrics.heightPixels;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have small problem with my jquery function and i need help. So, i
I have a small problem which i can't seem to figure out. I tried
I have a small problem which i can't seem to solve myself. Look at
I have a small problem... if I use the php function to convert a
I have a small problem here. I have an array which holds some objects
I have small problem. I'm trying to work on an XML file, but the
I have small problem. I try to write a function to extract something in
I have this small problem with jquery: I need to do something like this:
I have a small problem with my jQuery script. <script language=javascript> $(document).ready(function(){ $('.roll-li').click(function(){ if
I have a small problem with the prompt on a debian server, I keep

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.