
1、打开build.gradle文件,找到android节点下defaultConfig或者flavor节点下的相应配置。
2、在配置中添加需要修改的properties参数。
3、在命令行中执行编译命令时,添加需要修改的properties参数的值。
projectPath=11aa= 11
public class ConfigTool {
public static String projectPath = ""
public static HashMap<String,String>hashMap = new HashMap()
static {
Properties property = new Properties()
InputStream in = ConfigTool.class.getResourceAsStream("/config.properties")
try {
property.load(in)
projectPath = property.getProperty("projectPath").trim()
hashMap.put("huifu", property.getProperty("aa"))
} catch (Exception e) {
e.printStackTrace()
}
finally {
if (null != in) {
try {
in.close()
} catch (Exception e) {}
}
}
}
}
*.properties一般为页面消息的配置文件可以用命令直接将里面的内容变成想要的编码。1:先建立一个*.properties文件,用想得到的编码编写文件内容;
2:在磁盘上运行文件nativezascii-encodinggb2312ApplicationResources_temp.propertiesApplicationResources_zh_CN.properties
这样就可以将gb2312编码的文字内容转化utf-8编码的内容了,将此文件放入存放配置文件的路径里面,就可以解决网页的多语言显示问题了
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)