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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:29:10+00:00 2026-05-30T14:29:10+00:00

Probably something silly going on, but I am trying to enable hardware acceleration in

  • 0

Probably something silly going on, but I am trying to enable hardware acceleration in an app targeting 3.1, per this tutorial.

I’ve added the following to my manifest:

<uses-sdk 
    android:targetSdkVersion="12" 
    android:minSdkVersion="12" />

<application 
    ...
    android:hardwareAccelerated="true">

When I check the state of hardware acceleration after the View is attached (by calling isHardwareAccelerated() in an overriden onAttachedToWindow()) I am returned true, so all looks great. The problem is that the SurfaceView’s Canvas is NOT being accelerated, as canvas.isHardwareAccelerated() returns false. I am checking in surfaceCreated(), and I get true there as well, so no idea whay the Canvas is losing this setting.

Any pointers?

EDIT1:

Found this and this on the Google Developers group, but I am indeed checking after the View is attached if I am checking this in onAttachedToWindow(), right? This is on a Lenovo Tablet running 3.1 BTW.

EDIT2:

I have tried disabling acceleration via setting

<application 
    ...
    android:hardwareAccelerated="false">

And I am still seeing true returned from the View in onAttachedToWindow(), so something is not right here. I am not explicitly chanbing hw accel from code, maybe a device specific issue?

Also, I am seeing the following line sporadically in LogCat when the SurfaceView is created:

surface (identity=524) is invalid, err=-19 (No such device)

EDIT3:

Just thinking out loud here, but is there any chance that the Canvas is not being accelerated due to the fact that it is on it’s own thread, via the typical SurfaceView implementation that uses a drawing loop, like Lunar Lander?

  • 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-30T14:29:11+00:00Added an answer on May 30, 2026 at 2:29 pm

    This is expected behavior. SurfaceView is not hardware accelerated. (link)

    Since Android 4.0 there is a new TextureView (here is an example).
    See also this SO question for pre-4.0 availablity.

    Update: Just tested on a Transformer with Android 4.0 and the TextureView Canvas is not HW accelerated either. :-/

    Update Android 6.0: there is a new method for hardware acceleration:
    https://developer.android.com/reference/android/view/Surface.html#lockHardwareCanvas()

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

Sidebar

Related Questions

This is probably something silly I'm missing but I'm definitely lost. I'm using .NET
This is a very small question, and probably something really silly! But why am
this is probably something I should know, but I'm puzzled by this. I'm trying
this is probably a silly question and the solution is something i overlooked, but
This is probably something silly and simple in vectors or something, but I can't
I'm probably doing something silly, but here it goes. I'm trying to get the
This is probably something really simple but I cant see what! Any images I
I get the feeling this is probably something I should know but I can't
I am probably overlooking something really simple here but I am trying to redirect
I am doing something that is probably silly, but it would be nice if

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.