Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
11-13-2012 04:33 AM
I'm new to the whole blackberry app development and, so far I'm enjoying it, BUT, I'm getting gray hair from retrieving data from my localhost php file.
Can someone give me a straight forward quick tutorial on how to do this? I've been trying to follow online tutorials, but none of them EVER work!
So far, I've got everything up and running.
my php file echo's "hello", just for now....
How do I access that php file and display the echo?
This is what I'm trying at this moment.
HttpConnection http = null;
StreamConnection s = (StreamConnection)Connector.open(url);
HttpConnection httpConn = (HttpConnection)s;
int status = httpConn.getResponseCode();
It says Connector.open "Unhandled exception type IOException";
I would GREATLY appreciate some help.
11-13-2012 04:43 AM
11-13-2012 04:43 AM
You could probably start by using the HttpDemo sample.
However the trick here is probably that you do not know how to specify the connection method the device/simulator will use to connect, and you are probably being timed out. Printout the message associated with the IOException you are handling, to see more detail of the actual Io error it is complaining about.
To get default processing working on the Simulator, you need to start the MDS Simulator, or append ";deviceside=true" to your URL.
To appreciate the various options review this video:
To understand how to set the connection method manually, see this:
However I recommend you look at using ConnectionFactory, as Simon pointed out in response to your first post here:
Let us know if the above does not get you going.
Finally - welcome to BlackBerry. Hope you enjoy it!
11-13-2012 05:09 AM
The thing is, everything is so confusing.....I try to look at the coding samples, but It just doesn't make sense.
Does anyone know of a tutorial that will tell me, we do this because of this, and this because of that, nothing fancy, I just want to retrieve some text, that's all.
I followed this, but even that doesn't work, it's too messy and complicated for the little basic thing I want to achive.
Thanks for the response.
11-13-2012 05:22 AM
11-13-2012 05:46 AM
okay i got it working making a change.
c = Connector.open("http://localhost:8080/home.php;dev
I changed the deviceside to true, but then it reads everything as text and ignores anything like html tags etc..
11-13-2012 05:48 AM
11-13-2012 06:12 AM
I think this is a case where a little knowledge will help you understand the framework you are building upon.
As an example, you don't just turn the key in your car and think that is what makes it go forward do you? You understand that it only turns the starter motor, which turns the motor .... A little knowledge about how the car works means you use it better.
I recommend that you review the links I pointed you at. They explain the connection methods and the meaning of the connection suffixes.