brodmuehler Active Member Licensed User Longtime User Apr 27, 2015 #1 Hi I want to write data to a file every second. It should also be possible to interrupt the data flow and then restart it again without loosing the existing data, meaning that new data will just be added to the existing file. Could someone perhaps advise what the best concept would be to do this? Thanks a lot. Kind regards Rene
Hi I want to write data to a file every second. It should also be possible to interrupt the data flow and then restart it again without loosing the existing data, meaning that new data will just be added to the existing file. Could someone perhaps advise what the best concept would be to do this? Thanks a lot. Kind regards Rene
eurojam Well-Known Member Licensed User Longtime User Apr 27, 2015 #2 you can use a textstream to write to a file. If you open the file in append-mode, the data will be added to the existing file (see http://www.b4x.com/android/help/files.html#textwriter). Alternativly you can use a sqllite database to save your data (see https://www.b4x.com/android/forum/threads/sql-tutorial.6736/) stefan Upvote 0
you can use a textstream to write to a file. If you open the file in append-mode, the data will be added to the existing file (see http://www.b4x.com/android/help/files.html#textwriter). Alternativly you can use a sqllite database to save your data (see https://www.b4x.com/android/forum/threads/sql-tutorial.6736/) stefan
brodmuehler Active Member Licensed User Longtime User Apr 27, 2015 #3 Great. Will give it a try but seems to be what I need. Thanks a lot. René Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Apr 27, 2015 #4 Make sure to call TextWriter.Flush if it is important that data will not be lost in case of a crash. Upvote 0