Exclusive API for Mobile Terminal

  • Last update:April 25, 2025
  • Version

    Report Server Version
    App VersionFunctional Change

    11.0

    11.0

    /

    11.0.26

    11.0.91

    Supported the APIs for the FineVis Data Visualization plugin of V2.6.0 and later versions.

    The following APIs are exclusive to mobile terminals and are available for both general report objects and FRM report objects (new version).

    iconNote:

    In FVS templates, the way APIs are used remains consistent. However, API calls must be made using duchamp instead of FR.

    location

    APIlocation(function)It is used to implement the geolocation function and obtain longitude and latitude. This API can be used in HTTPS, WeCom, WeChat, and DingTalk environments.
    Parameterfunction(status, message, coordinate){...}/
    Returned Value/

    Android

    status: location result, which is a string

    • success: successful location

    • Others: unsuccessful location

    message: response message

    • Returns latitude and longitude when the location is successful.

    • Returns the corresponding error message when the location fails.

    coordinate: the coordinate system

    • WGS84: World Geodetic System (international standard, used by Google Maps, and returned by iOS devices)

    • GCJ02: Mars Geodetic System (Chinese standard, used by Amap and Tencent Maps, and returned by Android devices)

    Example

    Example 1: You can obtain the geographic location. If the location is successful, longitude and latitude are returned. If the location fails, an error message is returned.

    FR.location(function(status, message) {
      // To obtain the geographic location.
      if (status === "success") {
      // If the location is successful, the message parameter returns latitude and longitude.
        FR.Msg.alert("The current location is " + message);
        contentPane.setCellValue(2, 3, message);
      } else {
      // If the location fails, the message parameter returns the corresponding error message.
        FR.Msg.alert(message);  // Location Failed.
      }
    });

    Example 2: In an FVS template, you can obtain the geographic location. If the location is successful, longitude and latitude are returned. If the location fails, an error message is returned.

    duchamp.location(function(status, message){
     //To obtain the geographic location. 
    if(status=="success") {
     //If the location is successful, the message parameter returns latitude and longitude.  
    duchamp.Msg.alert({
       title: "Location",
       message: JSON.stringify(message)
       });
    } else {
     //If the location fails, the message parameter returns the corresponding error message. 
    duchamp.Msg.alert({
      title: "Location Failed",  
      message: `Reason: ${message}`
      })
     }
    });
    Application Scenario

    You can click a button to obtain the latitude and longitude, which will be automatically filled into the corresponding cell. For details, see [App] Getting Current Geographic Location.

    IMG_2814.jpg

    Mobile TerminalThis API is supported on mobile terminals.


    Mobile.getDeviceInfo

    APIMobile.getDeviceInfoTo obtain device information.
    Parameter//
    Returned Value

    DeviceInfo:

    {

    Model: String,

    DeviceID: String

    }

    DeviceInfo: JSON object, which contains two properties

    Model: device model

    DeviceID: unique device ID
    Example

    Example 1: You can obtain information about the current device.

    var deviceInfo = FR.Mobile.getDeviceInfo();
    FR.Msg.alert("Model: " + deviceInfo.Model 
    + "\n DeviceID: " + deviceInfo.DeviceID);

    Example 2: You can obtain information about the current device in an FVS template.

    var deviceInfo = duchamp.getDeviceInfo();
    duchamp.Msg.alert({
    title: deviceInfo.Model,
    message: deviceInfo.DeviceID
    });
    Application Example

    You can view device information on the mobile terminal. For details, see [App] Getting Mobile Device Information by JS.

    IMG_2811.jpg

    Mobile Terminal

    This API is only supported in the DataAnalyst app.


    Attachment List


    Theme: Secondary Development
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy