tags:

views:

962

answers:

3

I'm looking at the Android Camera code and when I try importing android.os.SystemProperties It cannot be found.

here is the file I'm looking at. http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=blob;f=src/com/android/camera/VideoCamera.java;h=8effd3c7e2841eb1ccf0cfce52ca71085642d113;hb=refs/heads/eclair

I created a new 2.1 project and tried importing this namespace again, but It still cannot be found. I checked developer.android.com and SystemProperties was not listed

Did i miss something?

+2  A: 

This is the class in the Android source code

http://google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/os/SystemProperties.java&sa=N&cd=1&ct=rc

See {@hide} in the class JavaDoc? That means this class won't be exported as part of the public SDK.

The camera app uses it as it's internal and they won't use the public SDK to build it.

You may still be able to get at this class (1) by reflection or (2) by getting the source, removing @hide and making your own customized SDK. However pretty much by definition you are now going 'off SDK' and therefore your app may well be broken or get different behavior on OS versions as the Android folks will make little effort not to change this class between versions.

Jim Blackler
A: 

hi,

what do you call "reflexion"? can you provide an example? thanks,

zehunter
Please post a new question. Do not post a question as an answer to another question.
Moncader
A: 

You could exec out to the getprop command:

String line = "";
try {
 Process ifc = Runtime.getRuntime().exec("getprop ro.hardware");
 BufferedReader bis = new BufferedReader(new InputStreamReader(ifc.getInputStream()));
 line = bis.readLine();
} catch (java.io.IOException e) {
}
ifc.destroy();
danS