Usable VideoView source code for Android 2.2

人盡茶涼 提交于 2019-12-06 15:35:51

First of all, Android base framework is open source, there is no difference between the source code from grepcode and the original one from github. They both have pros and cons, source code in grepcode is tagged by API level so easy to navigate specific version of API class, where source code in github have complete change history for every commit, but a bit complex to find/retrieve the early version of specific API class.

the VideoView.java on grepcode references an mContext object which is inherited from View, but not available in the View of the developer.android.com sdk

mContext is marked as @hide in android.view.View, see head version in github.

the VideoView calls a resume method of MediaPlayer which is also not available in the standard MediaPlayer class.

resume() is marked as @hide in android.media.MediaPlayer, see earlier version in github or tag 2.2_r1.1 in grepcode.

Generally speaking, the development API (android.jar) that google provides to consumer developer has the com.android.internal and @hide APIs stripped off. However, the runtime API (framework.jar) that installed on the actual device has everything.

If you want to use these internal and hide API in your own code, the solution is to use either java reflection or the workaround inazaruk explained in his blog here.

Hope this make sense.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!