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

Native Development

Reply
Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified
Accepted Solution

geolocation_fix_type_t to WIFI or any other type result in GEO_LOCATION_ERROR

[ Edited ]

Hi,

In my application i want to integrate geolocation. I add the geolocation_fix_type_t to WIFI,GEOLOCATION_FIX_TYPE_GPS_MS_BASED or different type defind in the geolocation.h. Geolocation value is only retrive using GEOLOCATION_FIX_TYPE_UNRECOGNIZED and other then this it gives the GEO_LOCATION_ERROR. I also not able to get the idea of which type of GEO_LOCATION_ERROR is coming so i can work on that.

 

Please help me on this how to resolve this. I also set the event_type to WIFI but it also not work and i get error.

 

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: geolocation_fix_type_t to WIFI or any other type result in GEO_LOCATION_ERROR

Can you post a code snippet and the errors that you get (geolocation_event_get_error_message)

 

Stuart

Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: geolocation_fix_type_t to WIFI or any other type result in GEO_LOCATION_ERROR

Hi smacmaritn i attached my project. please tell  me if i miss something to set the type/

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: geolocation_fix_type_t to WIFI or any other type result in GEO_LOCATION_ERROR

As per https://developer.blackberry.com/native/beta/reference/com.qnx.doc.bps.lib_ref/com.qnx.doc.bps.lib_r...

 

uncomment <action>read_geolocation</action> in your bar-description.xml

 

(Also, are you sure you want to exit if you get an error?  Or is that just for devel purposes?)

 

Stuart

Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: geolocation_fix_type_t to WIFI or any other type result in GEO_LOCATION_ERROR

Hi smacmartin,

Thanks for your reply. I uncomment the code which you mentioned in bar-descriptor file.

When i check the following condition it returns true and it go to handle_geolocation_response() method.

Code:

if (bps_event_get_domain(event) == geolocation_get_domain()) { // Get geolocation_get_domain.
handle_geolocation_response(event);
}

// Inside the handle_geolocation_response(event) method when i check this condition it not able to get //GEOLOCATIOB_INFO event.

if (bps_event_get_code(event) != GEOLOCATION_INFO) {
qDebug() << "Not Geolocation info" ;
return;
}

So i am not able to get lat/lon using geolocation_set_fix_type(GEOLOCATION_FIX_TYPE_WIFI);.


Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: geolocation_fix_type_t to WIFI or any other type result in GEO_LOCATION_ERROR

Hi,

I am stuck on my development for geolocation. Please help me on this issue. I pasted code on my last forum post.

Retired
Posts: 249
Registered: ‎07-14-2008
My Device: Not Specified

Re: geolocation_fix_type_t to WIFI or any other type result in GEO_LOCATION_ERROR

There is a much easier way than bps APIs. Please see: https://github.com/blackberry/Cascades-Community-Samples/tree/master/LocationDiagnostics

 

Cheers.

 

Shadid

@shadidhaque

Highlighted
Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: geolocation_fix_type_t to WIFI or any other type result in GEO_LOCATION_ERROR

Hi shaque,

 

Thanks for your reply. i checked that and it works.