public final class ConfigurationCollector extends Object
Configuration
object through reflection API in order to
generate a human readable String with values replaced with their constants
names. The Configuration.toString()
method was not enough as values
like 0, 1, 2 or 3 don't look readable to me. Using reflection API allows to
retrieve hidden fields and can make us hope to be compatible with all Android
API levels, even those which are not published yet.Constructor and Description |
---|
ConfigurationCollector() |
Modifier and Type | Method and Description |
---|---|
static String |
collectConfiguration(android.content.Context context)
Returns the current Configuration for this application.
|
static String |
toString(android.content.res.Configuration conf)
Use this method to generate a human readable String listing all values
from the provided Configuration instance.
|
public static String toString(android.content.res.Configuration conf)
conf
- The Configuration to be described.public static String collectConfiguration(android.content.Context context)
context
- Context for the application being reported.Copyright © 2010-2015. All Rights Reserved.