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

Re: Device Location issue

Hello ekke,

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

Please use plain text.
Developer
ekke
Posts: 1,515
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
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
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
ETitus
Posts: 54
Registered: ‎05-14-2013
My Device: LE Z10

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!
Please use plain text.
Regular Contributor
dhirajnangare
Posts: 93
Registered: ‎08-20-2013
My Device: BB 10 -BlackBerry Z10

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 ?

 

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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. :smileyhappy:

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

Re: Device Location issue

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

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.