1

I am planning to develop a Java server to share info (serialized objects) among Android devices. I need push technology, which I will implement with the Observer Pattern in the server, registering all active devices. Of course, I would use serializable Java objects and there should be no problems here...

But, will I have problems if I want to use this same server with Apple devices too? Or will this kind of architecture only work in a Java environment? I do not know if ObjectInputStream and ObjectOutputStream in the server socket will be able to deal with the received Objective C objects and if Apple devices will be able to deal with Java objects sent by the server.

Thanks a lot!

1

2 Answers 2

1

java streams works with java platform only. You cant transfer object using ObjectInputStream/ObjectOutStream with objective C. But there are other solutions you can use to connect with objective c like like you can sent text data via XMLfiles of u can use SOA architecture using HTTP protocol to sent and receive data via web services and data format can be either in xml/json with is understandable by both plateforms

Sign up to request clarification or add additional context in comments.

2 Comments

Now I have the same question as in the other answer... How can I keep track of devices connected to the server if ws do not have state?
this can be done by your own programming logic, create a a map or list according to your requirement, to set or remove attribute if it is added on other side of the application and sync the state of both application accordingly
0

You should consider using REST or SOAP there are pleanty of API out there, instead of Object Streams - those will not work as neither Java nor Objective-C is able to handle non Native Serialized Objects.

7 Comments

I had thought about this option, but ws do not maintain state, all calls to any ws should be independent. So... how could I keep track of the active devices in order to share the info among all connected devices?
Long Polling may be an option - it is commenly used in similar web applications...
Have a look at this stackoverflow question stackoverflow.com/questions/6099054/…
Also there are Java API for IOS and Android push notifications - even so you will need to seperate implementations...
Ok, so from what you say I should use some kind of third party API. Is there anyone that works with Android and iOS with the same implementation? Thanks.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.