當前位置:首頁 » 安卓系統 » androidstudio輸出

androidstudio輸出

發布時間: 2024-11-28 10:36:20

⑴ Android Studio的OutputStream輸出流輸出的文件在哪裡

1、書上沒說錯,確實在哪個目錄下

按照我的步驟做,然後去分析你的問題是什麼原因

1、在Applacation下寫

try {
FileOutputStream outputStream1 = getApplicationContext().openFileOutput("my.txt", Context.MODE_APPEND);
BufferedWriter outputStream=new BufferedWriter(new OutputStreamWriter(outputStream1));
outputStream.write("aaaaaaaaa");
outputStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

2、使用模擬器運行,然後打開Device Monitor

4、如果還要問題,可以留下聯系方式或者追問

⑵ android studio怎麼在獲取對象後輸出對象內容

1、找到目錄的main先建立assets格式的文件夾
2、再把需要讀取的txt文件放入到該文件夾下。
3、在御磨利用代碼lnputStreaminputStream=getAssets().open(「txt文件的名稱」),就可以獲取鎮廳斗到輸出對象的內容了。
4、以上就是androidstudio怎麼在獲取對象後輸出對象內容伏鎮的步驟了。

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:577
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:871
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:566
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:750
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:668
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:994
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:239
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:98
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:790
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:696