mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
incorporate androidlib
This commit is contained in:
parent
20cf3f0825
commit
5eb5cd1421
63 changed files with 1451 additions and 108 deletions
|
|
@ -0,0 +1,36 @@
|
|||
package com.geeksville.mesh.android
|
||||
|
||||
import android.content.Context
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.PrintWriter
|
||||
|
||||
/**
|
||||
* Create a debug log on the SD card (if needed and allowed and app is configured for debugging (FIXME)
|
||||
*
|
||||
* write strings to that file
|
||||
*/
|
||||
class DebugLogFile(context: Context, name: String) {
|
||||
val stream = FileOutputStream(File(context.getExternalFilesDir(null), name), true)
|
||||
val file = PrintWriter(stream)
|
||||
|
||||
fun close() {
|
||||
file.close()
|
||||
}
|
||||
|
||||
fun log(s: String) {
|
||||
file.println(s) // FIXME, optionally include timestamps
|
||||
file.flush() // for debugging
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a debug log on the SD card (if needed and allowed and app is configured for debugging (FIXME)
|
||||
*
|
||||
* write strings to that file
|
||||
*/
|
||||
class BinaryLogFile(context: Context, name: String) :
|
||||
FileOutputStream(File(context.getExternalFilesDir(null), name), true) {
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue