将您自己的 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
Using your own XMPP server for android chat app (Smack API)
提问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.