load Config Properties file - Android java.util

Android examples for java.util:Properties

Description

load Config Properties file

Demo Code


//package com.java2s;
import android.content.Context;

import java.io.InputStream;

import java.util.Properties;

public class Main {
    public static Properties loadConfig(Context context) {
        Properties properties = new Properties();
        InputStream s = null;// www . ja  v  a 2 s  . c o  m
        try {
            s = context.openFileInput("config.properties");
            properties.load(s);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return properties;
    }
}

Related Tutorials