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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:43:56+00:00 2026-06-07T10:43:56+00:00

I’m working on a custom view for an android application, similar to the Analog

  • 0

I’m working on a custom view for an android application, similar to the Analog Gauge sample code available from Mind the Robot.

Running the code from listed site, I get see this on my screen:

(Motorola Droid, 2.2.3), (Emulator, 4.0.3)

has an arrow

(Xoom, 4.0.3)(Other phone, 4.0.3)

does not have an arrow

The hand is missing!

The drawing calls are being made (I can see them in logcat), but the canvas elements the calls draw are invisible.

It’s not API level dependent, though; if I import it the right way into a project, it will hand will show up when I run it on the Xoom.

But, when I move the files to a different project folder (same source code, same layouts) it goes back to missing the dial.

What’s going on? How could the same code be producing such different outcomes on different devices?

  • 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-07T10:43:58+00:00Added an answer on June 7, 2026 at 10:43 am

    So, the key clue in my mystery seemed to be that it worked on the emulator, but not on the hardware devices.

    Hardware Rendering

    I did peruse the hardware rendering page on the Android Developer’s website, but apparently not closely enough.

    http://developer.android.com/guide/topics/graphics/hardware-accel.html

    While it does mention that the API’s are available beginning version 11, it does not say that Hardware Rendering is turned on for all applications by default, starting with API Level 14 (ICS).

    What does this mean for us?

    Almost everything is faster; except for the few things that don’t work.

    I managed to violate two of these, without realizing it:

    • Canvas.DrawTextOnPath()
    • Paint.setShadowLayer()

    It’s not mentioned in the API reference (or anywhere else I can find, and certainly not checked by Lint), but using any of the listed operations can do weird things.

    In my case, Canvas.DrawTextOnPath() seemed to work just fine.

    But when Android notice that the paint that I used on the hand had shadow layer set, it silently ignored it.

    How do I know if my View is hardware accelerated?

    From the documentation link above:

    There are two different ways to check whether the application is hardware accelerated:

    • View.isHardwareAccelerated() returns true if the View is attached to a hardware accelerated window.
    • Canvas.isHardwareAccelerated() returns true if the Canvas is hardware accelerated

    If you must do this check in your drawing code, use Canvas.isHardwareAccelerated() instead >of View.isHardwareAccelerated() when possible. When a view is attached to a hardware >accelerated window, it can still be drawn using a non-hardware accelerated Canvas. This >happens, for instance, when drawing a view into a bitmap for caching purposes.

    In my case, the opposite appears to have occurred.
    The custom view logs that it is not Hardware-accelerated; however, the canvas reports that it is hardware-accelerated.

    Work Arounds and Fixings

    The simplest fix is forcing the custom view to do software rendering. Per the documentation this can be accomplished by:

    myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    

    Alternatively, you could remove the offending operations, and keep hardware rendering turned on.

    Learn from my misfortune. Good luck, all.

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

Sidebar

Related Questions

I have a view passing on information from a database: def serve_article(request, id): served_article
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.