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


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.


Reply
Regular Contributor
Posts: 93
Registered: ‎08-20-2013
My Device: BB 10 -BlackBerry Z10
My Carrier: BlackBerry
Accepted Solution

Device Location issue

 Hello ,      

 

      I need to get device location in my app an dI have done following code for this 

 

     Double   latitude = pos.coordinate().latitude();
     Double   longitude = pos.coordinate().longitude();

	QString lat = QString::number(latitude,'g',12);
	QString longi = QString::number(longitude,'g',12);

But values of lat,longi are not giving accurate values .

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Device Location issue

Have you looked at the Location Diagnostics sample app?

 

http://developer.blackberry.com/native/sampleapps/

 

I suggest you download it and run it, if it works correctly the I suggest comparing its code to your own to see where you might be going wrong.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Regular Contributor
Posts: 93
Registered: ‎08-20-2013
My Device: BB 10 -BlackBerry Z10
My Carrier: BlackBerry

Re: Device Location issue

That sample app also showing the same value for lat,long. 

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Device Location issue

Okay are you using a device or the simulator?

 

Why exactly do you think the numbers are wrong and what are you expecting them to be?

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 1,750
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV, DTEK
My Carrier: Telekom.de, O2, Vodafone

Re: Device Location issue

are your positions from GPS or WIFI ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
QtChampion
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS, W10)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Regular Contributor
Posts: 93
Registered: ‎08-20-2013
My Device: BB 10 -BlackBerry Z10
My Carrier: BlackBerry

Re: Device Location issue

using WiFi for positioning.

Regular Contributor
Posts: 93
Registered: ‎08-20-2013
My Device: BB 10 -BlackBerry Z10
My Carrier: BlackBerry

Re: Device Location issue

Hello BBSJdev,

     I am using device . and the numbers are wrong because I checked those values on map. Its showing the location which is 4-5 km apart from the current device location . Also checked lat , long of current device location on web by giving address ,but those are different than what application is showing.

Developer
Posts: 1,750
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV, DTEK
My Carrier: Telekom.de, O2, Vodafone

Re: Device Location issue


dhirajnangare wrote:

using WiFi for positioning.


then perhaps from your router there's a wrong position

 

I had this at conferences, where a router inside a conference venue was before in another city and I got the position from this city. sometimes it needs some time before getting the right position. try to switch between radio network and your wifi. perhaps it helps to relocate.

.... only an idea what could happen

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
QtChampion
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS, W10)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Regular Contributor
Posts: 93
Registered: ‎08-20-2013
My Device: BB 10 -BlackBerry Z10
My Carrier: BlackBerry

Re: Device Location issue

Thank  you so much ekke,

   If I use GPS positioning then could it give the correct location parameters ? 

Highlighted
Developer
Posts: 1,750
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV, DTEK
My Carrier: Telekom.de, O2, Vodafone

Re: Device Location issue

GPS should give you the right positions ... if accuracy is good

 

about the way of providers to get the position via WIFI I don't have detailed informations,

but I know it took some time for new or moved routers

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
QtChampion
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS, W10)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner