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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:05:07+00:00 2026-06-10T17:05:07+00:00

I am calculating function graphs and put them into android.graphics.Path objects and then use

  • 0

I am calculating function graphs and put them into android.graphics.Path objects and then use android.graphics.Canvas.drawPath() to draw it.

This works really well unless absolute y-values very high (either positive or negative) and the app is running on certain devices. Then, it might not draw the path at all. The threshold of when this happens seems to be random and device specific.

Does anyone know what might be the problem here?

[edit: This occurs only if target API-Level is 14 or higher]

Edit:
For example, take a look at this code within the View.onDraw(Canvas canvas) method:

    Paint paint = new Paint();

    Path p1 = new Path();
    paint.setColor(Color.BLUE);
    for(float x = 0; x < getWidth(); x++)
        p1.lineTo(x, x);
    canvas.drawPath(p1, paint);

    Path p2 = new Path();
    paint.setColor(Color.GREEN);
    for(float x = 0; x < getWidth(); x++)
        p2.lineTo(x, x*x);
    canvas.drawPath(p2, paint);

The first path should be a line coming from the the upper left corner and going to the bottom right; the second path should do the same but have the shape of a parabola (and, because of that, you can only see part of it).

The first path draws, the second does not, apparently because y-values get too high. It would be great to know what “too high” means though 😉

  • 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-10T17:05:09+00:00Added an answer on June 10, 2026 at 5:05 pm

    I found the solution.

    The problem was, that from API-Level 14, all drawing is done hardware accelerated which does not support all the functionality.

    As explained in this article, it is simple to turn hardware acceleration off with:

    view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    

    You will find more information at this blog post.

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

Sidebar

Related Questions

In my current project, I am going to write a function of calculating average
Will the following function for calculating Future value based on present value, interest rate
Could you please help why my working wage calculating function doesn't work in this
I'm trying to create a MySQL function for calculating the levenshtein distance. I found
I'm writing a program that involves calculating the maximum of a user defined function,
I'm using hugs to compile a simple Haskell function calculating the number of permutations.
I am using the drawpath function outside the ondraw function .I am calling this
I have a calculating thread function which invokes message function from other thread using
I had an assignment in school last week to implement a function for calculating
Is there any built in function calculating the value of a gradient of multivariate

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.