Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
Posts: 83
Registered: ‎05-24-2011
My Device: Storm 9550
My Carrier: XXX
Accepted Solution

http post not working

I am trying to set up an http post in my Blackberry app. I have successfully implemented this in my corresponding Android app, so I know the server it working find. I have tried several different things, and I'm not really getting errors, its just the info on the server is not getting updated. I have looked at this post: Http POST in BlackBerry, and several others. I found them helpful, but they didn't ultimately solve my problem. Again, I don't get errors, but the server doesn't get updated. Here is the code I am currently using:

		String url =http://xxxx.com/ratings/add?;deviceside=tru;
		String postStr1 =business_id=79;
		String postStr2 =rating=;

		HttpConnection httpConnection = (HttpConnection) Connector.open(url);
		httpConnection.setRequestMethod(HttpConnection.POST);
		httpConnection.setRequestPropertyContent-Typ,application/x-www-form-urlencode);

		URLEncodedPostData encPostData = new URLEncodedPostDataUTF-, false);
		encPostData.appendbusiness_i, String.valueOf(790));
		encPostData.appendratin, String.valueOf(4));
		byte[] postData = encPostData.toString().getBytesUTF-);

		httpConnection.setRequestPropertyContent-Lengt, String.valueOf(postData.length));

		OutputStream os = httpConnection.openOutputStream();
		os.write(postData);
		os.flush()

Any ideas

Highlighted
Regular Contributor
Posts: 83
Registered: ‎05-24-2011
My Device: Storm 9550
My Carrier: XXX

Re: http post not working

Solved it. Had to remove deviceside=true

Developer
Posts: 80
Registered: ‎09-03-2012
My Device: 9810
My Carrier: Vodafone

Re: http post not working

[ Edited ]

Hi

 

Was your solution also worked for simulator ? I am stuck at same problem but its not runing in simulator at my end.

 

 

Always Success
Developer
Posts: 80
Registered: ‎09-03-2012
My Device: 9810
My Carrier: Vodafone

Not able to deploy the app on balckberry torch 9810 via BB Desktop software

Hello Guys,

Please help me out.

 

I have developed the app but not able to deploy it on device using the BB Desktop software 7.1.0 (Latest version available) .

 

I have developed the app with Blackberry JDE 7.0 since the BB torch 9810 is also BB JDE 7.0 compliant.

 

Via eclipse the application is easily deployed to the device but my client which is trying to deploy it on his device using the BB desktop software is not able to deploy it.

 

Attached is the screen shot of the problem which i am facing..

Always Success
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Not able to deploy the app on blackberry torch 9810 via BB Desktop software

This is a separate problem to the Thread you have attached it to.  Please start a new Thread with your problem.  There is a "New Message" button on the list screen for doing this.

 

When you do start a new Thread, please describe how you have packaged up the application for distribution to the client. 

 

This documentation should help:

 

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