android AOP笔记

2021-07-09  本文已影响0人  winxx

一 ,接入

AspectJ是Eclipse出品的Aop框架,可以帮助我们进行很方便的Aop编程。

在Eclipse中已经有AJDT插件集成了AspectJ编译器的使用和关键字的声明。但是在AndroidStudio中没有这样的官方插件。

在androidstudio进行aspetj接入,试过几个方案 ,以下方案比较靠谱,只要进行相应Gradle配置:

https://fernandocejas.com/blog/engineering/2014-08-03-aspect-oriented-programming-in-android/

也就是参考该示例接入:

https://github.com/android10/Android-AOPExample

二,使用语法介绍

官方文档: https://www.eclipse.org/aspectj/doc/released/progguide/starting-aspectj.html

木有看到比较好的中文文档,可适当参考文末的一些链接等。

一些参考链接:

https://www.2cto.com/kf/201605/512821.html

https://blog.csdn.net/XiNanHeiShao/article/details/74082605

上一篇下一篇

猜你喜欢

热点阅读