[Java for Android App Development] Androguide.fr:
Alternatively, you can use reflection to access Android's internal android.os.SystemProperties class.

Here is the class I use to reflect it in Pimp My Rom :

package com.androguide.pimpmyrom.helpers;

import android.content.Context;

import java.io.File;
import java.lang.reflect.Method;

import dalvik.system.DexFile;

/*
Class using reflection to grant access to the private hidden android.os.SystemProperties class
*/
public class SystemPropertiesReflection {

/**
* This class cannot be instantiated
*/
private SystemPropertiesReflection() {

}

/**
* Get the value for the given key.
*
* @return an empty string if the key isn't found
* @Throws IllegalArgumentException if the key exceeds 32 characters
*/
public static String get(Context context, String key) throws IllegalArgumentException {

String ret = "";

try {

ClassLoader cl = context.getClassLoader();
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class SystemProperties = cl.loadClass("android.os.SystemProperties");

//Parameters Types
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class[] paramTypes = new Class[1];
paramTypes[0] = String.class;

Method get = SystemProperties.getMethod("get", paramTypes);

//Parameters
Object[] params = new Object[1];
params[0] = new String(key);

ret = (String) get.invoke(SystemProperties, params);

} catch (IllegalArgumentException iAE) {
throw iAE;
} catch (Exception e) {
ret = "";
//TODO
}

return ret;

}

/**
* Get the value for the given key.
*
* [MENTION=2056652]return[/MENTION] if the key isn't found, return def if it isn't null, or an empty string otherwise
* [MENTION=948141]Throw[/MENTION]s IllegalArgumentException if the key exceeds 32 characters
*/
public static String get(Context context, String key, String def) throws IllegalArgumentException {

String ret = def;

try {

ClassLoader cl = context.getClassLoader();
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class SystemProperties = cl.loadClass("android.os.SystemProperties");

//Parameters Types
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class[] paramTypes = new Class[2];
paramTypes[0] = String.class;
paramTypes[1] = String.class;

Method get = SystemProperties.getMethod("get", paramTypes);

//Parameters
Object[] params = new Object[2];
params[0] = new String(key);
params[1] = new String(def);

ret = (String) get.invoke(SystemProperties, params);

} catch (IllegalArgumentException iAE) {
throw iAE;
} catch (Exception e) {
ret = def;
//TODO
}

return ret;

}

/**
* Get the value for the given key, and return as an integer.
*
* [MENTION=955119]param[/MENTION] key the key to lookup
* [MENTION=955119]param[/MENTION] def a default value to return
* [MENTION=2056652]return[/MENTION] the key parsed as an integer, or def if the key isn't found or
* cannot be parsed
* [MENTION=948141]Throw[/MENTION]s IllegalArgumentException if the key exceeds 32 characters
*/
public static Integer getInt(Context context, String key, int def) throws IllegalArgumentException {

Integer ret = def;

try {

ClassLoader cl = context.getClassLoader();
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class SystemProperties = cl.loadClass("android.os.SystemProperties");

//Parameters Types
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class[] paramTypes = new Class[2];
paramTypes[0] = String.class;
paramTypes[1] = int.class;

Method getInt = SystemProperties.getMethod("getInt", paramTypes);

//Parameters
Object[] params = new Object[2];
params[0] = new String(key);
params[1] = new Integer(def);

ret = (Integer) getInt.invoke(SystemProperties, params);

} catch (IllegalArgumentException iAE) {
throw iAE;
} catch (Exception e) {
ret = def;
//TODO
}

return ret;

}

/**
* Get the value for the given key, and return as a long.
*
* [MENTION=955119]param[/MENTION] key the key to lookup
* [MENTION=955119]param[/MENTION] def a default value to return
* [MENTION=2056652]return[/MENTION] the key parsed as a long, or def if the key isn't found or
* cannot be parsed
* [MENTION=948141]Throw[/MENTION]s IllegalArgumentException if the key exceeds 32 characters
*/
public static Long getLong(Context context, String key, long def) throws IllegalArgumentException {

Long ret = def;

try {

ClassLoader cl = context.getClassLoader();
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class SystemProperties = cl.loadClass("android.os.SystemProperties");

//Parameters Types
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class[] paramTypes = new Class[2];
paramTypes[0] = String.class;
paramTypes[1] = long.class;

Method getLong = SystemProperties.getMethod("getLong", paramTypes);

//Parameters
Object[] params = new Object[2];
params[0] = new String(key);
params[1] = new Long(def);

ret = (Long) getLong.invoke(SystemProperties, params);

} catch (IllegalArgumentException iAE) {
throw iAE;
} catch (Exception e) {
ret = def;
//TODO
}

return ret;

}

/**
* Get the value for the given key, returned as a boolean.
* Values 'n', 'no', '0', 'false' or 'off' are considered false.
* Values 'y', 'yes', '1', 'true' or 'on' are considered true.
* (case insensitive).
* If the key does not exist, or has any other value, then the default
* result is returned.
*
* [MENTION=955119]param[/MENTION] key the key to lookup
* [MENTION=955119]param[/MENTION] def a default value to return
* [MENTION=2056652]return[/MENTION] the key parsed as a boolean, or def if the key isn't found or is
* not able to be parsed as a boolean.
* [MENTION=948141]Throw[/MENTION]s IllegalArgumentException if the key exceeds 32 characters
*/
public static Boolean getBoolean(Context context, String key, boolean def) throws IllegalArgumentException {

Boolean ret = def;

try {

ClassLoader cl = context.getClassLoader();
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class SystemProperties = cl.loadClass("android.os.SystemProperties");

//Parameters Types
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class[] paramTypes = new Class[2];
paramTypes[0] = String.class;
paramTypes[1] = boolean.class;

Method getBoolean = SystemProperties.getMethod("getBoolean", paramTypes);

//Parameters
Object[] params = new Object[2];
params[0] = new String(key);
params[1] = new Boolean(def);

ret = (Boolean) getBoolean.invoke(SystemProperties, params);

} catch (IllegalArgumentException iAE) {
throw iAE;
} catch (Exception e) {
ret = def;
//TODO
}

return ret;

}

/**
* Set the value for the given key.
*
* [MENTION=948141]Throw[/MENTION]s IllegalArgumentException if the key exceeds 32 characters
* [MENTION=948141]Throw[/MENTION]s IllegalArgumentException if the value exceeds 92 characters
*/
public static void set(Context context, String key, String val) throws IllegalArgumentException {

try {

[MENTION=1299008]supp[/MENTION]ressWarnings("unused")
DexFile df = new DexFile(new File("/system/app/Settings.apk"));
[MENTION=1299008]supp[/MENTION]ressWarnings("unused")
ClassLoader cl = context.getClassLoader();
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class SystemProperties = Class.forName("android.os.SystemProperties");

//Parameters Types
[MENTION=1299008]supp[/MENTION]ressWarnings("rawtypes")
Class[] paramTypes = new Class[2];
paramTypes[0] = String.class;
paramTypes[1] = String.class;

Method set = SystemProperties.getMethod("set", paramTypes);

//Parameters
Object[] params = new Object[2];
params[0] = new String(key);
params[1] = new String(val);

set.invoke(SystemProperties, params);

} catch (IllegalArgumentException iAE) {
throw iAE;
} catch (Exception e) {
//TODO
}

}
}

Then, you can create a static method like the following in order to avoid NPEs if the property we're asking for isn't present and such:

public static String getSystemProp(Context context, String prop, String default) {
String result = null;
try {
result = SystemPropertiesReflection.get(context, prop);
} catch (IllegalArgumentException iae) {
Log.e(TAG, "Failed to get prop: " + prop);
}
return result == null ? default : result;
}

And simply invoke it to get the returned property, for example:

String prop = getSystemProp(this, "ro.sf.lcd_density", "213");

EDIT : sorry to the guys that were @ mentionned by the code's annotations