get Config Properties from Asset - Android App

Android examples for App:Assets

Description

get Config Properties from Asset

Demo Code


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

import java.io.IOException;

import java.util.Properties;

public class Main {
    public static Properties getConfigProperties(Context context) {
        Properties properties = new Properties();
        try {/*from  w ww.  j ava  2 s. c  o m*/
            properties.load(context.getAssets().open("config.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties;
    }
}

Related Tutorials