Android examples for java.util:Properties
write Properties File
//package com.java2s; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.Properties; public class Main { public static void writePropertiesFile(String filename) { Properties properties = new Properties(); try {/*ww w. jav a 2 s. c o m*/ OutputStream outputStream = new FileOutputStream(filename); properties.setProperty("username", "myname"); properties.setProperty("password", "mypassword"); properties.setProperty("chinese", "asdf"); properties.store(outputStream, "author: pengyixing@sina.com"); outputStream.close(); } catch (IOException e) { e.printStackTrace(); } } }