Skip to content

Conversation

dorotaphanSiili
Copy link
Collaborator

@dorotaphanSiili dorotaphanSiili commented Aug 20, 2025

still missing:

  • meaningful descriptions of commits
  • https://jira.it.epicgames.com/browse/APIGEAR-309 readme
  • take a look at the repetitive code between client and adapter- maybe sth can be reused
  • code alignement is a bit off because of reusing code - probably can be somehow fixed
  • fix commit for data converter - clean up the file, maybe split it
  • generate code, commits only change templates
  • decide what to do with using the delegates in client that come from apigear (probably duplicate and don't use other module)

Closes # https://jira.it.epicgames.com/browse/APIGEAR-276

  • To fully work requires the java template to be released and added to registry

📑 Description

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

@dorotaphanSiili dorotaphanSiili force-pushed the dphan/add_android branch 3 times, most recently from 7d8ceb0 to caebbf6 Compare August 21, 2025 09:13
@dorotaphanSiili dorotaphanSiili force-pushed the dphan/add_android branch 4 times, most recently from cbedeea to 14a43b0 Compare August 25, 2025 10:56
add all the new module files, updates the plugins with new module
The service stub is minimal empty implementation that does not yet
handle any jni.
It can be created, allows setting a backend, it provides empty methods
common for all service adapters.
adds gradle files necessery for the android build,
adds ue4shared.keystore also needed for the android app to be run
and the jni_UPL.xml which allows adding the configuration for unreal
generated xml file
the upl does not yet have necessary configuration
fill in the upl file to copy necessary java modules.
the modules must be placed inside the plugin directory in the android
folder. This code is generated by java template.
The also expose the services provided by the java code, adds permission for binding, adds queries (this part is necessery for clients).
All the dependencies for includes and modules are also added.
adds the code generated for the jni implementation for backend.
It requires implementing native functions.
For now they are added to service adapter but without implementation.
Introduce a service starter class that allows starting and stopping the
android service provided by the java template.
An android service needs to be explicitly started and in a thread of the
unreal application, jni backend with unreal implemnetation must be provided to it.
The java part of serivce starter of the jni module, handles most of
that, the added cpp class runs that code.
The object returned by it is the java jni service backend that was
instantionated for the service. It should be used to perform operations
on it.
@dorotaphanSiili dorotaphanSiili force-pushed the dphan/add_android branch 2 times, most recently from 3c8c362 to a8b08eb Compare September 5, 2025 07:04
Jni data types must be translated into cpp data types, and vice versa.
The data converter helps convert strucutures and enums added in the
modules. It also handles the arrays of those types.
execute the jni service backend function informing about ready state changed.
adds a handle for the unreal service class
this way the jni implementation can access necessary, public functions
of the unreal service class.
This will be used for e.g. handling property change requests.
add data translation from cpp type to java type, that may be reused
later.
Provide translated property to jni.
The function purpose is to inform the jni implementation about new
value, whenever the value of the service was changed.
The "In" prefix was removed from property name to be able to reuse the
common code for translating cpp to java types.
The purpose of this function is to inform the jni impl that the service
emitted signal.
Data is translated for all parameters and jni is informed about
the singal with correct parameters.
Added the data translation from java to cpp.
This was not templated.
The function must be executed with AsyncTask, this is because request
comes from other than game thread, but results in broadcasting delegate
and some subscribers are expected to be in blueprints.
Translates data from java to cpp and result from cpp to java.
Does not use template for the result to keep the name more meaningfull.
WARNING: the executing of method may cause some side effects like changing
the property or emitting a signal. In this case the application will
crash.
The way to solve this is either always broadcast with AsyncTask
or have a promise for the result, schedule executing method with
AsyncTask which should fill the result.
The method should wait for it.
the tests_common are missing usecase for array of enums
This is not essential but makes the testing easier.
minimal non functional implementation of jni client.
Implements the UAbstract interface, but returns only deafault values.
Adds the jni client java files that requires implementing the native methods.
The implementation of them just returns default values.
make the instance of java jni client.
Add functionality to bind and unbind to a service through the jni
client.
When the jni client notifies it is ready to use (or changes that status
to false) it calls native function. This notification should be
broadcasted to whoever is interested about the connection status
changed.
For this purpose the delegates are added and exposed.
The commit adds those delegates along with a dummy class which is
necessary for the delegates to properly compile.
The commit introduces a mechanism of global function, that is provided by the
unreal client impl on init and set to an empty default version on
deinit.
Thanks to that function a more complexed actiom may be executed like
allow changing a member value (to track the state).
Also AsyncTask is used as the broadcasting informs also subscribers that
are expected to be in blueprints.
the purpose of this function is pass the request of propety change to a
java jni client side (which later will be sent to an android service).
Introduces the template for data translation from cpp to java param.
The template uses cpp name with "In" prefix.
Inroduces a global function for each property that gets changed.
The function by default just logs, but is set but the unreal client on
init and reset to the empty one on deinit.
The behavior added by unreal client is: to change the local value and
broadcast the value. The fact that it needs change the object state
makes it impossible to just use the public api of the object.
It uses the global pointer to the unreal client class, which is set in
the init and reset in deinit.
Since the signals are only to be broadcasted and no internal state
needs to be changed it was enough just to expose the unreal client, no
need for extra functions.
Executing a methods requires preparig a promise and storying it while
waiting for the messege reaches the service and a response is delivered
back to the client.
This commit provides a method helper which allow storing promisses for
certain result types.
This object is stored globally (the client is anyway a subsystem).
Forwards the method execution request to jni client, along with a
unique id.
Handles the native function which provides the result, and based on the
id resolves proper stored promise.
tests checks for now that usage on non android device is safe. Does now
work in terms of communication with android, but is valid and doesn't
crash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant