Source Code

Mobile Location on iOS and Android

Most Android and iOS devices either include a GPS antenna, the ability to triangulate off cellular or wireless access points, or some combination. Accessing the location is different when using the platform APIs for iOS and Android. Luckily Delphi XE5 includes the TLocationSensor component. When activated it has a OnLocationChanged event which fired when the location changes more than the specified distance. In there simply examine the NewLocation.Latitude and NewLocation.Longitude to know the current location.

Learn more about multi-device, true-native app development with Delphi XE5 and check out other Mobile Code Snippets.

4 replies on “Mobile Location on iOS and Android”

@donmutti There is a video on the Welcome page of Delphi under Start Here for iOS that outlines how you can get a free trial of MacInCloud. That is the only way to get an iOS Simulator if you are on Windows. It works really well though, and will have you going in just minutes.

In that video the iOS simulator was running on my Mac OS X host and Windows was running in a VM, so it just looks like the simulator was running in Windows.

@Jim McKeeth, thank you, I’ll keep going with MacInCloud.
But is there an opposite way – to start the MacOS on a virtual machine under Windows host with Delphi onboard, and connect to it?

Comments are closed.