Sending devices and positions real time data in separate array

ssan7 years ago

What is the reason of sending devices and positions data(websocket) in a separate array instead of sending in the same array?

I am trying to develop a native Android mobile app using Traccar server. In the dashboard of the app, I want to show information of devices such as device name, status, lastupdate time along with the address field which is part of positions array. Since the address is part of the different array, thinking of merging data from the both the arrays(devices and positions) at the client end and show relevant information on the dashboard.

dashboard

What is the best way to achieve to implement?Any performance issues with merging 2 arrays? Is any better way to implement it.

Thanks

Anton Tananaev7 years ago

Devices and Positions are two completely different entities. One Device can have more than one Position. I don't see any reasons for merging the two. What exactly is the problem in dealing two separate objects?

ssan7 years ago

I am trying to update real-time device status from "Devices" array and address field from "Positions" array into the single card view item in Android as shown in this link. Since Devices and Positions are pushed in the separate array, I am facing problem while binding into card view item.

Maybe I am missing better way to handle it?

Anton Tananaev7 years ago

I still don't see what the problem is. If you want to display both in the same card, just combine them in your Android code.