在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):stephanenicolas/ormlite-android-gradle-plugin开源软件地址(OpenSource Url):https://github.com/stephanenicolas/ormlite-android-gradle-plugin开源编程语言(OpenSource Language):Java 85.6%开源软件介绍(OpenSource Introduction):ORM Lite Android Gradle PluginA Gradle plugin for Android to generate an ORMLite configuration file and boost DAOs creations. As of version 1.0.13, ORM GAP is fully incremental and gets executed only when classes using ormlite change. Usage//build.gradle
buildscript {
repositories {
...
mavenCentral()
}
dependencies {
...
classpath 'com.github.stephanenicolas.ormgap:ormgap-plugin:x.y.z'
}
}
apply plugin: 'android'
apply plugin: 'ormgap'
...
You will then need to create your database using the ORMLite config file that will be generated during your build (note : you first need to boostrap the system, get a file generated, then reference it.) public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION, R.raw.ormlite_config);
} If you use DAOs : you will need to use the second contructor of ORMLite's DAO class : public MyDao(ConnectionSource connectionSource, DatabaseTableConfig tableConfig)
throws SQLException {
super(connectionSource, tableConfig);
} You're all set. See ORM Lite docs for further instructions. ExampleAn example can be found in the GH repo. How does it work ?We basically just automated a technique that is considered the best practice for ORM Lite on Android : it uses a configuration file, genereated at build time, so that ORMLite doesn't scan annotations. ORMGAP will do the following to your build :
BenchmarkingOur plan is to make a benchmarking app using the example android app. For now, we can only give you a number from our experience at Groupon: the average gain, for all devices of our 50 million users is 10 ms per DAO creation. It might not seem much, but for large apps, it makes a difference. In our app, we gained 400 ms with ORMGAP. CITravis is almost ready at : https://travis-ci.org/stephanenicolas/ormlite-android-gradle-plugin CreditsORMGAP has been possible thanks to Groupon ! And, yes, we are hiring Android coders. ORMGAP is part of our open source effort. License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论