讀取properties文件的Android庫:android-properties

jopen 10年前發布 | 22K 次閱讀 Android開發 移動開發 android-properties

這是一個Android庫提供一種簡單的方式來讀取存儲在assets文件夾中的properties文件。你只需要擴展AssetsProperties并使用@Property注釋來調用自動屬性映射。

示例:

assets/config.properties

int_value=23
flag=true
tax=2.3f

Config.java

public class Config extends AssetsProperties {

  @Property("int_value") int intValue;
  @Property boolean flag;
  @Property float tax;

  public Config(Context context) { super(context); }
}

讀取properties文件的Android庫:android-properties

項目主頁:http://www.baiduhome.net/lib/view/home/1410852868601

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!