Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
CodeDelphiRAD Studio

Easily Load And Display Web Content Cross-Platform In Delphi On Android And IOS

The main form of the Sample contains a TWebBrowser component that supports the basic functions of a web browser, such as: navigate to URL, go back and go forward.

In this post, you’ll learn how to easily load and display Web Content Cross-Platform In Delphi On Android and IOS using Cross-Platform App Builder.

Location

You can find the WebBrowser sample project at:

  • Start | Programs | Embarcadero RAD Studio Sydney | Samples and navigate to:
    • Object PascalMobile SnippetsWebBrowser
    • CPPMobile SnippetsWebBrowser
  • Subversion Repository:
    • You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.

How to Use the Sample

  1. Navigate to one of the locations given above and open:
    • Delphi: WebBrowser.dproj.
    • C++: WebBrowser.cbproj.
  2. Press F9 or choose Run > Run.

Files

The project consists of one source file, uMain.pas, that contains the class for the main form that represents the user interface.

Classes

Implementation

  • The TWebBrowser component calls the Navigate method in order to load and display the content associated with an URL address or a file name.
  • The TClearingEdit component gets the URL address or file name.
  • The btnGo button implements an OnClick event in order to call the event-handler that sets the URL property of the WebBrowser1. Setting this property allows TWebBrowser to automatically call the Navigate method.
  • The btnForward button implements an OnClick event to call the event-handler that calls the GoForward method to navigate to the next URL address or file name in the browsing history list, if any.
  • The btnBack button implements an OnClick event to call the event-handler that calls the GoBack method to navigate to the previous URL address or file name in the browsing history list, if any.

Please follow the link below for more information in the original post of the Sample:

http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FMX.WebBrowser_Sample

Head over and check out the full source code for the TWebBrowser sample on GitHub.

See What's New in 12.2 Athens See What's New in 12.2 Athens Dev Days of Summer 2-24

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES