私はプロパティを格納するために問題を抱えているが、アンドロイドにファイルを、これはコードされたファイル:Androidアプリ
Properties prop = new Properties();
prop.load(context.getResources().openRawResource(R.raw.config));
Utils.log(context,"db.version =>"+ prop.get("db.version"));
prop.setProperty("db.version", "2");
String fileName = context.getResources().getString(R.raw.config);
FileOutputStream fos = new FileOutputStream(fileName);
prop.store(fos, "");
私はロード(および印刷)しようとすると、問題はありませんが、ときに私私の新しいセットを保存しようと、私はここにLogCatにFileNotFoundException
を受け取る:事前に
03-22 18:05:03.262: INFO(11536): db.version =>1
03-22 18:05:03.262: ERROR(11536): java.io.FileNotFoundException: /res/raw/config.properties (No such file or directory)
感謝を...
これは 'pro.load(YOUR_CLASS_NAME.class.getResourceAsStream(" config.properties "));' –
か、 config.properties "));' –