XMPP and Android interaction - android

I am currently finding about how to build a XMPP client application on android 2.1.I came across this link which somewhat talks about the same problem.I am a newbie to android dev and thus found the solution given there to be difficult to digest.
The system currently has Active MQ as a JMS provider.My job is to fed the messages coming from JMS to the XMPP server and then develope XMPP client on android 2.1 which will listen and show notification to the events pushed by the server.
I have following concerns(which might sound foolish)
1.How do I push the events from JMS to the XMPP server which will in turn push them on android?
2.Which XMPP server implementation I should use?I have 3 options
* Openfire: Very mature (was a commercial product), but sounds like it's heavyweight, written in Java
* Prosody: Lightweight and easy to use, written in Lua. Doesn't have PubSub module yet
* Tigase: Also lightweight, written in Java, supports PubSub
How do I test and setup these servers.Do I need PubSub funcationality for my app?
3.For XMPP client I came across Smack API given here which is updated like 2 years back.Can anyone please tell me how do I make use of it for Android 2.1.If possible can anyone please mail me latest working Smack jar files.
Thanks,
Ameya

Why don't you use eJabberd as your XMPP server ? It seems to me that is has the best support of pubsub and is a very efficient server. We use it since 2 years now without any issue. And on the client side, yes, asmack if definitively the open source choice, but has some drawbacks: it does not support pubsub, and has some very nasty bugs that you will encounter if you dive into some of its functionalities. We had to improve and extend it a lot to implement our full featured social network IM/microbloging/geolocalisation client for Android (called BuddyMob) and now we provide an extended version of Smack as a commercial product (see http://www.ubikod.com/products.htm). Some of our bug fixes has been integrated into the Smack trunk, but most of the extensions we did are not free.

Look at asmack for an android Smack client: http://code.google.com/p/asmack/

You can push messages from JMS to XMPP using Apache Camel - http://camel.apache.org/xmpp.html

Related

Firebase XMPP Protocol Vs HTTP Protocol

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.

NodeJS Alternative For Android

I have visited many blogs and questions looking for a way to use android as a client and nodejs as a server for my app. I came up with a solution that is to use PhoneGap like frameworks so that it could act like native but is not in reality. I need to use native android sdk and connect with NodeJS server (using SocketIO) to create my app. Is there any way I could do this?
P.S I want to know that while I set up by GCM can I pass my IP and port that I have created in my socket.io file to the GCM?
Cordova (hence PhoneGap) allows you to use most of the hardware APIs. PhoneGap nowadays is just a build service of some sorts.
The Cordova website and plugin store explain all the details. But t WebSockets are just an upgraded protocol or feature of TCP. Any newer technology supports it without any dependencies, but in dependence of the network you're traveling in.
Without diving deep into the code here at socket.io-website, I reckon that the initial build of your Cordova app is a WebSocket implementation to the server. So you got everything bootstrapped already.
What this tutorial doesn't explain is how to connect to the server. But read it up here.
I have no prior experience but Google Cloud Messaging seems not to be in the scope of the problem of socket.io. Once you have a connection to the socket you can send to the client whatever payload you want and might or might not need GCM anymore. If you need to send stuff via GCM read up on the the GCM node module.
Passing IPs around shouldn't be much of a problem since you're are running a public service anyway. You'd need to secure it anyhow of course.

Android xmpp client xabber

I have been searching for Android xmpp clients. I came to know about asmack for android. I have also found xabber for android here . I have downloaded the code and able to run it successfully. I am not able to get any documentation of xabber APIs.
Is it possible to use this xabber client for my custom XMPP server.
If u know any other good Xmpp clients for android , please suggest
me.
Smack is Java XMPP library, asmack is a Smack build environment for android, it is well maintained and you can get precompiled libraries. You can view Smack documentation and samples here. Xabber - is one of XMPP clients which uses Smack library(custom fork with some modifications) and you may use official Smack documentation when digging into xabber sources.
You should definitely have a look at Yaxim:
https://github.com/pfleidi/yaxim
Is it possible to use this xabber client for my custom XMPP server.
Yes, but i'm not sure.
If u know any other good Xmpp clients for android , please suggest me.
The best list of applications that implements XMPP is on xmpp foundation own site. https://xmpp.org/xmpp-software/clients/
I hope help you.

Better Way to implement the chat application using XMPP on Android?

Hi i want to implement the Chat application in android using XMPP (To
avoid the GCM notifications because GCM uses request response
process).
i have done the 70 perc functionality using Smack library
and OpenFire server. but after completion of these i came to know
about the QuickBlox SDK. I don't know completely about that but few
people are saying that it is good api by seeing the features..
can any one tell me that is it correct way of implementing the chat
application using smack for xmpp . or we have any other good api which
uses xmpp for android .
The Stackoverflow question "Android and XMPP: Currently available solutions" provides a good overview of XMPP client libraries for Android.
Another good resource is xmpp.org/xmpp-software/libraries.
You can use QuickBlox1 for free.
It provides XMPP server out of the box with lots of features, you can read about features there http://quickblox.com/developers/Chat
Here is an example how to start using QuickBlox with aSmack library http://quickblox.com/developers/Android_XMPP_Chat_Sample
1Quick disclosure: I am a developer at QuickBlox.

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