ファイルをコピー*.txtしてフォルダーに貼り付けます/frameworks/opt/telephony/src/java/android/telephony。から読みたいのですSmsManagerが、実行する"emulator + adb logcat"と、ファイルが見つからないことがわかります。
SmsManager.javaとの両方のファイルtextfile.txtが同じフォルダーにあります。
内部の私のコードSmsManagerは次のとおりです。
try {
FileInputStream fstream = new FileInputStream("textfile.txt");
// Get the object of DataInputStream
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String line;
// read every line of the file into the line-variable, on line at the time
while (( line = br.readLine()) != null) {
Log.i(TAG, line+"@@@@@@@@@@@@@@@@@@@@@@@@@@");
}
in.close();
} catch (java.io.FileNotFoundException e) {
Log.i(TAG, "File didnt found");
} catch (java.io.IOException e) {
Log.i(TAG, "File didnt found");
}
何が問題なのですか、またはファイルを見つけるにはどこに保存する必要がありますか?