neoDevice
Get current device information and adds appropiate CSS classes to the HTML document.
Based on:
https://github.com/matthewhudson/current-device
Description
The neoDevice plugin for VisualNEO Web enables apps to detect and respond to device-specific features, allowing applications to interact with device hardware, such as orientation sensors and vibration features. Here’s a breakdown of its main functionalities:
- Device Information Retrieval:
- neoDeviceGetInfo: Retrieves essential information about the device, including its type (e.g., Desktop, Tablet, or Mobile), operating system (e.g., Android, iOS), current orientation (Landscape or Portrait), and browser name. This information can be used to tailor the app experience based on the user’s device setup.
- Internet Connection Monitoring:
- neoDeviceIsOnline: Detects whether the device has an active internet connection, returning a true or false result, which is useful for managing offline functionality.
- neoDeviceOnConnect and neoDeviceOnDisconnect: These commands allow the app to trigger specific subroutines when an internet connection is established or lost, providing seamless handling of connectivity-dependent features.
- Orientation Change Detection:
- neoDeviceOnOrientationChange: Sets a subroutine to execute whenever the device’s orientation changes, helping applications dynamically adjust layouts or features based on orientation shifts.
- Device Vibration:
- neoDeviceVibrate: Activates the device’s built-in vibration function, if available, for a specified duration (in milliseconds). This feature is useful for creating haptic feedback in interactive applications, such as games or notifications.
The neoDevice plugin is an excellent tool for enhancing interactivity in VisualNEO Web applications by leveraging device-specific features, making it suitable for mobile and responsive applications that need to respond to hardware capabilities and environmental changes.
neoDeviceGetInfo
|
Purpose: |
Get basic device information |
|
Category: |
neoDevice |
|
Syntax: |
neoDeviceGetInfo deviceType deviceOS deviceOrientation theBrowserName
deviceType Variable to store device type (Desktop, Tablet or Mobile) deviceOS Variable to store device OS (Android, iOS...) deviceOrientation Variable to store device orientation (Landscape or Portrait) theBrowserName Variable to store Web Browser name (Firefox, Chrome...) |
neoDeviceOnOrientationChange
|
Purpose: |
Set the subroutine to execute when device orientation changes. The subroutine should get get new orientation as a STRING variable. This action doesn't work in Internet Explorer |
|
Category: |
neoDevice |
|
Syntax: |
neoDeviceOnOrientationChange mysubroutine
mysubroutine Subroutine to execute |
neoDeviceVibrate
|
Purpose: |
Use the device's built-in vibration, if one is present. |
|
Category: |
neoDevice |
|
Syntax: |
neoDeviceVibrate milliseconds
milliseconds Milliseconds |
neoDeviceIsOnline
|
Purpose: |
Detects if there is an Internet connection return true or false |
|
Category: |
neoDevice |
|
Syntax: |
neoDeviceIsOnline [returnvar]
returnvar Return var |
neoDeviceOnConnect
|
Purpose: |
Call a subroutine when Internet connection returns |
|
Category: |
neoDevice |
|
Syntax: |
neoDeviceOnConnect subroutine
subroutine Subroutine |
neoDeviceOnDisconnect
|
Purpose: |
Call a subroutine when Internet connection is lost |
|
Category: |
neoDevice |
|
Syntax: |
neoDeviceOnDisconnect subroutine
subroutine Subroutine |
Created with the Personal Edition of HelpNDoc: Transform Your Word Document into a Professional eBook with HelpNDoc