geolocation - Newest Quickblox SDK for Android: Get nearby locations does not work -


i have been using quickblox sdk android quite while. however, new sdk library made of code not working. specifically, create list of locations. try search nearby locations, providing current location , radius.

  getlocationsbuilder.setcurrentposition(qblocation.getlatitude(),   qblocation.getlongitude());    getlocationsbuilder.setradius(point.getlatitude(),           point.getlongitude(), (float) 5.0);        geopoint point = new geopoint(qblocation.getlatitude(),             qblocation.getlongitude()); 

however, result format incorrect.

'{"errors":{"current_position":["should in geopoint format","should set radius"]}}'

here whole code:

    log.d(tag,             "update location " + point.getlatitude() + " "                     + point.getlongitude());      qblocationrequestbuilder getlocationsbuilder = new qblocationrequestbuilder();     getlocationsbuilder.setpage(1);     getlocationsbuilder.setperpage(100);     getlocationsbuilder.setlastonly();      getlocationsbuilder.setcurrentposition(qblocation.getlatitude(), qblocation.getlongitude());      getlocationsbuilder.setradius(point.getlatitude(),     point.getlongitude(), (float) 5.0);      int unixtime = (int) (system.currenttimemillis() / 1000l - 1000);     getlocationsbuilder.setmincreatedat(unixtime);      // getlocationsbuilder.setsort(sortfield.distance);      qblocations.getlocations(getlocationsbuilder, new qbentitycallback<arraylist<qblocation>>() {         @override         public void onsuccess(arraylist<qblocation> qblocations, bundle bundle) {             arraylist<string> card_ids = new arraylist<string>();             (qblocation location : qblocations) {                 log.d(tag, "locations nearby : " + location);                 card_ids.add(location.getstatus()); // status card_id             }             getcards(card_ids);         }          @override         public void onsuccess() {          }          @override         public void onerror(list<string> strings) {          }     }); 

i can search locations, , ones want, not elegant using sdk.

if replace quickblox sdk earlier version works fine.

looks fixed in 1.2.4

http://quickblox.com/developers/android#framework_changelog:

which version use?


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -