### Get Start Time Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/index-files/index-7.html Retrieves the start time. This method is part of the XMDevFileInfo class. ```APIDOC XMDevFileInfo.getStartTime() - Retrieves the start time. - Description: 获取开始时间 ``` -------------------------------- ### SDK Initialization and Configuration Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/lib/FunSDK.html Methods for initializing the SDK, setting up parameters, and configuring language support. These are crucial first steps before utilizing other SDK functionalities. ```APIDOC Init(int nParam, byte[] pParam) - Returns: int - Description: Initializes the SDK with basic parameters. InitEx(int param, byte[] pParam, java.lang.String strCustomPWD, java.lang.String strCustomServerAddr, int nCustomPort) - Returns: int - Description: Initializes the SDK with extended parameters, including custom network settings. InitExV2(int param, byte[] pParam, int nCustomPWDType, java.lang.String strCustomPWD, java.lang.String strCustomServerAddr, int nCustomPort) - Returns: int - Description: Initializes the SDK with advanced parameters, supporting different password types and custom network configurations. InitLanguage(android.content.res.AssetManager assets, java.lang.String string) - Returns: int - Description: Initializes language support using asset manager and a language string. ``` -------------------------------- ### Get App Version Code (Java) Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/utils/XUtils.html Retrieves the version code of the installed Android application. This method requires a Context object to access package information. ```java public static int getVersionCode(android.content.Context context) 获取APP版本 参数: `context` - 返回: ``` -------------------------------- ### XMFunSDKManager API Documentation Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/manager/XMFunSDKManager.html Provides methods for initializing and managing the FunSDK, including instance retrieval, initialization, logging configuration, language setup, and status bar control. ```APIDOC XMFunSDKManager: __init__(context: android.content.Context) Initializes the XMCloud platform. Must be called for SDK functionality. Reference: https://oppf.xmcsrv.com/#/docs? getInstance() Returns the singleton instance of XMFunSDKManager. getInstance(customPwdType: int, customPwd: java.lang.String, customServerAddr: java.lang.String, customPort: int) Returns the singleton instance of XMFunSDKManager with custom configuration. init() Initializes the SDK. Returns: boolean - true if initialization is successful, false otherwise. init(initType: java.lang.String) Initializes the SDK with a specific type. Parameters: initType: The type of initialization. Returns: boolean - true if initialization is successful, false otherwise. initLanguage(application: android.app.Application, assets: android.content.res.AssetManager, lan: java.lang.String) Initializes translation resources. Parameters: application: The application context. assets: The asset manager. lan: The language code. Returns: XMFunSDKManager - The instance for chaining. initLog() Initializes logging to logcat. Returns: XMFunSDKManager - The instance for chaining. initLog(logPath: java.lang.String) Initializes logging to a specified file path. Parameters: logPath: The path for log files. Returns: XMFunSDKManager - The instance for chaining. isXMStatusBar() Checks if the XM status bar is enabled. Returns: boolean - true if enabled, false otherwise. setXMStatusBar(isXMStatusBar: boolean) Sets the state of the XM status bar. Parameters: isXMStatusBar: The desired state (true to enable, false to disable). unInit() Uninitializes the SDK. ``` -------------------------------- ### Wi-Fi Configuration and Device Tips Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/app/src/main/assets/language/tr_TR.txt Provides tips and instructions for Wi-Fi configuration, device password handling, and update checks. ```text TR_wifi_config_tip1=*Refers to searching for devices under the same LAN TR_psw_tips=Please input the wifi password TR_wifi_tips=Please connect to wifi before continuing TR_forgot_psw_tips=Forgot your device password? TR_Check_Update=check update ``` -------------------------------- ### Get Random Number in Range (Java) Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/utils/XUtils.html Generates a random integer within a specified range (inclusive of start, exclusive of end). This function is useful for various random selection tasks. ```java public static int getRamdom(int start, int end) 获取一个定义范围内的随机数 参数: `start` - 随机数的开始范围 `end` - 随机数的结束范围 返回: ``` -------------------------------- ### CloudMediaFileInfoBean Methods Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/lib/sdk/bean/cloudmedia/CloudMediaFileInfoBean.html Provides methods to access and manage file information within the CloudMediaFileInfoBean. Includes methods for getting start and end times, file duration, and index file paths. ```APIDOC CloudMediaFileInfoBean: getEndTimeByYear() Returns: java.util.Date Description: 获取结束时间戳 (Gets the end timestamp) getStartTimes() Returns: long getEndTimes() Returns: long getFileTimeLong() Returns: int Description: 获取文件时长 单位 秒 (Gets file duration in seconds) getIndexFile() Returns: java.lang.String setIndexFile(java.lang.String indexFile) Parameters: indexFile: java.lang.String - The path to the index file. ``` -------------------------------- ### XMFunSDKManager Initialization and Configuration Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/manager/XMFunSDKManager.html Methods for initializing the SDK, setting up logging, and configuring cloud platform integration. Includes overloaded methods for different initialization scenarios. ```APIDOC public static XMFunSDKManager getInstance() // Gets the singleton instance of XMFunSDKManager. public static XMFunSDKManager getInstance(int customPwdType, java.lang.String customPwd, java.lang.String customServerAddr, int customPort) // Gets the singleton instance with custom password type, password, server address, and port. // Parameters: // customPwdType - Customized encryption type. // customPwd - Customized encryption prefix. // customServerAddr - Customized cloud service (domain name or IP). // customPort - Customized cloud service port. public boolean init() // Initializes the SDK. public boolean init(java.lang.String initType) // Initializes the SDK with a specific initialization type. // Parameters: // initType - The type of initialization. public void unInit() // Uninitializes the SDK. public XMFunSDKManager initLog(@Nullable java.lang.String logPath) // Initializes logcat logging. // Parameters: // logPath - Path for logs, can be null. // Returns: The XMFunSDKManager instance for chaining. public XMFunSDKManager initLog() // Initializes logcat logging with default settings. // Returns: The XMFunSDKManager instance for chaining. public XMFunSDKManager initLanguage(android.app.Application application, android.content.res.AssetManager assets, java.lang.String lan) // Initializes translation for the SDK. // Parameters: // application - The application context. // assets - The asset manager. // lan - The language code. // Returns: The XMFunSDKManager instance for chaining. public XMFunSDKManager initXMCloudPlatform(android.content.Context context) // Initializes the XM Cloud Platform. This method must be called for the SDK to function correctly. // Refer to https://oppf.xmcsrv.com/#/docs?md=readGuide for developer guides, application creation, and obtaining AppKey, movedCard, and AppSecret. // Ensure AppKey, movedCard, and AppSecret are added to AndroidManifest.xml. // Parameters: // context - The application context. // Returns: The XMFunSDKManager instance for chaining. ``` -------------------------------- ### System Initialization and Configuration Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/lib/FunSDK.html Methods for initializing network connections, local databases, and setting server IP/port configurations. These are fundamental for establishing communication and data persistence. ```APIDOC SysInitNet(java.lang.String szIP, int nPort) - Initializes the network subsystem with a specified IP address and port. - Parameters: - szIP: The IP address of the server or network interface. - nPort: The port number for network communication. - Returns: An integer status code. SysInitLocal(java.lang.String szDBFile) - Initializes the local subsystem, potentially setting up a local database file. - Parameters: - szDBFile: The path or name of the local database file. - Returns: An integer status code. SysInitAsAPModle(java.lang.String szDBFile) - Initializes the system in an Access Point (AP) mode, possibly configuring a database file. - Parameters: - szDBFile: The path or name of the database file for AP mode. - Returns: An integer status code. SysSetServerIPPort(java.lang.String sKey, java.lang.String sServerIP, int nServerPort) - Sets the server IP address and port for a specific configuration key. - Parameters: - sKey: A key to identify the configuration setting. - sServerIP: The IP address of the server. - nServerPort: The port number of the server. - Returns: An integer status code. ``` -------------------------------- ### XMFunSDK Initialization Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/README_CN.md Provides code examples for initializing the XMFunSDKManager in an Android application, including parameters for custom server configurations and settings for low-power devices. ```java // 如果是P2P定制服务器的话请参考以下方法 // int customPwdType 加密类型 默认传0 // String customPwd 加密字段 默认传 "" // String customServerAddr 定制服务器域名或IP // int customPort 定制服务器端口 // 从开发平台上获取到appUuid、appKey、appSecret、appMovedCard等信息 // isUseDefaultConfigPath 是否使用默认配置路径,该路径会在手机本地保存设备密码等信息 // XMFunSDKManager.getInstance(0,"",customServerAddr,customPort).initXMCloudPlatform(this,appUuid,appKey,appSecret,appMovedCard,true); XMFunSDKManager.getInstance().initXMCloudPlatform(this,appUuid,appKey,appSecret,appMovedCard,true); 如果是低功耗设备(门铃、门锁等)还需要调用以下方法: FunSDK.SetFunIntAttr(EFUN_ATTR.SUP_RPS_VIDEO_DEFAULT, SDKCONST.Switch.Open); 初始化打印: XMFunSDKManager.getInstance().initLog(); ``` -------------------------------- ### MpsClient Initialization and Connection Methods Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/lib/Mps/MpsClient.html Details on initializing the MpsClient and establishing device connections. Includes the constructor and methods for initiating client operations. ```APIDOC MpsClient() - Constructor for the MpsClient class. - Initializes a new instance of the MpsClient. ``` ```APIDOC Init(int hUser, byte[] pSMCInitInfo, int nSeq) - Initializes the MpsClient with specific user and initialization information. - Parameters: - hUser: User handle. - pSMCInitInfo: Byte array containing initialization parameters. - nSeq: Sequence number. - Returns: Integer status code. ``` ```APIDOC DevConnect(int hUser, String uuid, int nSeq) - Establishes a connection to a specific device. - Parameters: - hUser: User handle. - uuid: Device unique identifier. - nSeq: Sequence number. - Returns: Integer status code. ``` ```APIDOC DevDisConnect(int hUser, String uuid, int nSeq) - Disconnects from a specific device. - Parameters: - hUser: User handle. - uuid: Device unique identifier. - nSeq: Sequence number. - Returns: Integer status code. ``` -------------------------------- ### Download and Installation Prompts Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/app/src/main/assets/language/zh_CN.txt User prompts for downloading and installing software or updates. ```APIDOC downloading=正在下载 Click_Install=点击安装 ``` -------------------------------- ### Sharing and Functionality Hints Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/app/src/main/assets/language/ita.txt Contains instructions and tips related to sharing content, accessing more functions, and specific sharing requirements for images and videos. ```en Download_to_share=Please click to download the image and then share more_function=more ``` -------------------------------- ### MediaPlay - Start Playback Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/lib/FunSDK.html Starts media playback. Requires a player handle and a sequence number. ```java static int MediaPlay(int hPlayer, int nSeq) ``` -------------------------------- ### FunSDK Initialization and Configuration Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/lib/FunSDK.html Methods for initializing and configuring the FunSDK, including setting application context, initializing network SDK, and managing P2P regional scope. ```APIDOC SetApplication(android.app.Application ap) - Sets the application context for the SDK. Init(int nParam, byte[] pParam) - Initializes the SDK with specified parameters. - Parameters: - nParam: Integer parameter for initialization. - pParam: Byte array parameter for initialization. - Returns: An integer status code. InitExV2(int param, byte[] pParam, int nCustomPWDType, java.lang.String strCustomPWD, java.lang.String strCustomServerAddr, int nCustomPort) - Extended initialization method with custom password type, password, server address, and port. - Parameters: - param: Integer parameter. - pParam: Byte array parameter. - nCustomPWDType: Type of custom password. - strCustomPWD: Custom password string. - strCustomServerAddr: Custom server address string. - nCustomPort: Custom server port integer. - Returns: An integer status code. InitEx(int param, byte[] pParam, java.lang.String strCustomPWD, java.lang.String strCustomServerAddr, int nCustomPort) - Another extended initialization method with custom password, server address, and port. - Parameters: - param: Integer parameter. - pParam: Byte array parameter. - strCustomPWD: Custom password string. - strCustomServerAddr: Custom server address string. - nCustomPort: Custom server port integer. - Returns: An integer status code. MyInitNetSDK(FunSDK.OnFunSDKInitListener ls) - Initializes the network SDK with a listener for initialization events. - Parameters: - ls: An instance of FunSDK.OnFunSDKInitListener. MyInitNetSDK() - Initializes the network SDK without a listener. SetP2PRegionalScope(int nRegion) - Sets the regional scope for P2P connections. - Parameters: - nRegion: Integer representing the region. ``` -------------------------------- ### PanoramaView Initialization Example Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/xm/ui/widget/PanoramaView.html A basic example of how to initialize a PanoramaView in an Android Activity or Fragment. ```java import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import com.xm.ui.widget.PanoramaView; public class MainActivity extends AppCompatActivity { private PanoramaView panoramaView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); panoramaView = findViewById(R.id.my_panorama_view); // Example: Initialize with a single image path // panoramaView.setImagePath("path/to/your/panorama.jpg"); // Example: Initialize with a bitmap // Bitmap panoramaBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.my_panorama_image); // panoramaView.setBitmap(panoramaBitmap); // Example: Initialize with multiple image paths // ArrayList imagePaths = new ArrayList<>(); // imagePaths.add("path/to/image1.jpg"); // imagePaths.add("path/to/image2.jpg"); // panoramaView.setImagePath(imagePaths); // Example: Setting a listener // panoramaView.setOnPanormaViewListener(new PanoramaView.OnPanoramaViewListener() { // @Override // public void onPanoramaViewClick(int direction) { // // Handle click event // } // }); } } ``` -------------------------------- ### Logging Utilities Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/lib/FunSDK.html Functions for logging messages and initializing the logging system. LogInit sets up the server IP, port, log file, and log level, while Log writes messages to the configured log output. ```Java static int Log(String szLog) static int LogInit(int hUser, String szServerIP, int nServerPort, String szLogFile, int nLogLevel) ``` -------------------------------- ### Stop Quick Wi-Fi Setup Methods Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/index-files/index-16.html Methods to terminate the quick Wi-Fi setup process for devices. ```APIDOC stopQuickSetWiFi() - Class: com.manager.device.DeviceManager - Interface: com.manager.device.IDeviceManager - Description: 结束快速配网 (Ends quick network configuration) ``` -------------------------------- ### MediaStartRecord - Start Recording Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/lib/FunSDK.html Starts recording the current media stream. Requires player handle, filename for saving, and sequence number. ```java static int MediaStartRecord(int hPlayer, String szFileName, int nSeq) ``` -------------------------------- ### Welcome Tips - Storage Permission Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/app/src/main/assets/language/ja.txt Informs the user about the need to open storage permissions to enter the app and directs them to settings. ```English TR_welcome_tips_storage=You need to open the storage permission to enter the app. Click settings to open it ``` -------------------------------- ### Cloud Platform Initialization Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/lib/FunSDK.html Initializes the cloud platform with provided credentials and configuration. ```Java public static int XMCloundPlatformInit(java.lang.String uuid, java.lang.String appKey, java.lang.String appSecret, int movedCard) ``` ```APIDOC XMCloundPlatformInit: Initializes the cloud platform connection. Parameters: uuid (String): Unique identifier for the platform. appKey (String): Application key for authentication. appSecret (String): Application secret for authentication. movedCard (int): Configuration parameter related to card movement. Returns: int: An integer status code indicating the initialization result. ``` -------------------------------- ### isApplicationAvilible: Check App Installation (Java) Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/utils/XUtils.html Checks if a specific application is installed on the device. Requires the Android context and the package name of the application. ```java public static boolean isApplicationAvilible(android.content.Context context, java.lang.String appPackageName) ``` -------------------------------- ### IBaseManager Interface Methods Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/manager/push/XMPushManager.html Documentation for methods defined in the IBaseManager interface. Includes initialization and uninitialization methods. ```APIDOC Interface: IBaseManager Methods: init(String initType) - Signature: public boolean init(java.lang.String initType) - Description: Initializes the manager. The exact purpose of initType is not detailed here. - Parameters: - initType: A string specifying the type of initialization. - Returns: A boolean indicating success or failure of initialization. - Located In: IBaseManager interface. unInit() - Signature: public void unInit() - Description: Uninitializes the manager, releasing resources. - Parameters: None. - Returns: void. - Located In: IBaseManager interface. Related Methods: getAlarmName (static method, potentially in a related class) ``` -------------------------------- ### isApplicationAvilible: Check App Installation Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/utils/XUtils.html Checks if a specific application is installed on the device by its package name. Requires the Android context to perform the check. ```APIDOC isApplicationAvilible(context: android.content.Context, appPackageName: String): boolean Description: 判断手机是否安装某个应用 (Determine if the phone has a certain app installed). Parameters: - context: The Android context. - appPackageName: The package name of the application to check. Returns: True if the application is installed, false otherwise. ``` -------------------------------- ### MonitorManagerInterface Half-Duplex Talk Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/manager/device/media/monitor/MonitorManager.html Manages half-duplex audio communication. Includes methods to start and stop the half-duplex talk feature. Requires an Android Context for starting the session. ```APIDOC startTalkByHalfDuplex(context: android.content.Context) - Description: Starts half-duplex talk. - Parameters: - context: The Android context. - Related: stopTalkByHalfDuplex stopTalkByHalfDuplex() - Description: Stops half-duplex talk. - Related: startTalkByHalfDuplex ``` -------------------------------- ### FunSDK Initialization and Configuration Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/README.md This code demonstrates how to initialize the FunSDK manager with cloud platform details obtained from the developer console. It includes the main initialization call and a specific setting for low-power devices. Ensure you replace placeholders with your actual `appUuid`, `appKey`, `appSecret`, and `appMovedCard`. ```java // If it is a P2P customized server, please refer to the following method // int customPwdType The default encryption type is 0 // String customPwd The encryption field is passed "" by default. // String customServerAddr Customize the server domain name or IP address // int customPort Customizing a server port // Get appUuid, appKey, appSecret, appMovedCard and other information from https://developer.jftech.com // isUseDefaultConfigPath Whether to use the default configuration path, which will save the device password and other information locally on the phone // XMFunSDKManager.getInstance(0,"",customServerAddr,customPort).initXMCloudPlatform(this,appUuid,appKey,appSecret,appMovedCard,true); XMFunSDKManager.getInstance().initXMCloudPlatform(this,appUuid,appKey,appSecret,appMovedCard,true); //If it is a low-power device (doorbell, door lock, etc.), you also need to call the following methods: FunSDK.SetFunIntAttr(EFUN_ATTR.SUP_RPS_VIDEO_DEFAULT, SDKCONST.Switch.Open); //Initial printing: XMFunSDKManager.getInstance().initLog(); ``` -------------------------------- ### DrawGeometry Class Methods Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/xm/ui/widget/drawgeometry/model/class-use/GeometryPoints.html Methods for managing and retrieving geometry points within the DrawGeometry component. These methods are used to get all points, get vertices, and set geometry points and types. ```APIDOC DrawGeometry.getAllPoints() - 返回变量类型为 GeometryPoints 的类型的 com.xm.ui.widget.drawgeometry.view 中的方法 - Returns: GeometryPoints[] - An array of GeometryPoints. DrawGeometry.getVertex() - 参数类型为 GeometryPoints 的 com.xm.ui.widget.drawgeometry.view 中的方法 - Returns: java.util.List - A list of GeometryPoints representing vertices. DrawGeometry.setGeometryPoints(GeometryPoints[] points) - Sets the geometry points for the drawing. - Parameters: - points: GeometryPoints[] - The array of points to set. - Returns: void DrawGeometry.setGeometryType(int type, GeometryPoints[] points) - Sets the type and points for the geometry. - Parameters: - type: int - The type of geometry. - points: GeometryPoints[] - The array of points defining the geometry. - Returns: boolean - Indicates success or failure of setting the geometry type. ``` -------------------------------- ### XMCloundPlatformInit API Source: https://github.com/bhavneeshgoyal99/final_cofe_app_android/blob/main/javadoc/com/lib/FunSDK.html Initializes the XM Cloud Platform. Requires UUID, app key, app secret, and a moved card flag. ```APIDOC XMCloundPlatformInit(String uuid, String appKey, String appSecret, int movedCard) - Returns: int ```