I want to enable hardware acceleration for my android app, but I still want to build against Android 2.1 (in order to make sure I don't accidentally rely on APIs introduced in 3.0, for example). Is there anyway to turn on a feature and still build against a version before it was introduced? I know I can use reflection in code to check for say, an API added after my build target, but I'm not sure if I can do something similar for android:hardwareAccelerated.
Asked
Active
Viewed 2,107 times
2 Answers
2
It seems that it's impossible to enable hardware acceleration while building pre-Honeycomb.
The main reason I wanted to build pre-Honeycomb was to ensure I don't use any API calls occuring after the minimally supported API level. I found that I can still get this by using the API Analysis tool adt addon though.

Sam
- 1,569
- 3
- 15
- 24
0
I think you can achieve this by setting your project properties in Eclipse to use the target SDK of API version 11 (3.0) so that you are compiling against a Honeycomb SDK, but then in your AndroidManifest.xml
setting the max API version (android:targetSdkVersion
to 7)
See this answer for more info.
-
Your suggestion involves building against 3.0 (API level 11), which I wanted to avoid. It looks like I can still get the checking that I wanted by using the API Analysis tool at https://code.google.com/p/adt-addons/ – Sam Oct 13 '11 at 00:40
-
Yes that's exactly what I had in mind by suggesting setting the max API level, though to be honest I thought it was built into the ADT and not a separate plugin, so thanks for linking to the API Analysis plugin. – Maks Oct 17 '11 at 23:46