當前位置:首頁 » 安卓系統 » 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怎麼在獲取對象後輸出對象內容伏鎮的步驟了。

熱點內容
scratch少兒編程課程 發布:2025-04-16 17:11:44 瀏覽:627
榮耀x10從哪裡設置密碼 發布:2025-04-16 17:11:43 瀏覽:356
java從入門到精通視頻 發布:2025-04-16 17:11:43 瀏覽:73
php微信介面教程 發布:2025-04-16 17:07:30 瀏覽:297
android實現陰影 發布:2025-04-16 16:50:08 瀏覽:787
粉筆直播課緩存 發布:2025-04-16 16:31:21 瀏覽:337
機頂盒都有什麼配置 發布:2025-04-16 16:24:37 瀏覽:202
編寫手游反編譯都需要學習什麼 發布:2025-04-16 16:19:36 瀏覽:800
proteus編譯文件位置 發布:2025-04-16 16:18:44 瀏覽:356
土壓縮的本質 發布:2025-04-16 16:13:21 瀏覽:582