-
Notifications
You must be signed in to change notification settings - Fork 0
Dphan/add android #1
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
45
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
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
in api we assume that enum has an int value, that is not a case in java. The java enums are objects, which are set constants. Not narrowed to an integer type. To make them work within our ecosystem that includes other technologies, where enums are integer based, I added a int field value and functions to obtain the value for serialization, and create an enum based on the integer. This is part of adding an andorid-jni feature.
it is not a good practice to have a modules names that have dot Usually the dot separates submodules This is part of adding the android-jni feature.
add the async version of methods. When using with rpc we don't want to block main thread, the rpc anyway assumes the answer will arrive at some point later. add the isReady property, which is also required when using rpc mechanisms. This is part of adding the android-jni feature.
the generated names were incorrect, that is fixed now. This is part of adding the android-jni feature.
The reason for change is alignment with other techologies implementations This is part of adding the android-jni feature.
the java convention (and ease of use) is that each class or struct has its own file. The api was split to fulfill that practice. This is part of adding the android-jni feature.
adds necessary gradle files to allow the project to be build with e.g. android studio. The gradle was chosen because of compatibility with unreal build system, as the main purpose of all the changes in the series of commits is to allow easy data change between unreal and android. Most of the modules will be used with unreal to achieve that. This is part of adding the android-jni feature.
an android service is created for each interface. It allows setting a backend that fullfills the interface. The intention is to be albe to provide java-jni impl e.g. by unreal (but it can bu also pure java implementation). The backend is created by factory, so it is in same thread as the service. Note that the services are created in applications thread, not in a separate ones, so having many interfaces and thus many services does not cause the many threads overhead. The messenger part is not yet there. It will be added with following tasks. The service must be started implicitely with context.startService(theService) function. This is part of adding the android-jni feature.
add gradle files with which it can be build with android studio or with unreal. This is part of adding the android-jni feature.
7f8a3f3 to
10f3ef9
Compare
adds an empty implementation of generated interface. It fully supports handling properties (with the property change singal emission). It generates empty methods, to be filled with bussiness logic. It may serve as an example or base implementation. It allows easy implementing android service side when provideded as a backend, hence all the helper file, facory, and service starter which implicitely start the service. This is part of adding the android-jni feature.
Adds all the "topics" of messages (an enum). Introduces a parcelable type that wraps generated structs. This works only for structs with simple types. The parcelable will be extended with handling complex types in later tasks. This is part of adding the android-jni feature.
Adds handing then messages: calls proper methods on backend when serving incoming messages and sends messages when notified by backend about changes that must be forwarded to clients. Added initial tests. This is part of adding the android-jni feature.
add tests that actually check if service properly reacts on receiving messages and sends messages when needed. This is part of adding the android-jni feature.
adds the version of the backend that has some native functions. This will be used with e.g. unreal template. There are no build files as unreal has its own system. This is part of adding the android-jni feature.
adds a client adapter, that implements the ServiceConnection and the api interface. A client is generated per api interface and connects with its Service counterpart, that may be provided by diferent applications. It requires the desired package that exposes the service to be given for binding. The service must be already started - the intent does not start it. The client allows registering an event listener to get info about all the changes that service informs about. In that way it allows adding a jni version of that listener, which will be added later. This is part of adding the android-jni feature.
This is part of adding the android-jni feature.
adding new event and a way to fire it to get info about object isReady state change (e.g may be used for connection established or backend ready). This is part of adding the android-jni feature.
adds an almost ready to start application for test purposes. IMPORTANT it generates the functionality only for first interface. That is for usability purpose, some tabs could be introduced for each interface, but this make example more complex. It genereates buttons to request some propety changes: IMPORTANT the logic how to change it needs to be implemented by user, similar for executing methods, the user must provide proper parameters. It prints the result of events received from service: property changes, singals receivied, method results. This is part of adding the android-jni feature.
add message and handling that allow synchronizing the client state with the service state on the connection established. The service sends all the values of properties. This is part of adding the android-jni feature.
add parcelable wrappers for enums and add proper handling of them in service and client. IMPORTANT: it is not yet handled if enum is part of struct. This is part of adding the android-jni feature.
In java the structs (java objects) are passed by ref. The copy constructor helps proper managing of lifetime when handling with Parcelable objects. This is preparatory commit to be used for helpers when handling arrays of structures. This is part of adding the android-jni feature.
Add functions for (de)serializing arrays of parcelable elements. This is part of adding the android-jni feature.
Adds handling of arrays of all types: simple types, enums, structs. adds some go templates for easier handling same code in many places. Add handling of arrays of any type for messanger in service. NOTE: using template makes the code not aligned This is part of adding the android-jni feature.
service uses a stub as the backend. It is generated only for the first api interface. User needs to fill the logic of changing properties and emitting singals. All the buttons and text views are already correctly connected. It provides a buttons to start or stop service, change properties, emit singals. The methods are also working, if the client sends a request it is served, but the logic needs to be implemented in the stub i.e the _impl module. This is part of adding the android-jni feature.
It is an event listener that has native methods that needs to be implemented with cpp code. It allows adding e.g. unreal client adapter. There are no project files added as unreal provides its own build system. This is part of adding the android-jni feature.
998041e to
617648b
Compare
Structs have now implemented equals function and hashCode.
0ccd280 to
65e5b6a
Compare
use better comparing functions for structures and arrays. Use implemented equals() for the strucutres. Tests requires now filling the structures with some data other than default, cause before setting new value and expected notification it is checked for equality (not set in that case). With new compaision that checks the content not addres of object it needs to have some values.
Adds an app that uses composite build and builds all dependant modules. The modules are in the diretory of rootproject. Each module must provide a version. The app just makes instances of all intefaces implementations: stub and if android feature enabled also the client and service versions. Adds a task to run all unit tests.
a8d0bdd to
c886772
Compare
4a781ca to
e12f805
Compare
ee448a9 to
c943165
Compare
042765b to
b8cf43d
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.
Closes # https://jira.it.epicgames.com/browse/APIGEAR-275
Closes #
📑 Description
✅ Checks
ℹ Additional Information