Firebase XMPP Protocol Vs HTTP Protocol - android

Currently I am planning to use Firebase Cloud Messaging with my Android and IOS APP.
In Firebase there are two type of protocol HTTP and XMPP, so my question is when to use which protocol. In which scenario which protocol performs the best.
Thank you all in advance.

From what source you have got that Firebase does not work in emulator!! I am developing an app using genymotion emulator and it works good. Also about HTTP and XMPP what protocol you use depending on the server you will be using. HTTP is simple to use and a lot of people go with it while XMPP is complicated to implement on the device and server as well.
But XMPP may be harder it supports downstream and upstream messages means you can also send a message from a device to your server. But XMPP is good as it does not take a lot of charge and battery.
But nearly everyone use HTTP. And implement upstream messages by your own implementation!!

IMO this does not matter a lot pick the one which u feel more comfortable with.
Only thing I can state is that XMPP is protocol created for communication so if your notifications consist of short frequent messages pick this one, otherwise pick HTTP, which is more commonly used
Sincerely I have experience just with HTTP and it works really well

According to my view, use HTPP. because XMPP requires HTTP more than HTPP requires XMPP.
XMPP is an open standard technology protocol used to presence indicator and instant messaging, while for HTTP had good features and the same time it works better than XMPP.

Related

Android | Push notifications on local network

I've been doing a lot of research without success on finding a solution to my (simple) problem. I'm building an application that does not requires to be connected to the internet but it does consumes a restful API from a server installed in the local network LAN.
Currently I'm dispatching a HTTP request every minute to see if there were any changes in the DB and alert the user of said changes. However this is not very efficient and it results in a poor performance / battery drain.
I've heard that push notifications can be implemented using Google cloud messaging, but that is not an option since it requires to go through google servers, in other words, internet.
I'm using Square's Retrofit framework for handling HTTP requests on Android, and PHP + Laravel on the server side.
Is there a way to send push notifications? If not, is 'long polling' a good practice in Android? Will it even work with Retrofit?
On server side you can use an XMPP server, there are some XMPP servers such as Openfire, ejabberd and SleekXMPP. Please have a look at them.
On Android side you can use a client library e.g Smack or Xabber, the mobile library will automatically update with notifications or events using listeners.
I hope this helps.
I have no idea hot it works, but have you looked into specific packages like this one?
https://github.com/davibennun/laravel-push-notification

instant messaging over xmpp or websocket

i have the project requirement in which i want to make an instant messaging app in android/iphone and may be in future it supports voip and video chatting.
Now i have 2 choices
1) xmpp - it is application layer protocol for IM, which is almost 10 year old, and it has lot of extensions which support voip or may be video chatting, online/offline status and lot of other features. It is accepted by all big companies like whatsapp,fb,Skype etc
Also I heard that google has moved away from this protocol because of vulnerability.
2) websocket - it is tcp layer protocol which provides a full duplex communication over a single tcp connection and it’s new and it was standardised by IETF in 2011.i don’t know whether this protocol is mainly used for IM. but i know that it can be done as it is in tcp layer. And i didn’t saw or heard any features/extensions of web socket other than the 4 methods(i.e onOpen, onClose, onMessage and onError). so it means if i choose this i have to make my own methods of online/offline status(may be sending a frame in every “x” seconds/minute), voip, message delivery information and other features etc.
I am confused, which one i choose, xmpp or web socket, in terms of development, server handling cost, security, session handling management, browser support etc.
If i am wrong anything about these 2 protocols then please correct me.
THANKS IN ADVANCE
Google didn't find a vulnerability in XMPP.
You can use XMPP over WebSockets using draft-ietf-xmpp-websocket, which will soon be an RFC.

Is there a way to implement GCM (or CCS) with a server using c++?

I'm working on an App that I've made for both iOS and Android. On the iOS side, I use a constant TCP connection and JSON messages for the push notifications. I want to do the same thing for the android version, however I'm not sure if it's possible. I think using the Cloud Connection Server http://developer.android.com/google/gcm/ccs.html is the way to go, however it only shows samples for Java and Python. Is it possible to use this in c++?
You can choose whatever programming language to desire to implement the server side. The question is whether you can find an easy to use XMPP C++ library for connecting to the Cloud Connection Server.
I assume it will be easier to find an HTTP C++ library for sending HTTP requests to the GCM HTTP Connection Server. If you are not planning to use the upstream functionality (device to cloud), you don't need to go though the trouble of implementing/using the XMPP protocol.

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.

Is it possible to have a XMPP module inside a Tomcat server?

I'm posting this here because the thread I made on programmers stackexchange didn't get any answer and I need an answer for this rather fast, so here we go:
For a school project we are looking to implement push like technologies in our Android app, we need to send push messages from a server (Tomcat) to the Phone (Android).
After doing some research I've found that XMPP would be a good option for achieving this type of push notifications, now my problem is how I should integrate this with our Tomcat server where all the information and events will happen as well as where all our other pages are.
Is it at all possible to have a XMPP server or module running inside of Tomcat or can I build my own lightweight module(I was thinking something like a servlet) to handle this?
If you have any better ideas on how to achieve push notifications I would be really glad to hear them, whether it be using a totally different approach then XMPP (I've looked at long polling, MQTT and some other things) or some other way to integrate the solution into Tomcat.
The requirements we have is that we must use Tomcat and Android 2.1 (so C2DM is not an option) and set up push notifications between these.
You can probably run some servers within Tomcat, but I don't think you really gain anything from this setup with respect to XMPP. You will in effect have a server running inside of another server.
The only advantage I can see with this is if you want access to the server internals from some other web application, but for that I would either make the web app another client, or build a custom communication module in the xmpp server that the web app can use to communicate outside of standard XMPP.

Categories

Resources