Skip to content

Location enabling your C++Builder for iOS apps

In this video I show you how to location enable your C++Builder for iOS applications using the TLocationSensor component.  I’ll also show you how to use the resulting latitude and longitude coordinates to display a Google map using the TWebBrowser component. You’ll start by creating a new C++Builder for iOS application and choose the blank application project template.

Next I’ll add a TToolBar component with a TLabel, a TListBox component with 3 ListBoxItems, a TSwitch component, the TLocationSensor component and the TWebBrowser component.  After you’ve put the components togetner, your form will look something like the following in the IDE form designer:

Next I add an OnSwitch event handler for the TSwitch component.  I use the TSwitch to activate and deactivate the TLocationSensor component. Here is the OnSwitch event handler code:

    void __fastcall TForm1::Switch1Switch(TObject *Sender)
    	LocationSensor1->Active = Switch1->IsChecked;

Next, I add code for the TLocationSensor’s OnLocationChange event handler to get the previous and current location coordinates, display the latitude and longitude, and use the TWebBrowser’s Navigate method to go to Google Maps and return the map showing the current location.  Here is the code for the OnLocationChange event handler:

    void __fastcall TForm1::LocationSensor1LocationChanged(TObject *Sender,
    	const TLocationCoord2D &OldLocation,
    	const TLocationCoord2D &NewLocation)
    	ListBoxItem2->Text = ListBoxItem2->Text.sprintf(
    		L"Latitude: %f",
    	ListBoxItem3->Text = ListBoxItem3->Text.sprintf(
    		L"Longitude: %f",
    	String URLString = "";
    	URLString = URLString.sprintf(
    		NewLocation.Latitude, NewLocation.Longitude);

Compile and Run the application on your iOS device and you’ll see the following output showing the Latitude, Longitude and the Google Map for your current location (I am currently in Houston for the RAD Studio XE5 lunch and learn tomorrow):

Watch me design, code, compile and run this application on my iPhone 4S in the YouTube at

For additional information about C++Builder for iOS go to the product information page -

Special Offer: Get a free C++Builder iOS upgrade when you buy qualifying C++Builder XE5 or RAD Studio XE5 tools

C++Builder for iOS is coming soon (expected December 2013). Very soon, you will be able to create iOS apps with C++Builder! Get started with the latest version of C++Builder or RAD Studio today to benefit from the fastest, visual, multi-device app development solution for Windows and OS X, and be one of the first to deliver C++Builder apps on iOS.

Watch the C++Builder for iOS Preview at

Buy one of these qualifying tools now and get the C++Builder iOS upgrade FREE as soon as it is available:

  • C++Builder XE5 – Enterprise, Ultimate or Architect editions only
  • RAD Studio XE5 – all editions

This offer is not available for C++Builder Professional edition or Starter edition.

How to get it: Purchase one of the qualifying products, new user or upgrade. When C++Builder iOS support is released, you will gain access to iOS features in a free downloadable upgrade to your XE5 product.
Exceptions: Does not apply to C++Builder Professional or Starter edition.

Availability: Buy now. The iOS upgrade will be available to all C++Builder XE5 Ent/Ult/Arch registered users and all RAD Studio XE5 users. This offer can be combined with the "Upgrade from any earlier version", "Bonus Pack" and "Step Up to Ultimate" offers.

{ 2 } Comments

  1. Stuart Kelly | December 16, 2013 at 10:08 am | Permalink

    Thanks for the fourth video, are any more coming soon?

  2. David Intersimone | January 1, 2014 at 7:49 pm | Permalink

    Stuart - I will be working on more C++ for iOS videos this month. I just got too busy with some other work to end the year, but now have more time in January.

Post a Comment

Your email is never published nor shared. Required fields are marked *

Bad Behavior has blocked 4 access attempts in the last 7 days.