Example on how to use Vysper xmpp with smack - java

Anyone could point an example, tutorial, doc, etc, about how to use Vysper to serve xmpp. I managed to start Vysper but cant find anything on how to exchange messages.
I'm trying to create a chat app, much like whatsapp, google talk and so on.
I dont want to use Google Cloud Management.
I would like configure myself a xmpp server.
Others options besides Vysper would be welcome.

I am not a specialist in the XMPP but I was writing a small project - communicator based on Smack and OpenFire server.
From my own experience I can recommend You using the OpenFire server.
Here is the example of Communicator which is based on Smack and OpenFire: https://github.com/mack94/Komunikator---Wiadomosci/
If you have any questions don't hesitate to ask me

Related

how to create nodejs xmpp server and android xmpp client

I want to add chat module to android app. Firstly I want to use XMPP using Nodejs. How nodejs xmpp server works with android client.
Can nodejs xmpp server can communicate with android app? if yes than, how can i create simple nodejs xmpp server and simple android app that both can communicate.
If you have any other solution please let me know.
I am tried socket.io but i dont want to use that. It is not worked stable on android client side. Some messages send some not send. I am used few solutions for solve this problem (ping pong, heartbeath, change java client libraries for socket io, ...). But nothing changed.
My aim is to create stable fast chat module to android and ios application using with nodejs server.
Please guide me, thank you in advance.
Have you tried checking other solutions like ConnectyCube, Firebase, Layer, etc.?
They provide a ready backend and all you need to care about is configuring your client-side app.
Some of them even have ready Android client-side libraries which can be integrated in your app and speed up the development.

Android app need help connecting to a JAVA localhost server

I've had a look around and could not find what I'm looking for, so please feel free to redirect me.
I'm writing a card game that uses a Java server that stores the card information. I want to develop an Android app that connects to this server (via TCP/IP is my initial thought) and issues the commands i.e. pick up cards, play cards etc. (as the cards are stored in arraylists within the server app.)
My knowledge of Android is extremely limited and I cant find any good sources that could possibly help me, or explain how android networking works.
You need tcp server socket communication >
http://developer.android.com/reference/java/net/Socket.html
I would recommend to use a REST service and communicate via JSON. You can use for example Robospice in combination with Jackson2 which also brings you async communication and caching out of the box.
https://github.com/stephanenicolas/robospice/wiki/Starter-guide
Socket communication is really old school ;-)

Patterns for building chat application with XMPP

I built an Android application with Google App Engine Server. Now I want to add simple chat to my app. And I have some questions.
My users registered with theirs desired email domains like hotmail.com, yahoo.com and even more esoteric domains, thats mean that I need to create JID for them? if so is Google App engine provide JID creations with my app domain that i can manipulate?
I read that Google App Engine act as XMPP client so I need Xmpp Server that can receive and send XMPP messages. So why do I GAE for? is Openfire is my answer? can I integrate Openfire with GAE?
I Also read that if I want to use XMPP in GAE and Android in need aSmack Api for my client and that it is working on HTTP. So I guess that I'll need to poll the server for messages every couple seconds. Is there a better pattern?
can I integrate Openfire with GAE?
You cannot run Openfire on GAE because GAE works only on HTTP so you won't be able to connect over sockets as Openfire does.
My users registered with theirs desired email domains like hotmail.com, yahoo.com and even more esoteric domains, thats mean that I need to create JID for them? if so is Google App engine provide JID creations with my app domain that i can manipulate?
If I understand your question correctly, you shouldn't have any problems here. As long as you're not a spammer, we don't place any restrictions on what domains you can send to.
I read that Google App Engine act as XMPP client so I need Xmpp Server that can receive and send XMPP messages. So why do I GAE for? is Openfire is my answer? can I integrate Openfire with GAE?
You can send and receive XMPP messages via the xmpp API (this is the python version). This calls into the Google Talk infrastructure. You don't have access to what you'd traditionally call an "XMPP server", but you do have access to basic XMPP functionality.
I don't know a lot about OpenFire, but there is a Trusted Tester program for outbound sockets that you can sign up for. This is what you would need if you desire an external XMPP server.
I Also read that if I want to use XMPP in GAE and Android in need aSmack Api for my client and that it is working on HTTP. So I guess that I'll need to poll the server for messages every couple seconds. Is there a better pattern?
I should prefix this by saying I don't know a whole lot about Android or aSmack, but that won't stop me from taking a stab at answering your question. :-)
I think this depends on your usecase, but I can't think of any situation you'd need to do this off the top of my head. Will the user of your application have their own JID on a server they registered for? If so, I don't see any reason you'd have to connect via HTTP, unless that's all aSmack supports. The main use-case for BOSH/XMPP-over-HTTP is in the browser where you don't really have access to open raw sockets.
If you want to use XMPP as a messaging/notification service the user won't know about, it may be more complex. I should note that you can always set up an XMPP server on Google Compute Engine.

XMPP in Google App Engine and Android for a chat application

I want to build a simple chat app where users can send messages to each other.
Can I do it with XMPP service from Google App Engine?
In their tutorials and all the tutorials I found on the web it was an implementation of a bot server. I also found similar tutorials but they are in python.
Is there a good and full tutorial that can guide in server and client side?
Yes, you can use XMPP/Smack library available as a third party library. With this you can create you own custom chat application same like the one's available in the market.
You probably want to use the Channel API if you want to build your own chat app. That's for sending messages to browers.
The XMPP API is for sending messages to XMPP clients. ie if you want to send a message to the chat client that's built into gmail, or a gchat client, or facebook chat.

Chat application - which tech is better to implement chat app in Android

*I have to make an android application which is basically a chat application.*In this chat app the user can interact with single user as well in a group that means Group chat is also there. I am using php as the back end for database . I have never done this type of work earlier so need some suggestions or guidance.
The options i have seen is as follow :
1. Web-services
2. Socket Programming
3. XMPP using the smack api
Now i am confused in them that which is better to implement chat feature in android. Also i didn't get any sample code for that. One of my team member is asking me to use the socket programming but i didn't get any sample app or anything for socket programming in android. I don't know socket programming this time. How we can connect the our phone to the server and then some other device. Hope you get me what i want to Conway you.
So can any one please guide me and show me the right direction to move on. Also if you can provide me any sample code, that can be really helpful. Any help is appreciated
Another option (besides XMPP, which is certainly a valid approach for chat, since it was designed for that) would be using WebSocket. Using WebSocket would open the possiblity of having a pure browser client as well.
For WebSocket on Android, there is AutobahnAndroid, part of the Autobahn family of WebSocket and WAMP implementations.
WAMP is a RPC and PubSub over WebSocket protocol with multiple implementations. There is also a PHP implementation of WebSocket/WAMP: Ratchet.
Disclaimer: I am author of Autobahn/WAMP and work for Tavendo.
For a basic Socket programming tutorial, you can check HERE and HERE.
However, I suggest using XMPP, as I have mentioned HERE, as it is a protocol designed from the ground up to be used for Messaging.

Categories