Friday, July 2, 2010

Top Mobile OS in United States

Source: StatCounter Global Stats - Mobile OS Market Share

Using java.util.Properties in Servlet to save User Preferences

import java.util.Properties;




String propertiesFileName = "my_properties.txt";

SAVE PREFERENCES:
Properties unsavedProperties = new Properties();
unsavedProperties.setProperty("my_name", "Uki");
OutputStream propOut = new FileOutputStream(new File(propertiesFileName));
unsavedProperties.store(propOut, "My Server properties");

LATER READ THE SAVED PREFERENCES:

InputStream inStream = new FileInputStream(propertiesFileName);
Properties savedPropeties = new Properties();
savedPropeties.load(inStream);
String myName = savedPropeties.getProperty("my_name");