Android Open Source - android.bigredsnapshot Property Reader






From Project

Back to project page android.bigredsnapshot.

License

The source code is released under:

MIT License

If you think the Android project android.bigredsnapshot listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package io.evercam.bigredsnapshot.helper;
//from   ww  w.j  a v  a2s  .  c o m
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import android.content.Context;
import android.content.res.AssetManager;
import android.util.Log;

public class PropertyReader
{
  public final static String KEY_API_KEY = "ApiKey";
  public final static String KEY_API_ID = "ApiId";
  public static final String KEY_BUG_SENSE = "BugSenseCode";

  private Context context;
  private Properties properties;
  private final String LOCAL_PROPERTY_FILE = "local.properties";

  public PropertyReader(Context context)
  {
    this.context = context;
    properties = new Properties();
    properties = getProperties(LOCAL_PROPERTY_FILE);
  }

  private Properties getProperties(String fileName)
  {
    try
    {
      AssetManager assetManager = context.getAssets();
      InputStream inputStream = assetManager.open(fileName);
      properties.load(inputStream);
    }
    catch (IOException e)
    {
      Log.e("bigredsnapshot", e.toString());
    }
    return properties;

  }

  public String getPropertyStr(String propertyName)
  {
    return properties.getProperty(propertyName).toString();
  }

  public boolean isPropertyExist(String key)
  {
    if (properties.containsKey(key))
    {
      return true;
    }
    return false;
  }

}




Java Source Code List

io.evercam.bigredsnapshot.BigButtonActivity.java
io.evercam.bigredsnapshot.BigRedSnapshot.java
io.evercam.bigredsnapshot.ChooseCameraActivity.java
io.evercam.bigredsnapshot.LoginActivity.java
io.evercam.bigredsnapshot.SignUpActivity.java
io.evercam.bigredsnapshot.SlideActivity.java
io.evercam.bigredsnapshot.SnapshotRequest.java
io.evercam.bigredsnapshot.UrlStatus.java
io.evercam.bigredsnapshot.account.AccountUtils.java
io.evercam.bigredsnapshot.account.ProfileQuery.java
io.evercam.bigredsnapshot.account.UserProfile.java
io.evercam.bigredsnapshot.helper.CustomedDialog.java
io.evercam.bigredsnapshot.helper.PrefsManager.java
io.evercam.bigredsnapshot.helper.PropertyReader.java
io.evercam.bigredsnapshot.tasks.CaptureSnapshotTask.java
io.evercam.bigredsnapshot.tasks.CheckInternetTask.java