Retriofit,Fresco,Greendao在application中的初始化配置
来源:互联网 发布:拍小视频创意点子 知乎 编辑:程序博客网 时间:2024/05/21 05:59
public class IApplication extends Application { public static IGetDataService service; public static DaoSession session; @Override public void onCreate() { super.onCreate(); //1.初始化retrofit Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://www.zhaoapi.cn") .addConverterFactory(GsonConverterFactory.create()) .build(); //访问网络数据的对象 service = retrofit.create(IGetDataService.class); //2.初始化Fresco Fresco.initialize(this); //3.初始化greendao DaoMaster.DevOpenHelper openHelper = new DaoMaster.DevOpenHelper(this, "tablename"); Database database = openHelper.getWritableDb(); //操作数据库的对象 session = new DaoMaster(database).newSession(); }}
别忘了在清单文件中引用
阅读全文
0 0
- Retriofit,Fresco,Greendao在application中的初始化配置
- Retriofit,Fresco,Greendao在Application中的初始化配置工具类
- GreenDao 在 Android Studio 中的配置使用
- GreenDao 在 Android Studio 中的配置使用 之 更新数据库
- Android greenDAO在Android Studio中的配置与使用
- Application中的初始化
- Android M以上在Application中初始化配置的问题
- greendao在项目中的实践
- GreenDao--retrofit--fresco--eventbus--recyclerview
- MVP+Retrofit+fresco+greendao+eventbus
- GreenDao详解(二)之在项目中配置GreenDao
- Android SQLite ORM框架greenDAO在Android Studio中的配置与使用
- GreenDao在eclipse上的配置
- 在android studio中配置GreenDao
- greenDao在android studio中的引用
- GreenDao在Android项目开发中的使用
- GreenDao在Android Studio中的使用
- greendao配置
- SpringMVC源码-处理json请求过程
- 我在xxx公司的日子 2017.11.1
- 使用Servlet进行用户登录(六)
- 推荐一些不错的技术团队博客
- RXTX Version mismatch
- Retriofit,Fresco,Greendao在application中的初始化配置
- Imageview
- 判断网络连接是否正常EventerBus发送
- 函数
- ACdream 1015Double Kings
- 迷茫的我
- minecraft1.12反汇编
- 如何高效学习?
- 分治思想之快速排序