Background: Thanks to help of this community I've been able to create quite nice hobby app interfacing external devices - my friend have many models I can't test personally and it happens that those behave "slightly" different that I expected reading specs To diagnose problems I need debug file created on user devices (here is the prblem) and sent to me (this part is simple).
The problem: is log must be created sequentially as data comes-in asynchronously (from USB or BT serial) - so I can not first make a big list and write it to file at the end or later (similar to: Can't write file to SHARED directories on API31 (Android 12) - #15 by TIMAI2 but I can't apply previous solution).
I log immediatelly when : setting state, sending data to BT/USB (start), on-after-data-read from BT/USB, when polling can not fetch anything new for prolonged time (just point in code)...
(For a while, I've make a workaround being : appending to list in memory and flushing it to file on 10 sec timer - works for now at low data volumes and providing app does not fail - but it is not real unix style crash-proof log).
Regards and thanks for your interest and support (as always).
I just do not know how to do simple Log(textToLog) that would write textToLog into file (preferable open beforehand by call to LogOpenOrCreate (filename) ).
What I need is that text written in any call is in the file after all events Log'ed before.
If I just call AppendFile it will not always keep order.
regards, Kuba