greendao

android完整资讯App、Kotlin新闻应用MVP + RxJava + Retrofit + Dagger2、优雅区间选择器等源码

佐手、 提交于 2019-12-04 05:58:18
Android精选源码 Android完整资讯客户端源码 android展示注册进度效果源码 Android Wifi热点数据传输Socket 通信示例源码 Android Dota的辅助信息app源码 Android 播报栏 一款Kotlin新闻客户端, MVP + RxJava + Retrofit + Dagger2 TODO 最适合练习主流框架的应用 (原创作者) BezierSeekBar优雅的区间选择器,贝塞尔曲线样式,丰富的自... Android优质博客 Android Activity四种启动模式图文详解 Activity是安卓上最聪明的设计之一,优秀的内存管理让多任务完美运行在最流行的操作系统之上。并不是让Activity在屏幕上启动就完事了,其启动方式也是需要关注的。这个话题的内容很多,其中很重要的就是启动模式(launchMode)。这也是我们这篇博客要讨论的内容。因为不同的Activity有不同的目的。有些被设计... 阅读原文 Android View绘制源码分析 Layout FrameLayout的位置是在父类View中就确定了的,不像measure流程大小是由子View的大小确定,自定义ViewGroup必须实现onLayout方法,因为在ViewGroup中该方法是个抽象方法,在layout执行完成后调用View的getWidth

GreenDao Many to Many Relation

妖精的绣舞 提交于 2019-12-04 04:08:09
问题 I use Greendao for my database mapping in Android. So far everything works great. But now I have the following problem: I have a Cluster and leaf Objects. A cluster contains many leaf objects. If a cluster is zoomed it can split up in more clusters and more leafs. This is not a strict tree relationship it is more that a big cluster has a lots of leafs but a small cluster can have a subset of this leafs. Basically a cluster has many leafs but leafs also are in multiple clusters, since the id

GreenDao freemaker.jar is missing

↘锁芯ラ 提交于 2019-12-04 03:09:30
I just downloaded the new jar file for GreenDao in order to create my DB for the app I'm building. After going through all the process of modeling my entities and the connections between them, I tried to run the generator project but got this error for the line that generated the DB: Exception in thread "main" java.lang.NoClassDefFoundError: freemarker/template/ObjectWrapper at com.glide.talk.glide.model.generator.Model.main(Model.java:29) Caused by: java.lang.ClassNotFoundException: freemarker.template.ObjectWrapper at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security

How to clean/delete greenDao database

↘锁芯ラ 提交于 2019-12-03 23:55:22
问题 Currently I'm doing it like this: DaoMaster.dropAllTables(getDb(), true); DaoMaster.createAllTables(getDb(), true); but then, when I'm trying to add entity to the database, I'm getting crash log saying that this table isn't exist Edit1: I know that it happens because the db is locked and tables wasn't created yet. So I'm reducing this problem to the problem - how to know if the tables are locked in grrenDao/Sqlite? 回答1: Until now, I don't worry if tables are locked or not; in my case, i do

Proper way to add index columns in greenDao?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 12:51:37
问题 I am building a data model in greenDAO. It is a port of an iOS app that uses Core Data. In iOS we use indexes (indices?) to increase lookup performance in a table of 20 columns (properties) where 5 columns are frequently queried. I know this results in extra storage and provides slower writes into the table. Digging in the documentation, I came across the addIndex(Index index) method in Entity and the index() method in Property.PropertyBuilder. Which is the correct way to add an index to an

greenDAO 40 seconds to insert 600 records

为君一笑 提交于 2019-12-03 09:02:33
问题 I've chosen greenDAO because it's site states that it's one of the fastest ORM systems for android. To my dissapointment it takes it like 40 seconds to insert 600 records on Samsung i9001. I'm not sure if I'm doing anything wrong. Could you suggest anything to lessen the amount of time it takes to perform those operations ? generator code: private static void addNewsArticle(Schema schema) { Entity article = schema.addEntity("NewsArticle"); article.addIdProperty().autoincrement(); article

GreenDAO: store list of entities in other entity

心已入冬 提交于 2019-12-03 08:26:31
I am playing around with GreenDAO and I think I like the way it works. I do not like to write SQL code, so this will help me avoid it ;) But still, I think it really is very 'sql'-based thinking of how you set it up. Not sure if this is a bad thing (to know how things work), but I'd rather just say: here is my object! Store it! But I haven't found anything for this yet... But ok, what I am doing is sort of the following: I have an object, let's say a bookshelve. I put some books on the shelve. This would look something like: class BookShelve { List<Book> books; void add(Book b) { books.add(b);

Proper way to add index columns in greenDao?

微笑、不失礼 提交于 2019-12-03 03:08:40
I am building a data model in greenDAO. It is a port of an iOS app that uses Core Data. In iOS we use indexes (indices?) to increase lookup performance in a table of 20 columns (properties) where 5 columns are frequently queried. I know this results in extra storage and provides slower writes into the table. Digging in the documentation, I came across the addIndex(Index index) method in Entity and the index() method in Property.PropertyBuilder . Which is the correct way to add an index to an Entity? Entity entity = schema.addEntity("entity"); entity.setSuperclass("SuperClass"); entity

greenDao Schema Upgrade

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 选择语言 中文(简体) 日语 英语 中文(繁体) 由 翻译 强力驱动 问题: I have seen another question about schema upgrade/migration using green dao ( here ) There are lots of links in that answer for a good pattern to use when doing schema upgrades - however there are no examples of what you actually do to your data to migrate it properly and I'm having trouble finding anything. In my case, my migration is incredibly straight forward - I do not wish to transform any existing data, I simply need to add some new tables to my schema, which I suspect is a fairly common situation.

NoClassDefFoundError when trying to run DaoGenerator for GreenDAO

匿名 (未验证) 提交于 2019-12-03 00:50:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an Android Project, using Android Studio 2.3, which uses GreenDAO to generate the classes to interact with the SQLite database. The DaoGenerator project always worked before... but today I just needed to add 2 columns/properties to an Entity and whenever I try to run the generator project, I get the following error: Exception in thread "main" java.lang.NoClassDefFoundError: org/greenrobot/greendao/generator/Schema at com.company.daogenerator.ProjectDaoGenerator.main(ProjectDaoGenerator.java:20) at sun.reflect.NativeMethodAccessorImpl