mardi 30 janvier 2018

android.os.ServiceManager: ClassNotFoundException even with Java reflection

I have some sample code trying out Binder in Android here.

I know android.os.ServiceManager is hidden API. So I use reflection to access it. But even with reflection I have following exception:

java.lang.ClassNotFoundException: android.os.ServiceManager

So even with reflection I couldn't access android.os.ServiceManager. Or is there any configuration error in the Android.mk?

The code is adapted from here. Sorry the README.md is in Chinese. The repo is little bit old. So it's still using Android.mk, not gradle. Any advice?





Aucun commentaire:

Enregistrer un commentaire