native app to server communication - android

I am writing a mobile trading app (android/ios) and i need suggestions on the best way to connect the app to the server (messageQ)
If i use raw TCP connection , would my users have a problem if they are behind corporate wifi's (protected by firewalls)? If yes, in that case, is web socket a better solution?
With the backend server, after researching with zeroMq, i believe a full fledged broker like rabbitmq is a better option to start with. Now , if i use a web socket connection from my native app, Rabbit MQ has a sockJS-AMQP bridge . But i am not sure, if there is a java and iOS web socket client to speak to sockJS server .
Any experienced views is greatly appreciated

Have you considerer to use MQTT?
If you don't need AMQP you can also use directly an MQTT broker, such as http://mosquitto.org/ or http://www.hivemq.com/
Here (https://github.com/owntracks) you can find some ready libraries for iPhone and Android.
In order to solve the the firewall problem MQTT is available over HTTP.
You can read here:
http://www.hivemq.com/mqtt-over-websockets-with-hivemq/
or
here http://mqtt.org/wiki/doku.php/mqtt_over_websockets
This post can also help you : (https://www.ibm.com/developerworks/community/blogs/sowhatfordevs/entry/using_mqtt_protocol_advantages_over_http_in_mobile_application_development5?lang=en)
For a iPhone application I used directly MQTT and as server RabbitMQ with the MQTT plug-in
http://www.rabbitmq.com/mqtt.html
I hope it can be usefulĀ 

Related

Android/iOS client consumes WCF Duplex service

I am trying to build a server/web service which provides APIs to Android/iOS client. I am using WCF service and clients can send request to server successfully. Now, I am going to make server enable to ping client to notify that there some changes in server and client need to synchronize data.
The question is: Is it possible to enable my server to ping client (Android/iOS), I knew that it is possible for Windows client by using wsDualHttpBinding but I am not sure about iOS and Android client. Anyone can help me to make it clear? Any solution is appreciated.
I don't think you can do it. For start, while wsDualHttpBinding is intended to be interoperable I don't beleive in practice it is supported by any otehr framework than WCF. Then wsDualHttpBinding uses a client callback url that the server needs to contact. This url is not going to be accessible on a phone. You should use websockets, long polling or some proprietary push mechanism of the device os.

Realtime P2P communication between mobile devices

I am building a mobile device that needs to send realtime information to other devices. I have considered XMPP but I do not have a server, so the communication must be only between the devices.
Is there a way to communicate using XMPP between mobile devices without a server (Or using the mobile devices as servers)?
Is Sockets a good idea ? i.e. Having a ServerSocket and client Socket and communicating this way.
Is there a smarter way? I have heard of jWebSocket but I dont really know how it works or if it's worth it.
EDIT
The process is as follows:
I'm using Parse as a server/backend http://parse.com
When the user runs the app, a user list is retrieved from the parse server
The user then has (Could have) the ip of other clients and then attempt to communicate with them.
Problems
1. Parse does not support a XMPP server or other type of servers
You might look at using an IRC client library like http://jerklib.wikia.com/wiki/JerkLib_Wiki. This way you can use a public IRC server to communicate with your other devices...
I've not used it, but I did bookmark it for further reading because I thought it a novel concept ...
I hope it helps...

Chat Protocols and Client to client connection?

I'm looking for a protocol/API to implement a video chat application. In this app, the clients connect to a server and when two clients start chat, they don't send/receive data to/from server! Actually I want the clients connect to each other straightly. I want this on iPhone and Android.
I've searched, and found XMPP protocol, but I'm not sure it let p2p connection.
Anyway, is it possible?
you can work for the XMPP Protocol which is specially made for chatting purpose.
That helped me a lot in my work. They might have an android version out now.
you can use WIFI or BlueTooth to do P2P apps.

Android app, open connection to to mobile devices

what is the best way to create a two way constant communication between a server and an android app?
When I say constant communication, I mean client asking server for data or server constantly pushing data to clients.
From what I saw, I can't use websockets since they are designer for server/browser setups. Is that right? If so, what is the alternative?
Is there free frameworks to work with this in Android?
What I am trying to do is an application that works like a chatting but for multiple people. So they all will get in one "room or channel" on their devices, and then interact with each other, in a way handdled by the server.
Thanks!
As far as I know , one possible way is using a web service where the client can connect to the server , if the web service is RESTFul there are many libraries to access it , one of them is the apache HTTPClient , for the server pushing the only way I know is C2DM for pushing data to clients.
For continuously-open data connection, you may use Sockets. But you should also consider the fact that an always-open connection will drain your battery quickly too. For more details, read this and this
You may want to look at AutobahnAndroid:
https://github.com/tavendo/AutobahnAndroid
which provides native Android/Java WebSocket client framework (plus WAMP = PubSub/RPC over WebSocket .. http://wamp.ws).
This is fully interoperable with WebSocket servers that server browser clients.
The AutobahnXX libraries (where XX = Python, JS, Android) are Open-Source (Apache 2.0). We (Tavendo) are offering a commercial virtual appliance based on Autobahn: http://autobahn.ws
Disclaimer: I am author of Autobahn and work for Tavendo.
But keeping the connection running on the background on iOS and Android devices does drain the battery, for people who have this issue, I suggest using push notifications when the app is not on the foreground.
From what I saw, I can't use websockets since they are designer for
server/browser setups. Is that right? If so, what is the alternative?
Websocket is an IETF/W3C protocol, so it is not confined to a specific client platform. You can use Android websocket to get a two-way communication between Android and server side. For Android websocket client, I recommend using AndroidAsync. It has all websocket API that you need to establish the communication link and exchange data between Android and the server.

Socket communication in android

I am a newbiee in socket communication....android client,
I am facing a problem to communicate my android client to C# server using TCP protocol only so that i can when my server queries some data or information to the android client, the client responds back. communication will be over Wi-fi.
plz guide.
Any help is appreciated...
Thanx
Android Developers
has plenty of docs on how Android does that -- there is no shortage of stuff ready

Categories

Resources