Code example for Properties

Methods: getPropertyload

0
 
		// Read from the /assets directory 
		try { 
			AssetManager assetManager = resources.getAssets();
			InputStream inputStream = assetManager.open("recorder.properties");
			Properties properties = new Properties();
			properties.load(inputStream);
			serverIP=properties.getProperty("SERVER_IP","10.0.2.2");
			port=properties.getProperty("SERVER_PORT","8080");
			sessionName=properties.getProperty("SESSION_NAME","bot-bot-recorder");
			serverName=properties.getProperty("SERVER_NAME","");
			System.out.println("The properties are now loaded");
			System.out.println("properties: " + properties);
		} catch (Exception err) {
			System.err.println("Failed to open microlog property file");
			err.printStackTrace();
		} 
	} 
	 
	public static void setResources(Context context){
Contextual code suggestions in your IDE  Get Codota for Java