DelphiFeeds.com

  • Dashboard
  • Popular Stories
  • Trending Stories
  • Feeds
  • Login
Trending now

Learn A Powerful Python Concept: Modules And Packages With A Delphi Windows GUI App

The IFDEF Problem!

Quickly Build Natural Language Processing Capable GUI Apps With Delphi And Python NLTK

Freebie Friday: capture controls or forms

Easily Learn How To Use Python List Comprehensions In A Delphi Windows GUI App

Powerful Native Open Source Hard Disk, Folder and Storage Analyzer Built In Delphi

Incredible Database Development And Visualization Tool Is Built In Delphi

User Defined Functions with InterBase

Learn How To Use C++ Extending Sizeof For Windows Development

Learn How Easy It Is To Apply Updates With TFDQuery.OnUpdateRecord In Delphi

Easily Bridge Your FireMonkey Windows Apps And JavaScript Using ScriptGate

1
Anbarasan Anbarasan 2 months ago in Code, Delphi, Electron, FMX Application, javascript, NativeVsHybridApp, object pascal, programming, RAD Studio, ScriptGate, windows 0

Before knowing how to bridge FireMonkey application and JavaScript using ScriptGate, Let’s understand what is Native App and Hybrid App? What’s the difference between them? How to develop a Hybrid App using Delphi? Is it possible? What’s the challenge? This post will guide you to understand better.

Native Apps : A software application built in a programming language, for the specific platform like iOS, Android ,Windows, macOS and Linux. The pros and cons are,

  • The Best performance – no extra calculations or interpretations layers.
  • No way to update UI without updating the app (only if you don’t have some built-in UI update engine)
  • Your app can be used only for target platforms. You cannot start the app inside the browser without using something like Thinfinity Virtual UI.

Hybrid Apps: Hybrid apps are part native apps, part web apps. It can take advantage of some device features available. Like web apps, they rely on HTML being rendered in a browser, with the caveat that the browser is embedded within the app. The pros and cons are,

  • Possibility to update the UI and logic without updating the whole app.
  • Great opportunity if you like to use HTML/CSS/Javascript for UI and even for business logic.
  • Not the best performance – your app UI or business logic ( like Javascript) executes inside the browser component.
  • Risk during submission to app stores (but your app still looks like a native app to the play store).

Hybrid apps with Delphi is that possible? Yes, using the TWebBrowser component and ScriptGate.

Why do we want to use ScriptGate?

It looks like a native application, access to platform-specific features, like get device token, working with push notifications (including background mode), access to BLE and other hardware onboard features, working with permissions, and so on. Possibility to publish the application to app stores like a native app.

What’s the challenge here?
The main challenge – organize communication between your HTML/CSS/JavaScript web application, stored inside the TWebBrowser component, and your Host application code..E.g)

  • Get Push notifications token in the host app and transfer it to the web app.
  • Initiate permission requests from web app before calling some restricted function, e.g perform calls.
  • Register geofences for the platform, e.g get a list of geofences via Rest API from Web Server using javascript code and put them to the OS using host app.

ScriptGate solves the above challenges: ScriptGate is a library that allows you to call back and forth between JavaScript and Delphi code on TWebBrowser across Android, iOS, macOS, and Windows.

Watch the Video Demonstration on how to bridge the FMX and JavaScript using ScriptGate mentioned below.

Check out the other ways to Bridge Your Delphi Application and Javascript here.

You can download the ScriptGate library for Delphi over on BitBucket.

Trending Stories

  • Learn A Powerful Python Concept: Modules And Packages With A...

  • The IFDEF Problem!

  • Quickly Build Natural Language Processing Capable GUI Apps With Delphi...

Embarcadero GetIt

  • Brook Framework

    Microframework which helps to develop web Pascal applications.

  • Trial - TMS Scripter

    Add the ultimate flexibility and power into your apps with native Pascal or Basic scripting and […]

  • Trial - TMS VCL Chart

    DB-aware and non DB-aware feature-rich charting components for business, statistical, financial […]

  • Trial - TMS VCL Cloud Pack

    TMS VCL Cloud Pack is a Delphi and C++Builder component library to seamlessly use all major cloud […]

  • Trial - TMS VCL UI Pack

    Create modern-looking & feature-rich Windows applications faster with well over 600 components […]

  • Learn Delphi Programming
  • Learn C++
  • Embarcadero Blogs
  • BeginEnd.net
  • Python GUI
  • Firebird News
  • Torry’s Delphi Pages
Copyright DelphiFeeds.com 2021. All Rights Reserved
Embarcadero
Login Register

Login

Lost Password

Register

Lost Password