0

Hi i am new in blackberry i create a blackberry app in this application i am facing a problem i am try to store some data in data base and when i run my application in simulator data is completely store in database but when i run this app on device nothing is store in database. i am going through this code.

String url="http://68.20.66.178:8080/locationProvider/location.json"; 
GPRSCellInfo cellInfo = GPRSInfo.getCellInfo();

       String event="";
                    //String  requestString =  "lat="+ parameters.lat + "&lon=" + parameters.lon;
                    String temp="cellid=" + GPRSInfo.getCellInfo().getCellId() + "&lac="
                            + GPRSInfo.getCellInfo().getLAC() + "&mcc=" + cellInfo.getMCC()+ "&mnc="
                            + cellInfo.getMNC() + "&imei=" + GPRSInfo.imeiToString(GPRSInfo.getIMEI(), false).trim() + "&lat="
                            + parameters.lat + "&lon=" + parameters.lon
                            + "&type=WORKFORCE&event" + event;
temp="imei="+imei1+"&cellid"+cellid+"&lac="+lac+"&mcc=" +mcc+"&mnc="+mnc+ "&lat="+ parameters.lat+"&lon=" + parameters.lon+"&type=WORKFORCE&event=" + event;

                    HttpConnectionUtil objConnectionUtil=new HttpConnectionUtil();
                     strRes1=objConnectionUtil.responseForGetRequest(url, temp);
                    System.out.println("Response1====="+strRes1);
                    Thread.sleep(delay);
                    ApplicationDescriptor current=ApplicationDescriptor.currentApplicationDescriptor();
                    current.setPowerOnBehavior(ApplicationDescriptor.DO_NOT_POWER_ON);

i am getting this value from simulator

URL==http://68.20.66.178:8080/locationProvider/location.json
[0.0] parameters==cellid=0&lac=0&mcc=0&mnc=0&imei=123456783648138&lat=0.0&lon=0.0&type=WORKFORCE&event
[0.0] response=={"lat":"0", "lon":"0", "provider":""}
[0.0] Response1====={"lat":"0", "lon":"0", "provider":""}

so where i making mistake please suggest me

Thanks

Richard
  • 8,920
  • 2
  • 18
  • 24

1 Answers1

0

You say data is not stored in the database, but the only code provided is for making a web request. I assume the data in the web request is supposed to be stored in a database on the server.

Since your concern is mainly about the database, the first question is whether the request is getting to the server at all. Check your access logs, and see if anything matches up with what you expect coming from the device. If you see the appropriate entries in the access log, but nothing is getting stored in the database, then the problem is likely on the server.

However, this being BlackBerry, I suspect your problem is really with the connection appenders. This is asked frequently on stackoverflow:
BlackBerry simulator can connect to web service, but real device can't

Community
  • 1
  • 1
Michael Donohue
  • 11,776
  • 5
  • 31
  • 44