使用SourceInsight查看android中的native方法
16lz
2021-12-28
SourceInsight真的是查看源代码的神器。只要知道了文件名,就可以快速定位到文件。最近在研究Android的touch系统,发现MotionEvent的getX()方法调用的是nativeGexAxis(),于是想看看该本地代码是如何实现的,但我不知道nativeGexAxis的实现代码在什么位置。Android中的类调用本地代码是通过类名相似或Android.mk文件定义。MotionEvent所在的pack为android.view,将点号换成下划线,我们可以推测MotionEvent中的本地代码所在文件为android_view_MotionEvent.在SourceInsight右侧的ProjectWindow输入android_view_MotionEvent,如图中红色区域所示,立刻找到源文件。
更多相关文章
- Android(安卓)UI学习 - 对话框 (AlertDialog & ProgressDialog)
- Android(安卓)中自定义View的应用 (自绘TextView) ---- 转
- Android(安卓)自动化测试―robotium(一)环境
- Android之Adapter用法总结
- android binder 讲解
- android emulator中调用部署在我自己电脑上的webservice
- android logo、android开机动画改变详解
- Android中Service的使用详解和注意点(LocalService)
- NPM 和webpack 的基础使用