location

Xamarin.Forms DependencyService difficulty getting location

佐手、 提交于 2019-12-03 16:27:14
So after finally getting my head around Xamarin.Forms DependencyService I have nearly got it returning the device's current location. my interface public interface ICurrentLocation { MyLocation SetCurrentLocation(); } MyLocation public class MyLocation { public double Latitude {get; set;} public double Longitude{get; set;} } the line that calls it MyLocation location = DependencyService.Get<ICurrentLocation>().SetCurrentLocation(); and in the CurrentLocation class in the Android project that implements the Geolocation class of Xamarin.Mobile [assembly: Dependency(typeof(CurrentLocation))]

How to find degree from the latitude value in android?

不想你离开。 提交于 2019-12-03 15:33:31
I have a latitude and longitude values as a double value(37.33168900, -122.03073100). I want to convert it to the degree value like (37 19' 54 ,48 11' 52 ). Any Idea? Thanx in advance. Should be some math: (int)37.33168 => 37 37.33168 % 1 = 0.33168 0.33168 * 60 = 19,905 => 19 19.905 % 1 = 0.905 0.905 * 60 => 54 same with -122 (add 360 if nagative value) EDIT: May be there is some API, which I don't know. This will give you Strings in degrees, minutes and seconds of arc: String strLongitude = location.convert(location.getLongitude(), location.FORMAT_SECONDS); String strLatitude = location

Qt/Qml: how to include map tiles for offline usage?

こ雲淡風輕ζ 提交于 2019-12-03 14:45:16
问题 I need to include offline tiles (slippy map) into a Qt/Qml mobile application that mainly runs on Android and iOS. The only well-documented and working solution I found is the commercial Esri Arcgis Runtime for Qt. However, creating tile packages requires using the Arcgis stack, either desktop or server (please correct me if I am mistaken). https://developers.arcgis.com/qt/ I am looking for an open source and easy to use alternative. QtLocation has just been improved in Qt 5.5, but there

How to post location with image to facebook in IOS?

我怕爱的太早我们不能终老 提交于 2019-12-03 14:27:55
I am trying to share location along with image to facebook. I have successfully shared image but unable to share location. Below is my code of sharing image. UIImage *facebookImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",imagesURL,str]]]]; NSMutableDictionary* params = [[NSMutableDictionary alloc] init]; [params setObject:@"New Happening created on the HappenShare mobile app." forKey:@"message"]; [params setObject:facebookImage forKey:@"picture"]; [FBRequestConnection startWithGraphPath:@"me/photos" parameters:params

What is the meaning of android.location.LocationManager.PASSIVE_PROVIDER?

折月煮酒 提交于 2019-12-03 14:19:34
I understand the meaning of GPS_PROVIDER (locations come from GPS signals) and NETWORK_PROVIDER (locations are determined from cell towers and wireless access points), but I don't understand the meaning of PASSIVE_PROVIDER , despite the definition in the API: A special location provider for receiving locations without actually initiating a location fix. This provider can be used to passively receive location updates when other applications or services request them without actually requesting the locations yourself. This provider will return locations generated by other providers. You can query

Create local location based notifications in swift

邮差的信 提交于 2019-12-03 13:55:12
问题 I'm a relatively new swift developer and I've heard in iOS 8 you can send local notifications based on a users Location. I have had a look at some code, particularly this one to create simple time based local notifications. var leftNotification1:UILocalNotification = UILocalNotification() leftNotification1.alertBody = "NotidicationA" leftNotification1.repeatInterval = NSCalendarUnit.CalendarUnitHour leftNotification1.fireDate = NSDate(timeIntervalSinceNow: 900) UIApplication.sharedApplication

Send current location through an SMS

佐手、 提交于 2019-12-03 13:53:01
问题 I'm trying to get my app to be able to send its current GPS location through an SMS to a preentered phone number. I have my code right now that only brings up an SMS window inside the app in which I can edit in the receiving number and a body. What I am wondering is how I get the current location in this body so it can be sent through the SMS? Can't figure it out. This is how my code looks right now regarding the SMS function. -(IBAction) sendInAppSMS:(id) sender {

Getting all zip codes within an n mile radius

别来无恙 提交于 2019-12-03 13:51:09
问题 What's the best way to get a function like the following to work: def getNearest(zipCode, miles): That is, given a zipcode (07024) and a radius, return all zipcodes which are within that radius? 回答1: There is a project on SourceForge that could assist with this: http://sourceforge.net/projects/zips/ It gives you a database with zip codes and their latitude / longitude, as well as coding examples of how to calculate the distance between two sets of coordinates. There is probably a better way

cellID and LAC / PSC for 3G neighboring cells in Android

坚强是说给别人听的谎言 提交于 2019-12-03 13:48:49
问题 I am trying to identify the neighboring cells location in 3G with Android, which I get with getNeighboringCellInfo(). When The phone works in GSM mode, I am able to use getCid() and getLac() to get the CellID and the LAC, but for 3G, I can only use getPsc(), which I'm not very sure if it's enough to identify a cell. Can anybody please tell me if I can get the CellID + LAC for neighboring cells? And if that's not possible, how can I use the PSC code to identify a cell? 回答1: In UMTS, the PSC is

Get LocationUpdates in background service continuously

旧巷老猫 提交于 2019-12-03 13:42:57
问题 I am working on application which requires to fetch location updates continuously in background service. I have used background sticky service with which it is working. But service is not starting after boot complete even though I have added boot broadcast and have started the service there. Service starts and immediately gets killed. Also, this is not working on Oreo. Service stops after few minutes of application gets closed and never restarts till app is relaunched. I have gone through lot