开发者

server side for mobile application in java me

Im making mobile application in java me and I want开发者_开发技巧 to have server side from where Ill get some information for the application (not to have much information in xml file in the application).

I dont have much experience with servers, so I would like to know how to deal with it. Probably I should make some web services.

Im working in NetBeans 6.7

Thanks in advance!

Milan


Assuming you want to stick with Java, I would implement your server side as a simple Servlet. If all you want to do is send an XML file to the client I think using a proper web services stack is probably overkill and will over complicate things.

Using this approach your mobile app simply makes an HTTP connection to your Servlet, which responds with your XML file.

In fact, if it's a static XML file you don't need any kind of server side code, any web server would suffice.


The Glassfish application server that probably comes with Netbeans will let you run a Java servlet on your local computer.

Accessing it from a J2ME emulator running on the same computer is easy.

Accessing a servlet from a MIDlet running on a real mobile phone is more complicated.

I would suggest looking at Google App Engine for easy deployment of a test server that can be accessed from a mobile phone.


I recommend you to use Http Post instead of Web services. Some mobile devices does not support web services (defined in JSR 172)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜