FMX.Mobile.LocationDemo Sample (Object Pascal)
This is a sample that describes how to use location data in mobile applications, using FireMonkey.
Contents
Location
You can find the FireMonkeyMobile LocationDemo sample project at:
- Start | Programs | Appmethod | Samples and then navigate to Object Pascal\Samples\Device Sensors and Services\LocationDemo
- Subversion Repository: http://sourceforge.net/p/Appmethod/code/HEAD/tree/branches/Appmethod_113/Object%20Pascal/Samples/Device%20Sensors%20and%20Services/LocationDemo
Description
This application allows the user to display their location on a map and save it for future use.
How to Use the Sample
- Navigate to the location given above and open LocationDemoProject.dproj.
- Press F9 or choose Run > Run.
Files
The sample files are LocationDemoUnit, the main form that constitutes the user interface for the FireMonkeyMobile LocationDemo Sample application and LocationDemoProject, the project itself.
Classes
FireMonkey TabSlideTransition represents the main window of the sample. It contains the following components:
- A TLocationSensor
- A TWebBrowser
- A TListBox, named ListBox1, contains the following controls:
- A TListBoxGroupHeader
- Two TListBoxItems, named ListBoxItemLatitude and ListBoxItemLongitude
- A TListBoxGroupHeader named TListBoxGroupHeader2
- Ten TListBoxItems, named ListBoxItemAdminArea, ListBoxItemCountryCode, ListBoxItemCountryName, ListBoxItemFeatureName, ListBoxItemLocality, ListBoxItemPostalCode, ListBoxItemSubAdminArea, ListBoxItemSubLocality, ListBoxItemSubThoroughfare, ListBoxItemThoroughfare.
- A TListBoxHeader
Implementation
- Make sure that the Switch is On and the iOS device has the Location Services On.
- The sample shows the Latitude and Longitude for the location of the device using the TLocationCoord2D properties and the OnLocationChanged event.
- TWebBrowser is used to show a map using Google Maps.
See Also
- FireMonkey Application Design
- FireMonkey Application Platform
- iOS Mobile Application Development
- Troubleshooting: Cannot Deploy to the iOS Simulator
- Troubleshooting: Cannot Deploy to the iOS Device
- FMX.Sensors.TLocationSensor
- Mobile Tutorial: Using Location Sensors (iOS and Android)
- FMX.WebBrowser.TWebBrowser
- FMX.ListBox.TListBox
- FMX.ListBox.TListBoxGroupHeader
- FMX.ListBox.TListBoxItem
- FMX.Layouts.TLayout
- FMX.Controls.TSwitch
- FMX.Controls.TLabel