Android read configuration files under local assets

File under the local assets asset configuration file: countries.txt Format:

86;CN;China;XXX XXXX XXXX
 public static class Country {
        public String name;
        public String code;
        public String shortname;
        public String[] format;
        public int phoneLength;

        @Override
        public String toString() {
            return "Country{" +
                    "name='" + name + '\'' +
                    ", code='" + code + '\'' +
                    ", shortname='" + shortname + '\'' +
                    ", format=" + Arrays.toString(format) +
                    ", phoneLength=" + phoneLength +
                    '}';
        }
    }
c.name = args[2];
c.code = args[0];
c.shortname = args[1];
if (args.length>3){
    c.format = args[3].split(" ");
    String args2 = args[3].replace(" ","");
    if (!TextUtils.isEmpty(args2)){
        c.phoneLength = args2.length();
          

Guess you like

Origin blog.csdn.net/java9832/article/details/105647968