All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sim.android.hardware.service.impl.ParamServices Maven / Gradle / Ivy

There is a newer version: 1.0.9
Show newest version
package sim.android.hardware.service.impl;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;

public class ParamServices {
	public static final String IP_SOCKET_UBIKSIM = "ubiksim_ip";

	public static Properties properties = null;
	
	public static void readProperties() throws IOException { 
		File myFile = new File("/sdcard/vapi.props");
		FileInputStream fIn = new FileInputStream(myFile);
		BufferedReader myReader = new BufferedReader(
				new InputStreamReader(fIn));
		
		properties = new Properties();
            properties.load(fIn);
		myReader.close();
	}
	
	public static String getProperty(String propertyName) {
		if(properties == null) {
			try {
				readProperties();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
		}
		return properties.getProperty(propertyName);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy