Hi all,
I need to mantain this data globally inside a code module and accessible on main module:
And write/read like this:
Currently I write and read fields, but after a bit if I read just returns void byte array or strange characters, so can't get data I wrote and Log show me strange data.
I have same issue even with keys and values as strings:
Any suggestion on this?
Many thanks
I need to mantain this data globally inside a code module and accessible on main module:
B4X:
Type KeyValuePair(key() As Byte, val() As Byte)
Public field(10) As KeyValuePair
B4X:
Dim Title() As Byte = "This is the title"
Dim Message() As Byte = "This is the message"
'write
field(2).key = "title".GetBytes
field(2).val = Title
field(3).key = "message".GetBytes
field(3).val = Message
'read
Dim notificationTitle() As Byte = field(2).val
Dim notificationMessage() As Byte = field(3).val
Currently I write and read fields, but after a bit if I read just returns void byte array or strange characters, so can't get data I wrote and Log show me strange data.
I have same issue even with keys and values as strings:
B4X:
Type KeyValuePair(key As String, val As String)
Public field(10) As KeyValuePair
B4X:
Dim Title As String = "This is the title"
Dim Message As String = "This is the message"
'write
field(2).key = "title"
field(2).val = Title
field(3).key = "message"
field(3).val = Message
'read
Dim notificationTitle As String = field(2).val
Dim notificationMessage As String = field(3).val
Any suggestion on this?
Many thanks
Last edited: