How to pass parameter to the 01_HellowWorld (urho3d app) from android activity (LauncherActivity.kt)


#1

i have a string of user’s profile in anddroid LauncherActivity

i want paas it to a urho app


#2

im sorry i cant advise yet, but i am getting there rapidly - within two weeks I guess, I will have an android build


#3

There is @Lumak repositories on Github which provide samples for that.


See the ServiceCmd class for more details.


#4

i can invode function between activity and .so through jni.
i want a urho3d ‘offical’ solution .


#5
/**
 * This method is called by SDL before starting the native application thread.
 * It can be overridden to provide the arguments after the application name.
 * The default implementation returns an empty array. It never returns null.
 * @return arguments for the native application.
 */
protected String[] getArguments() {
    // Urho3D: the default implementation returns the "app_process" as the first argument instead of empty array
    return new String[]{"app_process"};
}

this is a graceful solution


#6

Yes. Just remember that Urho3D engine expects the arguments in the same format as other platforms. i.e. Arg 0th in the array for the name of the program/process, arg 1st is the first argument from the app’s perspective, and so on.