0

Hey guys what's up? I'm making a very simple game for BlackBerry Curve 8520, and i need to get the ranking from the server. In order to get this data, the web programmers gave me php files that gets the data from the database and returns it as a dynamic xml file.

My question is:

How can i load that php file using java code? how can i pass a get parameter to that request?

how can i parse the xml retrieved from the php script?

Thanks in advance!

Francisco

  • Are you asking how to send an HTTP GET request to a php program on a server and read the response? If not, where are the java and php programs located? – NormR Nov 12 '13 at 03:33

1 Answers1

1

You really have two problems here, and I think you should attempt to address them separately.

  • Problem 1 is getting the data from the Server
  • Problem 2 is parsing the data you get from the Server.

Both these problems have been covered extensively on this and other forums previously, so I suggest that you search here and elsewhere. Here are a few links from SO:

blackberry HttpConnection.GET

Parse XML file on BlackBerry

In addition, I recommend you review the documentation provided on the official BB site:

http://developer.blackberry.com/bbos/java/

including the following:

http://developer.blackberry.com/bbos/java/documentation/intro_networking_1984362_11.html

As you will see, the BB offers a number of methods of doing communication, in your case I would recommend the ConnectionFactory API: http://developer.blackberry.com/bbos/java/documentation/network_api_1984363_11.html

And here is something on parsing XML:

http://supportforums.blackberry.com/t5/Java-Development/Use-the-XML-Parser/ta-p/445210

This should be enough to get you going. Please come back with specific questions if you have issues with any of this.

Community
  • 1
  • 1
Peter Strange
  • 2,640
  • 11
  • 11