简体   繁体   English

从Java移动应用程序连接到Web服务以读取消息

[英]Connect from java mobile application to webservice to read messages

I have a website where users can send personal messages between them, now I want them to recieve the messages also on their mobile phone but without having to send them a SMS. 我有一个网站,用户可以在他们之间发送个人消息,现在我希望他们也可以在手机上接收消息,而不必发送短信。

I am thinking about providing them with a mobile phone with internet access over GPRS or 3G, then develop a Java application that will connect to the website and retrieve the messages. 我正在考虑为他们提供可以通过GPRS或3G进行互联网访问的手机,然后开发一个Java应用程序,该应用程序将连接到网站并检索消息。

On the website I am thinking to make a webservice where the phone will login, get new messages, and also be able to answer back to messages. 我正在考虑在网站上提供一项网络服务,电话将在该服务中登录,获取新消息并能够回复消息。

Does anyone know any mobile application tutorial that will do that? 有谁知道任何移动应用程序教程可以做到这一点? Or do you recommend me where to start? 还是您推荐我从哪里开始? I never done a java mobile application before, I only work with websites and PHP. 我以前从未做过Java移动应用程序,只使用网站和PHP。

I also tried to use ICQ, the client is already done for java and for iphone, and I've also found a script that will send ICQ messages from PHP, but ICQ server bans you for 20 minutes when you do many reconnections, so I have to develop some kind of ICQ bot always online that will check for new messages to send from the mySQL database and then send them, one per 2-3 seconds, so the server won't ban me for flooding. 我也尝试过使用ICQ,该客户端已经为Java和iPhone做好了,我还找到了一个脚本,该脚本将从PHP发送ICQ消息,但是当您进行多次重新连接时,ICQ服务器禁止您使用20分钟,所以我必须开发一种始终在线的ICQ bot,该bot会检查从mySQL数据库发送的新消息,然后每2-3秒发送一次,因此服务器不会禁止我进行洪水泛滥。

Well any advice or recommendation is welcome about how to have users connected to the website messaging system from their phones. 我们欢迎任何有关如何使用户通过手机连接到网站消息系统的建议或建议。

Thank you! 谢谢!

Instead of a Java Application, I would do a mobile HTML web page for the mobile devices because it will be simpler to deploy. 我将为移动设备创建一个移动HTML网页,而不是Java应用程序,因为它将更易于部署。 I know Java is supposed to be WRITE ONCE RUN ANYWHERE, but with JavaME is not that simple. 我知道Java应该可以在任何地方运行一次写入,但是使用JavaME并不是那么简单。 You will have to create special deployments for different phones, and there are phones that do not support JavaME (iPhone) at all. 您将必须为不同的电话创建特殊的部署,并且有些电话根本不支持JavaME(iPhone)。

With a mobile WEB SITE, the only thing your mobile phone needs is a browser. 使用移动网站,您的手机唯一需要的就是浏览器。 Pretty much every feature/smart phone have a browser these days. 如今,几乎每个功能/智能手机都具有浏览器。

If you insist on developing a JavaME application, you are on the right track. 如果您坚持开发JavaME应用程序,那么您将走上正确的道路。 You can publish some WebServices on your WebSite and consume them from JavaME. 您可以在WebSite上发布一些WebServices并从JavaME中使用它们。 Here is a tutorial on how to do that. 是有关如何执行操作的教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM