Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serialization Android intent

I'm trying to implement an application to serialize android intent and send it through a socket from client to server and deserialize it on the server.i try to serialize intent in client side with regular java serialization API but in the runtime it's saying that the intent is not serializable.is there any solution to serialize intent and deserialize it? just i need to mention that i used kryo also for serialization and deserialization but again i faced error at deserialization time. is there any solution to this ?

BR, Ra

like image 934
Furniture Sell Avatar asked Sep 02 '25 09:09

Furniture Sell


1 Answers

I would create a new Serializable object and add the parts of the Intent that you are interested in, ie, action, bundle parameters, etc.

The Intent object itself is not Serializable.

Another approach may be to write your own Parcel implemenation that stores the values in another Serializable object type and then serialize that Object to server. You can write an Intent to a Parcel using the Intent.writeToParcel() api.

like image 114
stuckless Avatar answered Sep 04 '25 23:09

stuckless