问题标签 [activeandroid]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - Android SQLite 创建表
我正在尝试使用 1 个表创建简单的数据库并将 activityandroid 用作它的 ORM。但是在开始项目后,我有这样的错误:
我什至在任何地方都没有这样的代码。我的 SQL 代码:
一些建议为什么会这样?我试图调试它,但在创建数据库之前它失败了..
java - In ActiveAndroid Is it possible to update a specific field in a table row without wiping out the rest of the data in the row
ActiveAndroid:
I need to push updates to specific table fields without wiping out any existing data in the row if i dont happen to save() data for all fields each time.
For example:
I have a table named 'user' which contains the following fields:
extSrc | extId | email | firstName | lastName | role | photo | userId | verified
If i save data to all fields except 'verified' and then I later need to update only the verified field - is this possible?
Currently when i use the code below, all fields except userId (which i have stored locally) and verified are populated, all other fields are cleared. At the time that i have the verified value that i need to update i dont have the additional user data to push / save() so i only need to update the specific 'verified' field when the userId matches a userId in the user table and leave all other fields for that user as they are.
My code:
Model:
Thanks.
java - ActiveAndroid 更新表字段,同时保持自动生成的行 ID 相同
我试图找到一种更新表格行中字段的方法,同时保持行 ID(由 Active Android 自动生成)相同。这在 Active Android 中是否可行,或者当特定行发生更新时,行 ID 是否总是会更新?
android - 使用 Robolectric 测试 ActiveAndroid
我该怎么做才能在 Robolectric 中对 ActiveAndroid 的 ContentProvider 进行一些测试?这个简单的测试失败了。
该模型:
考试:
生成的堆栈跟踪:
应用程序上下文应该没问题。默认情况下,Robolectric 创建显示在清单中的应用程序,在本例中为 com.activeandroid.Application。
所以,我很疑惑为什么Cache中的tableInfo没有初始化。正常的应用程序执行工作正常。
android - ActiveAndroid model bundle extras exception
folks! I wrote a Book class which has Chapter objects (a one to many relationship). It implements the method public List chapters(), as stated in the docs. This is the Book.java
On the main activity I can get the Chapter objects successfully. However, I have to pass a book object to another activity, which has a fragment, and though I get the object's stated attributes (String name and int sort) it throws an exception when I call to chapters():
the thrown exception is the following:
Any ideas what is wrong? Thanks!!!
android - 在 ActiveAndroid 中截断表后未保存的最后一个对象
我使用 ActiveAndroid 将我的对象保存到数据库中,效果很好。在我的应用程序中,我使用以下场景:
- 我将新对象保存到数据库中的表中
- 我从该表中选择了一些对象
- 我将它们添加到 List<>
- 我从该表中删除所有内容
- 我在我的列表上使用 foreach 并在每个对象上调用“保存”
问题来了。在我的表格中,除了前面提到的最近保存的对象之外,其他对象都被保存了。我创建了一个计数器来检查调用了多少“保存”:计数器比表中对象的计数多 1。我调试了它,没有引发异常,调用了保存。我使用最新版本的 ActiveAndroid (3.0.99)
我应该检查什么?
android - 添加新列后如何使用activeandroid更新表
感谢您的阅读和帮助:)
我正在使用 ActiveAndroid 3.0 - Android 2.2 - 在我的应用程序中,我有一个名为“用户”的模型。最初我只使用(id,name,passcode)列/属性创建模型,我在模拟器上运行了应用程序,它工作了。
然后我添加了一个新的列/属性 - profileImage。我在模拟器上运行了应用程序,我得到了 SQLite 列 profileImage 不存在错误。
我尝试更改 ActiveAndroid 数据库名称并更新清单文件中的数据库版本属性。
但我不断收到该列不存在错误。
我也尝试过,从模拟器中卸载应用程序,重新启动模拟器,调用 ActiveAndroid.cacheClear()。到目前为止,这些都没有奏效。
我真的很感激任何帮助。谢谢。
activeandroid - 尝试安装 ActiveAndroid 但得到 ClassNotFoundException
我正在尝试从 Pardom 实现 ActiveAndroid 数据库包。我创建了一个简单的自定义类:
并将以下内容添加到清单中:
但是应用程序崩溃了这个堆栈跟踪:
我不确定这里有什么问题。我在 java 构建路径中添加了 .jar 文件。然而我得到了这个 classnotfound 异常。该应用程序在我导入 android.app.Application 时加载。
android - 从 AsyncTaskLoader 调用方法时,方法不会被调用
事情就是这样,我有一个 AsyncTaskLoader 使用Jsoup从网页加载数据并使用ActiveAndroid将其存储在 SQLite 中。
我的所有解析和数据库方法都在一个名为 Parser 的类中,我不会费心解释原因,但是当我从 Loader 调用 Parser.getList 方法时,它不会被调用。
当我出于某种原因将方法的内容移动到加载器中的 loadInBackground 时,绝对没有任何反应。有人对此有想法吗?
android - 活跃的Android多对多关系
虽然这个问题是关于 ActiveAndroid 的,但任何熟悉 ORM 的人都可能会回答这个问题。
ActiveAndroid 似乎没有为您提供开箱即用的多对多关系的方法。我在寻找解决方案时发现的是这个 GitHub 问题:https ://github.com/pardom/ActiveAndroid/issues/46
我知道它明确地创建了关系表,但我不明白以下部分应该如何做任何有用的事情:
这将导致类似的查询SELECT * FROM Foo where Foo.FooBar = FooBar.Id;
。这将最多返回Foo
一行。我错过了什么吗?
您不需要涉及联接的查询吗?