1. Outline
Learn how to get information about the environment in which your Unifinity application is running.
This sample program implements a function to obtain the following information
Feature | summary |
---|---|
OS version acquisition | Get the OS version. |
App version acquisition | Get the version number of the Unifinity application. |
Unifinity Version Acquisition | Version of Unifinity Application Player or Unifinity Studio Retrieve the |
UserAgent acquisition | device and browser that is sent when accessing a website. information. |
The sample project used in the explanation can be downloaded from the following link. We hope you will take advantage of it.
2. Operation image
3. Implementation method (explanation of key points only)
3-1. Screen Creation
Create a new screen and place the necessary controls.
(1) Button
Pressing the button calls the logic to retrieve each piece of information.
(2) Label
Displays the respective acquisition information corresponding to the buttons placed on the left.
3-2. Logic implementation
3-2-1. OS version acquisition
Since Unifinity has a component for acquiring the OS version as "proprietary" "OS version acquisition," use this to acquire the OS version and set it to the corresponding "(2) label" on the main screen.
3-2-2. App version acquisition
The same process as described in "3-2-1.
3-2-3. Unifinity version acquisition
The same process as described in "3-2-1.
3-2-4. UserAgent acquisition
UserAgent is obtained by executing JavaScript.
Unifinity sets up "own" "scripts" in components.
Then the "Script" field will appear, where you can write the JavaScript to obtain the UserAgent.
3-3. Logic calls from the screen
Set the logic corresponding to each of the "① buttons" on the main screen as "execution processing".
This completes the implementation.