Android Question B4XSerializator issue/bug

techknight

Well-Known Member
Licensed User
Longtime User
I am trying to send a custom type object that contains a map using the B4XSerializer thing.

But I keep getting this error:

java.lang.RuntimeException: java.lang.RuntimeException: This method does not support arrays of primitives.

Here is the code:
B4X:
    Dim DataPacket As StatCommand
    DataPacket.Initialize
    DataPacket.Command = "RosterInfo" 'Sending roster tables only.
    Dim RosterMap As Map
    RosterMap.Initialize
    RosterMap.Put("HomeRoster", HomeRoster)
    RosterMap.Put("GuestRoster", GuestRoster)
    RosterMap.Put("PlayersOnCourt", PlayersOnCourt)
    DataPacket.Data = RosterMap  
  
    If Remote1Status = 3 Then 'Send roster tables to stat remote 1.
        If AstreamRemote.IsInitialized = True Then AstreamRemote.Write(ser.ConvertObjectToBytes(DataPacket))
    End If
  
    If Remote2Status = 3 Then 'Send roster tables to stat remote 2.
        If AstreamRemote2.IsInitialized = True Then AstreamRemote2.Write(ser.ConvertObjectToBytes(DataPacket))
    End If

thoughts?
 
Last edited:

techknight

Well-Known Member
Licensed User
Longtime User
I think I found the problem. my PlayersOnCourt is actually an array of two ints. So its sending the pointer instead of the whole array.
 
Last edited:
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
I dont even know what a primitive is. Googling it didnt really help either. As I have mentioned in the past, I came from VB6 land where none of that existed.
 
Last edited:
Upvote 0
Top