load Properties File - Android java.util

Android examples for java.util:Properties

Description

load Properties File

Demo Code


//package com.java2s;

import android.content.Context;

import java.util.Properties;

public class Main {
    public static Properties loadProperties(Context context) {


        Properties props = new Properties();
        try {/*from   w ww  . ja  v  a2s. c  o  m*/
            int id = context.getResources().getIdentifier("androidpn",
                    "raw", context.getPackageName());
            props.load(context.getResources().openRawResource(id));
        } catch (Exception e) {
            // e.printStackTrace();
        }
        return props;
    }
}

Related Tutorials