Tobias Reich
Tobias Reich

Reputation: 5160

Android Network Transferring Objects

For my Android project I need to transfer some simple (POJO) Java objects between two mobile phones. The aim is to connect them together via WiFi (Tethering) and to transfer some basic objects like:

int id;
String name;
float positionX;
...

From my Java experiences I was thinking about using a simple socket connection but since I'm using Android I thought there might be a better way of doing it. Has anyone experiences with this? What would you suggest?

Upvotes: 1

Views: 258

Answers (1)

claesv
claesv

Reputation: 2113

Unless the data is very complex, I'd convert the objects to JSON when sending them to the server, and then back to POJO's when reading them on the client.

Upvotes: 2

Related Questions