Android测试写入文本Log
生活随笔
收集整理的這篇文章主要介紹了
Android测试写入文本Log
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
寫入本地SD卡:
@SuppressLint("SdCardPath")public void writeFileSdcard(String fileName, String message) { try { FileOutputStream fout = new FileOutputStream(fileName); byte[] bytes = message.getBytes(); fout.write(bytes); fout.close(); } catch (Exception e) { e.printStackTrace(); } }測試函數:
String message="";String filename ="/sdcard/DevCv/Log/";filename += "Log_projectPoints" + ".txt";writeFileSdcard(filename, message);
總結
以上是生活随笔為你收集整理的Android测试写入文本Log的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一言九鼎是什么生肖(一言九鼎(打一数字)
- 下一篇: 吃蜂蜜有什么好处(常吃蜂蜜有这4大作用)