-
Notifications
You must be signed in to change notification settings - Fork 3
Dphan/add android #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dorotaphanSiili
wants to merge
44
commits into
main
Choose a base branch
from
dphan/add_android
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dphan/add android #150
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7d8ceb0
to
caebbf6
Compare
cbedeea
to
14a43b0
Compare
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.
3c8c362
to
a8b08eb
Compare
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.
4a2ce9a
to
4abae58
Compare
most probably should be updated for ue5.6 version
4abae58
to
d0b751e
Compare
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.
d0b751e
to
2c8acef
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
still missing:
Closes # https://jira.it.epicgames.com/browse/APIGEAR-276
📑 Description
✅ Checks
ℹ Additional Information