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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:58:01+00:00 2026-05-20T03:58:01+00:00

I asked a similar question to this awhile back and got zero responses, so

  • 0

I asked a similar question to this awhile back and got zero responses, so I’m going to try rephrasing it . . .

What is “best practice” for ensuring that the 2D drawing primitives in the Canvas class scale properly for different devices (phones with different screen resolutions)? Are they supposed to scale automatically? Is there a way to scale the whole canvas? Am I supposed to detect the size and do my own scaling as I draw each line, circle and point individually? Am I supposed to do it by manipulating the View? Or what?

The goal is to make sure the graphics fill up the screen to take full advantage of the available resolution, but don’t overflow it.

Thanks in advance!

  • 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-20T03:58:02+00:00Added an answer on May 20, 2026 at 3:58 am

    The way I do it in my app is by keeping track of the size of my View:

    @Override 
    protected void onSizeChanged(int width, int height, int oldw, int oldh) {
      //do some calculations with width and height
    }
    

    Then whenever I need to manually draw something, I do it in terms of a percentage of the total resolution. Your mileage may vary depending on exactly what you are trying to do.

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

Sidebar

Related Questions

I previously asked a similar question on this topic a while back and got
I asked this similar question and got a satisfactory answer. However, doing the same
I've asked a similar question to this here: Best way to interact with EJBs
Similar to what I asked in this question a while back about getting the
I asked a similar question about this previously, but I did not specify that
First of all, I know I asked a similar question before but this one
I found this on Google, click here , which someone asked a similar question,
I have asked a question similar to this in the past but this is
This is similar to this question I asked last week. My dataGrid is populated
This is a similar question to those that have been asked before, but still

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.