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:
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:
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 http://www.youtube.com/watch?v=U-sQeBTqaAI
For additional information about C++Builder for iOS go to the product information page - http://www.embarcadero.com/products/cbuilder/ios-development
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 http://www.youtube.com/watch?v=EwHJbB0Zi0g
Buy one of these qualifying tools now and get the C++Builder iOS upgrade FREE as soon as it is available:
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.

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",
NewLocation.Latitude);
ListBoxItem3->Text = ListBoxItem3->Text.sprintf(
L"Longitude: %f",
NewLocation.Longitude);
String URLString = "";
URLString = URLString.sprintf(
L"https://maps.google.com/maps?q=%2.6f,%2.6f&output=embed",
NewLocation.Latitude, NewLocation.Longitude);
WebBrowser1->Navigate(URLString);
}
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 http://www.youtube.com/watch?v=U-sQeBTqaAI
For additional information about C++Builder for iOS go to the product information page - http://www.embarcadero.com/products/cbuilder/ios-development
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 http://www.youtube.com/watch?v=EwHJbB0Zi0g
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.
- Buy Now - https://store.embarcadero.com/542/purl-buynow?cid=701G0000000WLhl
- Buy from a Partner - http://www.embarcadero.com/business-partner-directory
- Contact Sales - Corporate/Americas, EMEA, Asia Pacific, Japan
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.


David Intersimone (known to many as David I.) is a passionate and innovative software industry veteran-often referred to as a developer icon-who extols and educates the world on Embarcadero developer tools. He shares his visions as an active member of the industry speaking circuit and is tapped as an expert source by the media. He is a long-standing champion of architects, developers and database professionals and works to ensure that their needs are folded into Embarcadero's strategic product plans. David holds a bachelor's degree in computer science from California Polytechnic State University at San Luis Obispo, California.
Comments
-
Please login first in order for you to submit comments
- Page :
- 1
Thanks for the fourth video, are any more coming soon?