Skip to content

getCoreRootPath ​

Get the Core Module Root Path ​

getCoreRootPath is a method provided by the SUDRTGameCoreHandle interface, used to query the physical root directory address where the current engine core (Runtime Core) was loaded from.

This path is usually the KEY_CORE_ROOT_PATH value passed in via the Bundle when SUDRT.loadCore() is called.


Method Declaration ​

java
/**
 * Return the root path of the Runtime Core module
 * * @return The absolute path string where the core engine files reside
 */
String getCoreRootPath();

Runtime Behavior ​

  1. Path traceability: It returns the starting location that the SDK uses at runtime to locate the core configuration, script libraries, and base native resources.
  2. Verification use: Developers can use this method to confirm whether the SDK has correctly recognized and mapped the expected installation path.

Example ​

java
// Extract the path from the obtained core handle
String rootPath = coreHandle.getCoreRootPath();

if (rootPath != null && !rootPath.isEmpty()) {
    Log.d("SUDOP", "Core engine is running from: " + rootPath);
} else {
    Log.e("SUDOP", "Core root path is undefined.");
}

Notes ​

  • Read-only property: This method is only for reading information. To change the path, you must reconfigure the parameters and start a new process to reload the Core.
  • File permissions: The returned path only represents the configured address; the caller must ensure the app has at least "read" permission on this path, otherwise subsequent resource loading may fail silently.