Android Question Check by code if a library is loaded

Levit

Member
Licensed User
Longtime User
Hi everybody,
Is there a way to check by code if a library is loaded ?
I want to make a library that will use other library resources but ONLY IF that other library is loaded.
Example:
I make a library that may use 'SetscreeenOrientation' IF 'Phone' library is loaded.
But if I use my library in an app that uses only 'Portrait' I don't need to load 'Phone' library.

something that do this: if Phone library is loaded then....

is it possible?

Thanks
 

Levit

Member
Licensed User
Longtime User
It is possible by making the calls with reflection. I think that in most cases it is a waste of time / energy. The Phone library is 80k. Google Play Services for example is 3 or more megabytes.

Thanks @Erel
I'll give it a try. At least I learn a bit more.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…