We have developed one android application which will send the request and receive the response from the server and based on the response it will update the UI.This application handles so many different types of requests and it will enunciate as well as display the server status on the status bar.
this application is having around more than 50 different activities and one service handles all request/response and all activities bound to this service so whoever will send the request he will bind with the service and send the request and get the response back.
Now what problem we are facing is as we have added so many request/response because of that it seems like service becomes more overloaded, so obviously application is also get very slow.
So we have decided to make service as separate process including android:process for service in manifest file and try to implement AIDL for that.
But it is not that much easy because each activities making the connection with service and sends its textView,handler, activity to service using Service register() method.
so we can’t go for AIDL because AIDL only supports primitive types.
So my doubts are:
1. can we make service as separate process and it should be there in same application and packaged with same apk?
2. how to handle situation mentioned above where activity depends on service with passing some objects to service and service updates those objects and activity uses it, when we implement AIDL(as far as i know AIDL only supports primitive types)?
3. Activity uses some member variables of service so if we changes to AIDL how to make use of those member variables(these member variables are custom objects)?
I tried my best to explain the problem with some examples so please provide me some valuable inputs.
Regards,
Piks.
Is it absolutely necessary that you send references to your text views? Sounds like adding
android:process=":remote"should do what you want, but if you have the service running in another process, I don’t think you should be trying to pass UI references. Can you not update the text views based on responses from the service?If you are not allowing access from other application, you can just use a binder as described here http://developer.android.com/guide/developing/tools/aidl.html
This is what we did to pass lists of objects and it worked well.