将您自己的 XMPP 服务器用于 android 聊天应用程序(Smack API)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22480302/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:02:28  来源:igfitidea点击:

Using your own XMPP server for android chat app (Smack API)

androidxmpp

提问by user3419596

I am new to Android programming.I have completed the basics though and wish to learn XMPP for making a chat application on Android. I've gone through tutorials, but have not got the way to use a custom pc as server for the application.I want to use my laptop as a server for sending messages between 2 android devices.My laptop should be able to recieve and direct the messages between the two.Can anyone please help me get started?

我是 Android 编程的新手。我已经完成了基础知识,并希望学习 XMPP 以在 Android 上制作聊天应用程序。我已经完成了教程,但还没有办法使用自定义 pc 作为应用程序的服务器。我想使用我的笔记本电脑作为服务器在 2 个 android 设备之间发送消息。我的笔记本电脑应该能够接收和直接两者之间的消息。有人可以帮我开始吗?

回答by Plinio.Santos

First of all, you need to install in your laptop a XMPP server. Hereare a list of available ones. People used to say Openfireis easy to install and configure, but to production purposes Ejabberd (linux and mac only) seems to be more robust.

首先,您需要在您的笔记本电脑中安装一个 XMPP 服务器。是可用的列表。人们过去常说Openfire易于安装和配置,但就生产而言,Ejabberd(仅限 linux 和 mac)似乎更健壮。

To develop your app, you can use Smack, which is large well documented, with code snapshots to connect to a server, create a chat, send and receive messages etc.

要开发您的应用程序,您可以使用Smack,它是大型文档,带有代码快照以连接到服务器、创建聊天、发送和接收消息等。