Quantcast
Channel: TMS Software
Viewing all articles
Browse latest Browse all 1008

Hardware access from TMS WEB Core apps

$
0
0



TMS Software Delphi  Components
TMS WEB Core is an innovative framework designed to build web applications using Object Pascal language. Despite the primarily web-centric nature of applications built with TMS WEB Core, the framework offers a variety of components that facilitate hardware access, allowing developers to bridge the gap between web applications and physical devices.

In this article, we'll dive into the components of TMS WEB Core that enable hardware access:

TMS Software Delphi  Components  Camera & microphone

The first hardware accessory that comes to mind when talking about web hardware access is the device camera. This can be the camera integrated with the smartphone you are using of the web camera connected to your desktop PC. TMS WEB Core provides a component for working with the camera. The component TWebCamera allows you to work with these cameras. It can be used for capturing still images. The TWebMediaCapture can be used to record video or just audio. When your device has multiple cameras, like a front and back camera on a smartphone, the TWebCamera allows you to select the desired camera. There are a few things to pay attention to. First of all, starting the camera unattended is (for obvious privacy reasons) not possible. The browser will typically show a prompt for the user to allow switching on the camera. On Safari, there is an additional requirement that for the camera to work, the web app should run from a HTTPS enabled domain. On an iPhone, it also requires a physical interaction with the app (like clicking a button) to have the camera switched on. That means that if you would turn on the camera in code during app startup, it will not work.

Related articles:
Use the camera for barcode scanning

TMS Software Delphi  Components  Touch

The touch interface of a screen is equally a separate hardware interface. In TMS WEB Core touch interaction with components is handled via events OnTouchStart, OnTouchMove, OnTouchEnd, OnTouchCancel. In this way, it is possible to have applications react differently to touch on the screen than a click via the mouse. When the application is running on a mobile device, touch events are by default mapped onto mouse events so that you do not need to separately add application logic for dealing with mouse and touch.

TMS Software Delphi  Components  Screens

Detecting the number of screens attached to your device and controlling on what screen to show a browser window is these days also possible from a web application and TMS WEB Core has support for it. GetScreensInfo returns an object TJSScreenInfo that contains all information about connected screens. The method createPopup() has an extra parameter to control on what screen a new window is opened.

Related articles:

TMS Software Delphi  Components  GPS

Mobile devices come these days all equipped with a GPS for location capturing. TMS WEB Core's TWebGeolocation component interfaces with the device's GPS or network-based positioning system, providing accurate location data. The nice thing about TWebGeolocation is that also when the device has no GPS on board, it will nicely fall back to determine the most nearby location based on network. One more small remark in connection to geo location is that the interface to capture it is asynchronous. Either you start the capture of geo location with GetGeolocation and get the actual result via event OnGetgeolocation or you use the promise GetGeolocationAsync.

Related articles:
DIY navigation with TMS WEB Core

TMS Software Delphi  Components  Compass

For devices with a compass on board, TWebDeviceOrientation can be used to determine the orientation of the device. Use TWebDeviceOrientation.Start and each time the orientation of the device changes, the event OnHeadingChange will be triggered returning the new orientation as Heading (an angle between 0 and 360°). 

Related articles:
DIY navigation with TMS WEB Core

TMS Software Delphi  Components  USB

TMS WEB Core also has provisions to interface with the Web USB API. This API makes USB devices accessible to web applications, allowing for direct data transfers and device operations. Note that at this moment only Chrome based browsers (Chrome and Edge Chromium) fully implement the Web USB API. USB access comes in two flavors: HID and serial. As such, there are in TMS WEB Core two components: TWebUSBHID and TWebUSBSerial.

Related video:
Accessing USB HID and USB serial via TMS WEB Core

TMS Software Delphi  Components  Bluetooth

The Web Bluetooth API provides an interface for connecting web applications with Bluetooth-enabled devices. TMS WEB Core integrates with this API to offer components that facilitate seamless communication between web apps and Bluetooth peripherals. Perfect for web apps that need to communicate with printers, scanners, game controllers, or even custom Bluetooth devices developed for specific enterprise applications. As with USB, it is at this moment only fully implemented in the Google Chrome and Microsoft Edge Chromium browsers. 

Related articles:

TMS Software Delphi  Components  Speech recognition

Browsers can now also take advantage of hardware supported speech recognition and allow you to build voice driven web applications. In TMS WEB Core, TWebSpeechRecognition allows you to take advantage of this. You basically set the language and a number of command words and each time the speech recognition detects any of these words, it will trigger the event OnResultMatch. 

Related video:

Overview

Here is a convenient overview for what hardware access is today possible in the different browsers:



ChromeEdgeFirefoxSafari macOSSafari iOSChrome AndroidWebKit Linux
Camera

TMS Software Delphi  Components

TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TouchTMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
ScreensTMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
GPSTMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
USBTMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
BluetoothTMS Software Delphi  Components
TMS Software Delphi  Components

TMS Software Delphi  Components

TMS Software Delphi  Components

TMS Software Delphi  Components

TMS Software Delphi  Components

TMS Software Delphi  Components

Speech recognitionTMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components
TMS Software Delphi  Components


The future?

The web world is in constant change and functionality is added all the time and some more hardware access functions are already in the browser or expected soon. We at tmssoftware.com monitor this situation and where possible bring the supporting components for it. We are eager to learn what kind of additional functionality you look for! 

Conclusion

In conclusion, TMS WEB Core is bridging the world of web applications and physical hardware. By leveraging the provided components, developers can craft more immersive, responsive, and powerful web applications that interact with the world in ways previously reserved for native applications. Whether you're aiming to connect to IoT devices, capture multimedia, or understand device orientation, TMS WEB Core has the tools to make it happen.







Viewing all articles
Browse latest Browse all 1008

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>