1、配置properties文件
先创建properties文件,存放在安卓工程文件的assets文件夹下
创建后的文件目录结构如下
文件内容按照“参数=值”的键值对形式组织
2、配置文件的读取
以下是读取config.properties配置文件的例子:
// 读取参数配置
Properties props = new Properties();
try {
props.load(getApplicationContext().getAssets().open("config.properties"));
} catch (IOException e) {
//e.printStackTrace();
AlertDialog.Builder dialog = new AlertDialog.Builder(this