Back to project page streaming_project.
The source code is released under:
GNU General Public License
If you think the Android project streaming_project listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.streaming.streaming; /*w w w .j a v a 2 s.c o m*/ import android.content.Context; import android.content.res.AssetManager; import android.util.Log; import java.io.IOException; import java.io.InputStream; import java.util.Properties; // reference: http://khurramitdeveloper.blogspot.ca/2013/07/properties-file-in-android.html public class AssetsPropertyReader { private Context mContext; private Properties mProperties; public AssetsPropertyReader(Context context) { mContext = context; // Constructs a new Properties object. mProperties = new Properties(); } public Properties getProperties(String FileName) { try { /** * getAssets() Return an AssetManager instance for your * application's package. AssetManager Provides access to an * application's raw asset files. */ AssetManager assetManager = mContext.getAssets(); /** * Open an asset using ACCESS_STREAMING mode. */ InputStream inputStream = assetManager.open(FileName); /** * Loads properties from the specified InputStream. */ mProperties.load(inputStream); } catch (IOException e) { Log.e("AssetsPropertyReader", e.toString()); } return mProperties; } }