B4A Tutorial [B4X] TextEditor - Save and load external files - Erel    
Sep 10, 2023   
(38 reactions)-list-of-other-related-methods.129897/#content
Allow other apps to view text files using this app...-with-activityviewcontroller.73159/#content
This also allows saving the text with the Files app.
Allow other apps to view text files using this app: https://www.b4x.com/android/forum/threads/open-external...This is a B4i and B4A example, which demonstrates various external files related tasks.
116714....
B4A
Load external files, including online files, using ContentChooser.
Save to an external target...
B4A Tutorial Text files - Erel    
Nov 28, 2010   
(18 reactions) are files and databases.
We will cover text files in this tutorial.
The predefined Files object has several utility methods for working with text files which are pretty easy to use.
Files locations...) you may prefer to work with TextReader or TextWriter.
File.WriteString - Writes the given text to a new... several methods for writing and reading to files.
You can also use TextReader and TextWriter to do it manually.
Note that TextReader and TextWriter are not limited to files and can work with other...
B4J Tutorial Parsing huge text files - Erel    
Nov 24, 2013   
(5 reactions) Process_Globals
Type IpAndCount (ip As String, count As Int)
Private serializedMapFile......")
Dim tr As TextReader
tr.Initialize(File.OpenInput("", Args(0)))
Dim... build apps that handle huge files.
I downloaded a 3.7GB log file from this server. Each line represents... will go over all the lines in the file and add each ip address to a Map named ips:
Dim count... with RandomAccessFile.WriteObject. This allows you to write the whole map to a binary file.
raf...
B4J Code Snippet [B4X] AppendToTextFile - LucaMs    
Nov 30, 2021   
(11 reactions)Description: appends text to a text file ?
Author: @Erel (original code here)
Platforms: B4A, B4J, B4i
Private Sub AppendToTextFile(Dir As String, FileName As String, Text As String, NewLine As Boolean)
If NewLine Then
Text = CRLF & Text
End If
Dim out As OutputStream = File.OpenOutput(Dir, FileName, True)
Dim b() As Byte = Text.GetBytes("utf8")
out.WriteBytes(b, 0, b.Length)
out.Close
End Sub
...
B4J Code Snippet Drag and drop file into a B4XFloatTextField - Erel    
Feb 8, 2026   
(14 reactions) As String = e.GetDragboard.GetFiles.Get(0)
Try
txtFile.Text = filename
Catch
Log... txtFile As B4XFloatTextField
Private DragAndDrop1 As DragAndDrop
Private AllowedExtensions As List....HintText = "Drop file (allowed extensions: csv, xlsx, xls)"
txtFile.Update
Sub... As DragEvent)
txtFile.TextField.SetColorAndBorder(xui.Color_White, 1dip, xui.Color_LightGray, 2dip....Size = 1 And File.Exists(files.get(0), "") Then
Dim filename As String...
B4A Example Share Text File Between 2 Apps - aeric    
Jun 1, 2024   
(2 reactions)This is just another example based on the ManageExternalStorage class provided by @agraham.
It is a response to this question.
B4ARepositoryWriter - writes a text file to an "external" directory (you can view using File Explorer).
B4ARepositoryReader - reads the text file in this directory if it exist.
I guess if we are able to read a text file then it should be possible to read keyvaluestore or sqlite files.
Note: I have modified slightly the class by modify the package name...
B4A Example Import a CSV Text File Into a Newly Created SQLite Table - Mahares    
Sep 6, 2023   
(10 reactions)1. I use StringUtils library to import the CSV text file into the SQLite table. There are other ways to import like, such as CSVParser class module, RegEx.Split and TextReader, although TextReader is no longer recommended by the community.
2. The text file in this project has a semi colon as delimiter. With StringUtils, you can use whatever delimiter came with the file.
3. The column names of the table created are generated from the first row of the text file which is the header,
4. The project...
B4J Code Snippet Text File To List Variable - Mashiane    
May 23, 2019   
(2 reactions)Ola
I'm working on some random data generator so I need to be processing some lists. After I downloaded a list of countries from the interweb, I needed a way to quickly convert this into a list variable for my B4J program.
When a file is selected, its read into a list and the code generated as a B4J variable with all the names on the file.
80603...
B4J Tutorial AES Encryption Example - Encrypt Plain Text and or files - Nokia    
Aug 17, 2025   
(4 reactions)With this example, you can encrypt and decrypt plain text and files. The following options are available:
Text encoding options: Hex or Base64
Selectable key sizes: AES-128, AES-192, or AES-256
Option to embed a salt into the encrypted text and extract it for decryption
Option to embed a salt or ID into an encrypted file and extract it before decryption
File encryption using either chunked mode... jRandomAccessFile.
This solution uses the built-in cryptography features provided by Java....
B4J Tutorial [BANano] BANanoFiles - A nifty way to read a file text contents without uploading to the server - Mashiane    
May 9, 2020   
(3 reactions) example code as I needed a way to get a text file contents without having to upload to the server... is the class code:
public Sub readAsText(fr As String) As BANanoPromise
Dim promise..., "ReadFileAsText", Array(fr))
Return promise
End Sub
private Sub ReadFileAsText(FileToRead As Object...
FileReader.RunMethod("readAsText", FileToRead)
End Sub
private Sub OnLoad(event As Map) As String 'ignore
' getting our file again (set in UploadFileAndGetDataURL)
Dim...
Page: 1  
2  
3  
4  
5  
6  
7