Android Question write.Object problem i for Bitmap (return null)

Tayfur

Well-Known Member
Licensed User
Longtime User
I cheked my list on write in file.
T_bitmap is Full/ok

Untitled-0.png


Read my list in file.

Return is Null
Untitled-1.png
I cant understand it. I read mylist. After check values. Bitmap filed is Null!!!!
where is the problem.

B4X:
Sub sample()
 
 
'    Type T_MYTypes( _
'    URL As String, _
'    T_Bitmap As Bitmap, _
'    State As Boolean)
' 
 
    Dim  mylist As List 
    Dim a1, a2 As T_MYTypes
 
    a1.Initialize
    a1.State=True
    a1.URL="image 1"
    a1.T_Bitmap.Initialize(File.DirAssets,"red.jpg")
 
    a2.Initialize
    a2.State=False
    a2.URL="image 2"
    a2.T_Bitmap.Initialize(File.DirAssets,"green.jpg")
    mylist.Initialize
    mylist.Add(a1)
    mylist.Add(a2)
    Dim raf As RandomAccessFile
 
 
 
    raf.Initialize(File.DirDefaultExternal,"xxx.dat",False)
    raf.WriteObject(mylist,False,raf.CurrentPosition)
    raf.Close
 
    DoEvents
 
    Dim raf1 As RandomAccessFile
    Dim newlist As List
    newlist.Initialize
    raf1.Initialize(File.DirDefaultExternal,"xxx.dat",False)
    newlist=raf1.ReadObject(raf1.CurrentPosition)
    raf1.Close
 
 
End Sub
 

Tayfur

Well-Known Member
Licensed User
Longtime User
@DonManfred , I hope see same file size.
I try 4 diffrent way
and result is in pictures.

files size (My database with in pictures) x 5 = file size (may databese without pic + 8 picture files)

8 pic+db= 1mb
80pic+db=10mb
400pic+db=50mb

50mb files problem for sharing ;)

this database for backup. small size is better for sharing.
I will use @Informatix 's Archiver for ZIP files.

thanks for helps.


Untitled.png
 
Upvote 0
Top