Android Question Compare DirAssets and DirInternal db

Similar threads

B4A Library Printing and Pdf creation
B4A Code Snippet [B4X] Bytes To File
B4A Code Snippet [B4X] Use WebView to show large images
B4A Tutorial [B4X] OkHttpUtils2 with Wait For
B4A Code Snippet [B4X] DownloadAndSave

ALBRECHT

Active Member
Licensed User
Hello,

when i compare that 2 files :

That is Because i regulary update the tables inside "strings.db" file from the "DB Brower SqlLite" tools

B4X:
'LocalStrings ***************************************************************
    Dim FileName As String = "strings.db"
    Dim TargetDir As String = File.DirInternal

    If File.Exists(TargetDir, FileName) = False Then
        File.Copy(File.DirAssets, FileName, TargetDir, FileName)
        Log("Copy File")
    Else
        If File.Size(File.DirAssets, FileName) = File.Size(File.DirInternal, FileName) Then
            Log("Same File")
        Else
            File.Delete(TargetDir, FileName)
            File.Copy(File.DirAssets, FileName, TargetDir, FileName)
            Log("Copy File Again")
        End If
    End If
Even i check with File.Size or File.LastModified, the Log line is always : "Copy File Again"

- Is it a coding mistake ?

- Or is there an other way to compare that 2 files ?


Thanks
Michel

 

ALBRECHT

Active Member
Licensed User
ok Erel, it was simply to avoid unnecessary transactions, but in fact the .db file size is less than 800Ko
 
Top