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 on April 1st. 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


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

Re: Device Location issue

Hello ekke,

    Would you please tell me how to do this using GPS system instead of Wi-Fi.

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

Re: Device Location issue


dhirajnangare wrote:

Hello ekke,

    Would you please tell me how to do this using GPS system instead of Wi-Fi.


just have to finish some other work - will come back to this thread later this week

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

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

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 54
Registered: ‎05-14-2013
My Device: LE Z10
My Carrier: Ben(T-Mobile network)

Re: Device Location issue

Hi,

 

Please try to set your location source to GPS using this:
https://developer.blackberry.com/native/documentation/cascades/device_platform/location/settingup.ht...

 

I hope this helps,

 

Titus

Don't forget to mark as solved and like my post if it helped out!
Regular Contributor
Posts: 93
Registered: ‎08-20-2013
My Device: BB 10 -BlackBerry Z10
My Carrier: BlackBerry

Re: Device Location issue

[ Edited ]

Hey ETitus,

   This problem is solved and now I am getting correct values of device . 

But facing another issue . Now I need to do reverse geocoding for these values. I did following code - 

 

 

QGeoCoordinate GCoor(latitude,longitude);


		//Reverse GeoCoding
			QStringList serviceProviders =
					QGeoServiceProvider::availableServiceProviders();
			if (serviceProviders.size()) {
				QGeoServiceProvider *serviceProvider = new QGeoServiceProvider(
								serviceProviders.at(0));

				searchManager = serviceProvider->searchManager();
			}
				//searchManager->setProperty("boundary", "city");
				  reply = searchManager->reverseGeocode(GCoor);

				bool finished_connected = QObject::connect(reply, SIGNAL(finished()),
						this, SLOT(readReverseGeocode()));

 

void LocationDemo::readReverseGeocode() {


			QList<QGeoPlace> LocDetList = reply->places();


			if( 0 < LocDetList.size())
			{
				showToast("size greater than 0");
			}

			QGeoPlace locDe = LocDetList.at(0);
		
			//qDebug() << "City --> " << locDe.address().state();
			
			//qDebug() << "Country Code --> " << locDe.address().countryCode();
			
			//qDebug() << "Country --> " << locDe.address().country();


QString state = locDe.address().state();
QString countryCode = locDe.address().countryCode();
QString country = locDe.address().countryCode();


showToast(state);
showToast(countryCode);
showToast(country);


			//reply->deleteLater();
		}

 but when control comes at this line 

QGeoPlace locDe = LocDetList.at(0);

in readReverseGeocode() methos ,application is getting crashed . And also the size of locDeList is empty . I checked using size() .  Would you please tell me whats wrong here ?

 

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

Re: Device Location issue

[ Edited ]

Please keep threads to one problem only and once the original posting (OP) is solved please mark the reply or replies that helped as the solution. By marking a thread as solved you help people with the same problem find the solution and avoid people giving answers to a problem you have already fixed.

 

Also this follow on question is now duplicating another thread by you meaning that potentially people answering will be wasting their time when it may already be answered in the original thread or pertinent information missed.

 

Please close this thread off and anyone wishing to reply to answers on reverse geocoding should post here...

 

http://supportforums.blackberry.com/t5/Native-Development/Reverse-Geocoding-in-BlackBerry10/m-p/2694...

 


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.
Highlighted
Regular Contributor
Posts: 93
Registered: ‎08-20-2013
My Device: BB 10 -BlackBerry Z10
My Carrier: BlackBerry

Re: Device Location issue

I apologize for this but I posted this issue here because I didn't get the solution on other thread. 

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

Re: Device Location issue

No problem, but next time just do a link to the new thread if you want to highlight it.


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.