i m trying to develop an aap. in android which behaves like a client/server architecture.
my app communicates messages to server to rout to specified clients..
i have heard that this could be accomplished by a REAL TIME MESSAGING client.
i have to pass only text based data. no audio/video streaming
You can read up on XMPP:
http://en.wikipedia.org/wiki/Extensible_Messaging_and_Presence_Protocol
http://xmpp.org/
There are client apis available for Android, I have personally used asmack:
http://code.google.com/p/asmack/
Related
I'm building an Android application. So with this app I get the data from device throught bluetooth.
For this, I don't have problems. Now I want to send in real time the data at the server. But I don't know what type of Web Service I must building, and I don't know what library of Android that I must used.
Can we help me ?
A lot of people ask the questions about real time data transfer. There are few technologies I am aware of, and may help other developers
1- Socket.iO
Socket.IO enables real-time bidirectional event-based communication.
It works on every platform, browser or device, focusing equally on reliability and speed.
2- EventBus
EventBus is a publish/subscribe event bus for Android and Java.
3- MQTT Server
It was designed as an extremely lightweight publish/subscribe messaging transport.
4- Lightsteamer
Lightstreamer is your one-stop shop for push notifications, data streaming, and realtime messaging. Power web, mobile, and IoT apps with realtime data.
It should be noted that lightstreamer is not free
Is it possible to create a websocket / VOIP that will connect to a device (android device) to make a call or a text message? is there an existing app for this or tutorial that i can base my project?
Im planning to create an app and web app that can access my phone to make calls and text.
You can use XMPP based project to have a chat system and voice/video call
.I recommend you to use Ejabberd .it is so nice platform that provide amazing features like chat ,voice/video call and also it is massively scalable around 1 million connection I think in one node.
And you can use variety of Xmpp library in Android that you can see bellow link XMPP Libraries
I want to develop a system in which data is being shared between DESKTOP app and Android app.
After searching I have found that I need a server in between them. But I can't figure out what the server is? How do I create it? And how will it help me connect my two platform devices?
Desktop App will receive data from android app. And manage data. It will also be used to send notifications/messages to android apps.
Android App will be used to input data and send it to desktop app. It will receive updates/notifications from desktop app.
Now how do I connect these two? I basically need a common database for real-time data sharing and notifications.
Edit: I am building the desktop app using C# and android app using Java.
Edit2: Maybe I can host the database on CPANEL or 000webhost using PHP. And then connect it with both android and C#. Is this the correct way to do it? Is it possible to connect it with C#? I know it can be connected with Android, not sure about C#.
You don't necessarily need a database. You need a common network protocol between two applications.
All network communication is done via sockets. You need a library that allows you send data over sockets. For example, here's an Android guide that is about sockets.
A socket binds to a specific port of a computer, essentially making it a "server". Much like how web servers all expose port 80, and communicate over a protocol called HTTP. Which is important because it is up to you to decide what protocol your applications communicate between each other, because the socket just sends bytes - it doesn't care what you send or how, as long as it travels to a port on a particular server. It also won't parse the data for you, that's up to your application to handle. For example, how would your desktop app know the Android device sent it a text message, or some image to be displayed, or an address to show a map?
All in all, your reason for wanting a desktop application rather than a web application is not entirely clear. Parsing only the body of HTTP payloads from different HTTP paths that are mapped to different methods (which is typically referred to as a REST API) is much simpler than building your own protocol. You might as well build a desktop GUI over top of a web server.
Making the desktop app send updates back to your mobile application is basically impossible using a bi-directional socket architecture. Your Android should not be running an open server socket continuously just for your application, mostly because battery drain, but because its network address is subject to change frequently, and you therefore additionally need a registration server from which your device would reconnect to. Such a service exists as Firebase Cloud Messaging, which is a rebranding of the GCM technology made by Google, and it can be used to send push notifications to devices, but only with small data payloads.
See here about what activities occur on an Android device for notifications. How does push notification technology work on Android?
Back to the question about databases. Suggesting one to use is too broad. And you only need one of those if you want to store and/or query or join datasets. The same computer running the desktop app can install and run whatever flavor of database you prefer, whether it's a relational database or noSQL database, entirely up to you. The only realtime databases I know of are RethinkDB and Firebase.
You could also just hold a SQLite file which is as good as a small scale database (even the SQLite documentation recommends it for low traffic web sites).
Firebase supports web interface, so you can develop html code and integrate in desktop app, something like web integration in windows form application
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.
What I'm trying to achieve is a connection between a users browser (logged in with his Google account) and an Android application on his phone (also logged in with the same Google account). I want to send a bunch of text formatted as JSON from GWT to the device and the other way round too.
My first thought was to send a C2DM ping to the Android devices and wake up a service witch connects to the App Engine server or the GWT client directly (if that's possible).
What I'm doing now is a socket with the Channel API from GWT to App Engine. And for a large amount of text I would just send a notification via the Channel to the GWT client, which then gets the data with a RPCall. Missing is the connection between the App Engine and the Android application. What I could do is C2DM for one direction and simple HTTP requests for the other direction. I don't like this solution, because C2DM can be really slow some times. Is there a solution to connect these two (GAE & Android app), or even a better without App Engine and a connection between the GWT client and the Android client directly ?
Thanks in advance :)
If I understand your question correctly, you're looking to push messages from a server (in your case GAE) to an Android app without using C2DM? In that case you can give pubnub a try.
Edit: of course you have a few options in this area (another one being Urban Airship) but you'll notice that they're not cheap!
I'm not sure what you mean by "a connection between GWT and Android directly" -- do you mean a connection between a GWT client and an Android phone? If so, there's not a good way to do that without installing client software; you'll need some sort of server to proxy messages.
So, given that you're using App Engine and GWT already, and C2DM is potentially too slow, you could wrap up an HTML page on the Android and use the Channel API. Then when you get messages, have your javascript client (again, running on Android) call the container to do anything you want.
This is nice because you have parity in the message delivery between your browser clients and your Android clients. It's not nice because it's not native and probably will eat battery, unlike C2DM.
Ideally I know you'd like a native API for Android to consume Channel API messages. You can vote for this issue but I unfortunately can't provide an ETA for it: http://code.google.com/p/googleappengine/issues/detail?id=4189