-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
creating new service does not start the service #270
Comments
I tried also to retrieve a Binder to the PythonService and did not work...maybe it is a problem of naming in the manifest. Can you tell me what could be the problem. |
Can you show the code that you used to do this in Java and the code that failed for you in Python? Also at this time I do not know if it is possible the android.Service class was written a long time ago and needs much improvement to make it more like a real service, but Pyjinus may enable such changes. Also what do you mean by different packages? Different Apps, I would think that is possible. |
Thank you for the answer. Yes, I am using Pyjnius. In the end the incompatibility/problem was that I was trying to create an AIDL service from another package than org.renpy.android. I had a deeper look but I got stuck in the way PythonService is initialized. In order to reproduce the environmental setting it would have taken me at lot of time and was not sure it was going to work. In the end I did not change the manifest as I decided to use a service exposed to bind operation from the PythonService, which is not exposing such a service originally. It would have been nice to have something plug and play. |
Hey that sounds cool, would you share your Pyjnius code to start the additional service? |
I guess I can resume the tricky part as: The trick is to set the binder in the PythonService from Java/Pyjnius and then implement your own Binder. The AIDL files were compiled nicely. There was another problem when the AIDL is complicated and contains classes that are not inside your project. For that I used in the build line the option --add-jar to include the library containing those compiled Java classes. If you are wondering whre is this used, I am working on the non-open source project OpenMTC: |
Dear all,
I would like to create a new service that starts when PythonService starts.
What I did was to create an aidl, java class to implement the Service interface and extend the Stub in the same package as PythonService.
I modified the manifest xml template to expose the service in the same process as PythonService, but still the service is not started.
When using the same code in another pure Java application the service starts well, a client can bind to it.
Can you tell me what key steps am I missing.
Thanks in advance for your help.
Ancuta Corici
The text was updated successfully, but these errors were encountered: