using android:process=":remote" recreates android Application object

android, process, service

Solution

I also want to run it another process

Why? What value does that add to the user, to offset the additional RAM, CPU, and battery cost? Very few apps need more than one process.

My problem is that when the ':remote' process starts it apparently recreates Application object

Of course. Each process gets its own.

I really do not with that as I override application object and call lots of client stuff in the 'onCreate()' method

Then get rid of `android:process=":remote"`. Your users will thank you.

Yet I want the service code to reside in the same apk with the client.

What service?

Is Application object always recreated when new process starts?

Yes.

Problem

I'm using AIDL service in my app. I also want to run it another process, so I use `android:process=":remote"` in service declaration in the manifest. My problem is that when the `:remote` process starts it apparently recreates `Application` object. I really do not with that as I override application object and call lots of client stuff in the `onCreate()` method. Yet I want the service code to reside in the same apk with the client. Can I achieve that? Is `Application` object always recreated when new process starts? Appreciate your help. Thanks!

Original source