I wanted to confirm how a reference (as a data member of a class) to
another class impacts the loading of the referenced class by the VM.
For example, if I have a service that supports N different calling
API's (each bindable via a different action), then as a part of
starting up my service
I may want to defer the VM's loading of the implementation of the
various API's supported by the service until "bind time". If I refer
to each handler within my service
class via a Java interface rather than as a class extending the aidl
generated 'Stub' class for each API, then when my service class starts
up I shouldn't have the overhead
of loading all the classes implementing the supported API's.
I wanted to confirm when various classes within my service were being
loaded by the VM via the '-verbose:class' option to the VM. The only
two options I saw for doing this would be to either manually start the
application in an adb shell via the 'dalvikvm' command directly, or
set this property via the 'setprop' command and perform a 'stop ;
start' within the shell.
In the meantime, what I have done is defined a boot time intent
receiver that will manually start my service up, but not bind to it.
In my services 'onCreate', I'm listing all the loaded classes via the
'Debug.printLoadedClasses' API call. I was able to learn what I
needed to in this fashion...