/** * @webref xml:method * @brief Gets the content of an attribute as a String */ public String getString(String name) { return getString(name, null); }
/** * @webref xml:method * @brief Gets the content of an attribute as a String */ public String getString(String name) { return getString(name, null); }
public String getPackageName() { return xml.getString("package"); }
/** * Returns the value of an attribute. * * @param name the non-null full name of the attribute * @param defaultValue the default value of the attribute * @return the value, or defaultValue if the attribute does not exist */ public int getInt(String name, int defaultValue) { String value = getString(name); return (value == null) ? defaultValue : Integer.parseInt(value); }
/** * Returns the value of an attribute. * * @param name the non-null full name of the attribute. * @param defaultValue the default value of the attribute. * @return the value, or defaultValue if the attribute does not exist. */ public long getLong(String name, long defaultValue) { String value = getString(name); return (value == null) ? defaultValue : Long.parseLong(value); }
/** * Returns the value of an attribute. * * @param name the non-null full name of the attribute. * @param defaultValue the default value of the attribute. * @return the value, or defaultValue if the attribute does not exist. */ public float getFloat(String name, float defaultValue) { String value = getString(name); return (value == null) ? defaultValue : Float.parseFloat(value); }
/** * Returns the value of an attribute. * * @param name the non-null full name of the attribute. * @param defaultValue the default value of the attribute. * @return the value, or defaultValue if the attribute does not exist. */ public float getFloat(String name, float defaultValue) { String value = getString(name); return (value == null) ? defaultValue : Float.parseFloat(value); }
/** * Returns the value of an attribute. * * @param name the non-null full name of the attribute * @param defaultValue the default value of the attribute * @return the value, or defaultValue if the attribute does not exist */ public double getDouble(String name, double defaultValue) { String value = getString(name); return (value == null) ? defaultValue : Double.parseDouble(value); }
/** * Returns the value of an attribute. * * @param name the non-null full name of the attribute * @param defaultValue the default value of the attribute * @return the value, or defaultValue if the attribute does not exist */ public int getInt(String name, int defaultValue) { String value = getString(name); return (value == null) ? defaultValue : Integer.parseInt(value); }
/** * Returns the value of an attribute. * * @param name the non-null full name of the attribute. * @param defaultValue the default value of the attribute. * @return the value, or defaultValue if the attribute does not exist. */ public long getLong(String name, long defaultValue) { String value = getString(name); return (value == null) ? defaultValue : Long.parseLong(value); }
/** * Returns the value of an attribute. * * @param name the non-null full name of the attribute * @param defaultValue the default value of the attribute * @return the value, or defaultValue if the attribute does not exist */ public double getDouble(String name, double defaultValue) { String value = getString(name); return (value == null) ? defaultValue : Double.parseDouble(value); }
/** * @param context * @return */ public String getPrettyVersion(Context context) { return xml.getString("android:versionName", context.getResources().getString(R.string.prop_pretty_version_default)); }
/** * @return */ public String getPrettyName() { return xml.getChild("application").getString("android:label", ""); }
/** * Used in place of element.getFloatAttribute(a) because we can * have a unit suffix (length or coordinate). * @param element what to parse * @param attribute name of the attribute to get * @return unit-parsed version of the data */ static protected float getFloatWithUnit(XML element, String attribute) { String val = element.getString(attribute); return (val == null) ? 0 : parseUnitSize(val); }
public String[] getPermissions() { XML[] elements = xml.getChildren("uses-permission"); int count = elements.length; String[] names = new String[count]; for (int i = 0; i < count; i ++) { names[i] = elements[i].getString("android:name"); } return names; }
/** * Used in place of element.getFloatAttribute(a) because we can * have a unit suffix (length or coordinate). * @param element what to parse * @param attribute name of the attribute to get * @param relativeTo (float) Used for %. When relative to viewbox, should * be svgWidth for horizontal dimentions, svgHeight for vertical, and * svgXYSize for anything else. * @return unit-parsed version of the data */ static protected float getFloatWithUnit(XML element, String attribute, float relativeTo) { String val = element.getString(attribute); return (val == null) ? 0 : parseUnitSize(val, relativeTo); }
/** * @return whether or not this manifest file needs to be updated to use fragments, as in * Android Mode 3.0 */ public boolean needsProcessing3Update() { return !xml.getChild("application").getChild("activity").getString("android:name").equals(".MainActivity"); }
public String getOrientation(Context context) { return xml.getChild("application").getChild("activity").getString("android:screenOrientation", context.getResources().getString(R.string.prop_orientation_default)); }