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.
Related
I'm developing an Android app that consumes a java webservice with REST API and make the DB(MySQL) persistence with Hibernate. Now, I want to add a chat on the application, but I don't really know how to start, if I use GCM or other options, so far it's working with threads that check for new messages every second. However, this seems very wrong as it consumes too much of the server. Is there a better solution, maybe a tutorial or just some tips on how to proceed?
From what I understand, this will be a two-way communication because it will be a chat app (server -> client, client -> server). In the case of using GCM, you will need to communicate via an XMPP library.
On the server side, an XMPP library should be able to register a packet listener that listens for incoming messages. Look at this implementation.
On the client side, you need to register a listener as well. The sample code should suffice to explain this.
I'm trying to implement WebRTC on an android device supporting API 22 and I'm trying to connect to Kurento Media Server to establish media server capabilities. For my application Server layer, I'm trying to utilize a Java Server based on Tomcat, and this is implementing a Kurento Client API to connect to the Kurento Media Server. The issue I am having is understanding how to go about establishing a connection between the Android device and Kurento and doing a media transfer after the connection has been authorized by the Application Server and a SDP response has been processed by the Kurento Client initialized on the Application/Signaling Server. I came across Kurento Android SDK (Kands) but the repositories are missing sources on Maven and Gradle. Any help here in implementing the WebRtc.org stack with Kurento would be appreciated!
KANDS will not help you much for several reasons. First, it is an outdated and unmaintained project. Second, with the setup you describe, I think you'd be barking at the wrong tree. In your case, the signalling that should be implemented in your Android client, should be between the client and your app server. As you can see in the following image, which depicts your proposed setup, your client will be connecting to an app server using your own signalling protocol, and it is you app server the one in charge of controlling KSM.
In this way, you can implement all your business logic in the app-server, and you'll be able to make upgrades in the media part, shielding your clients by hiding the underlying implementation. The only thing that you'll need, is to get the SDP offer from your client to the KMS (going through your app server), have the KMS process that offer, and send the answer back to your client.
With this setup, you'll also have the posibillity to connect Android clients to any other type of webrtc capable clients, such as browsers.
KANDS was discontinued and SDk for android is only used for them to develop customized apps. Then we switched to webview also.
This is more of a clarification question rather than a problem.
I have been making an android app for our Capstone project and we are stuck with this IM chat issue.
We went with the XMPP Ccs endpoint that GCM provides for upstream as well as downstream messaging.
The funny thing is that the library to achieve this is Smack by igniterealtime still maintained and the only library for Java.
The implementation that google provides in their website GCM Ccs is for older version of Smack. I have got the code up and running but somehow gcm doesnt send me a notification for downstream messaging.
That means i am not able to connect to Gcm Ccs endpoint?
And one more thing i dont know if its connected to Ccs or not because its hosted on Openshift and i have used servlets using Jersey library to achieve it and i dont know a way to debug it.
I guess Tomcat server locally hosted would be fine but anyways i havent tried it, we are short on time anyways.
For the new version of Smack library the code completely breaks.
And i am not a pro with XMPP protocol or Smack Library either.
I just somehow got the code working with the older Smack library. I feel that my implementation is fine.
And if you want i can send you the Eclipse Java EE project for you.
The registration part for the app works fine btw.
So the Questions :-
1 -> Does GCM CCS endpoint accept only :- connection = new XMPPTCPConnection() from smack api and have stopped the connection for connection = new XMPPConnection(config);
2 -> Do Paas services like Openshift doesnt allow connection to Gcm Ccs (I have my third party app server hosted on Openshift)
3 -> Anything wrong with my approach to implement IM for android app?
Thank you! Constructive suggestions as well as criticisms is absolutely welcome.
UPDATE
I fixed the above problems and everything works fine. But i have stuck to a new one. I get ack and receipt packets GCM CCS sends me but i dont get any notification when i send a downstream message.
Any problem with my Broadcast Reciever? I dont think so since it looks fine.
Where can be the problem?
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.
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.