Templates for creating chat with XMPP

I created an Android application with the Google App Engine application server. Now I want to add a simple chat to my application. And I have some questions.

  • Do my users registered with their desired email domains like hotmail.com, yahoo.com and even more esoteric domains mean that I need to create a JID for them? if such a Google App mechanism ensures the creation of a JID with my application domain that I can manipulate?

  • I read that the Google App Engine acts as an XMPP client, so I need an XMPP server that can receive and send XMPP messages. So, what am I EXCLUDING for? is Openfire my answer? Can I integrate OpenFire with GAE?

  • I also read that if I want to use XMPP in GAE and Android, you need aSmack Api for my client and that it works with HTTP. Therefore, I assume that I will need to poll the server for messages every couple of seconds. Is there a better sample?

+4
source share
2 answers

Can I integrate OpenFire with GAE?

You cannot run OpenFire in GAE because GAE works only over HTTP, so you cannot connect through sockets, as Openfire does.

0
source

Do my users registered with their desired email domains like hotmail.com, yahoo.com and even more esoteric domains mean that I need to create a JID for them? if such a Google App mechanism ensures the creation of a JID with my application domain that I can manipulate?

If I understand your question correctly, you should not have any problems. As long as you are not a spammer, we do not place any restrictions on which domains you can send.

I read that the Google App Engine acts as an XMPP client, so I need an XMPP server that can receive and send XMPP messages. So, what am I EXCLUDING for? is Openfire my answer? Can I integrate OpenFire with GAE?

You can send and receive XMPP messages through the xmpp API (this is the python version). This invokes the Google Talk infrastructure. You do not have access to what you traditionally call an “XMPP server,” but you do have access to the basic XMPP functions.

I don't know much about OpenFire, but there is a Trusted Tester program for outgoing sockets that you can subscribe to . This is what you need if you want to use an external XMPP server.

I also read that if I want to use XMPP in GAE and Android, you need aSmack Api for my client and that it works with HTTP. Therefore, I assume that I will need to poll the server for messages every couple of seconds. Is there a better sample?

I should prefix this by saying that I don’t know much about Android or aSmack, but that will not stop me from taking a hit when answering your question. :-)

I think it depends on your use, but I can’t think of any situation in which you would have to do it from my head. Will the user of your application have their own JID on the server on which they are registered? If this is the case, I see no reason why you will have to connect via HTTP, unless it supports all aSmack. The main use case for BOSH / XMPP-over-HTTP is in a browser where you really don't have access to open source sockets.

If you want to use XMPP as a messaging / notification service that the user is not aware of, this can be more complicated. It should be noted that you can always configure the XMPP server on the Google Compute Engine .

0
source

Source: https://habr.com/ru/post/1441101/


All Articles