Questions tagged [activeandroid]

ActiveAndroid is an active record style ORM (object relational mapper) for Android.

ActiveAndroid allows you to save and retrieve SQLite database records without writing SQL statements. Each database record is wrapped into an object with methods like save() and delete().

The library is open sourced under the Apache 2.0 License.

Tutorials:

slidenerd Series

231 questions
0
votes
1 answer

ActiveAndroid column naming convention for a multi-word column name

I am using ActiveAndroid to build the SQLite database for my Todo Android app. I need to name a column "due_date" but am not sure how to name it in the annotation. Here is a snippet of my Item model: @Table(name = "Items") public class Item extends…
Marina
  • 3,222
  • 5
  • 25
  • 35
0
votes
0 answers

ActiveAndroid unresolved symbol Cache

I'm working on implementing the use of SQLite into my android application. I am using ActiveAndroid. I believe it's installed correctly: I can import com.activeandroid.Model successfully, as well as the annotations import…
Marina
  • 3,222
  • 5
  • 25
  • 35
0
votes
1 answer

Where clause with a DATE variable using ActiveAndroid

I'm new at Android dev, so I'm using ActiveAndroid to manage the DB and I'm having troubles using a query with a Date variable, I have this: From fromQuery = new Select().from(Shift.class); //It doesn't matter what currentShiftDates…
Fantini
  • 2,067
  • 21
  • 32
0
votes
2 answers

ActiveAndroid not saving table

I am using the library ActiveAndroid to use the database, but when I try to save an object, it says that there is no such table. I've tried updating the database version and uninstalling my application, but still no luck. Any help will be…
0
votes
1 answer

How to initialize database with certain values activeandroid

I'm using ActiveAndroid as an ORM. I want to initialize my database tables with certain values.Only one time,I dont want the content to be duplicated. or is there a solution to execute a sql script at installation time. I searched in the…
TheGreenGoblen
  • 108
  • 1
  • 11
0
votes
1 answer

In ActiveAndroid, how do I order by primary key?

I read that activeandroid generates ids for every record inserted. I want to retrieve records from latest created to earliest created. I know to use orderBy(COL_NAME, DESC), where COL_NAME is the primary key column, but what is that column…
HukeLau_DABA
  • 2,384
  • 6
  • 33
  • 51
0
votes
1 answer

Robotium and ActiveAndroid

Disclaimer: this is my first ever Android test project with Robotium. I'm facing a catch-22 situation with ActiveAndroid and Robotium. Here's my setup: I want to test an activity that expects a long array extra. This array contains DB ids of…
jlhonora
  • 10,179
  • 10
  • 46
  • 70
0
votes
1 answer

Column.ForeignKeyAction.SET_NULL doesn't work in ActiveAndroid

I have a problem with foreign key action in Active Android. Please look at this code: @Table(name = "Dealers", id = BaseColumns._ID) public class Dealer extends Model implements Serializable { @Column public String name; } @Table(name =…
Tomasz
  • 1,406
  • 1
  • 18
  • 28
0
votes
1 answer

Auto increment in active android

I tried to use active android, i have a doubt about how could i achieve a auto-increment field in a table? In their documentation they have provided a code like this Item item = new Item(); item.remoteId = 1; item.category =…
George Thomas
  • 4,566
  • 5
  • 30
  • 65
0
votes
1 answer

ActiveAndroid NPE from execute

I am following https://github.com/pardom/ActiveAndroid/wiki/Querying-the-database to incorporate activeandroid in my application like so: @Table(name="Contact") public class Contact extends Model implements Serializable, Comparable { public…
HukeLau_DABA
  • 2,384
  • 6
  • 33
  • 51
0
votes
1 answer

Error with library ActiveAndroid the attribut id in my model

I have a problem when I use the library 'ActiveAndroid' including the model and to be more precise with the getId method. Each time, I get the error: Error: (22, 17) error: getId () in Member can not override getId () in Model overridden method is…
Nicolas
  • 5,249
  • 3
  • 19
  • 20
0
votes
0 answers

Defining an ActiveAndroid model without creating a table

I have my app's networking code separated into a separate package. This package contains a POJO model that I'm serializing with Gson (using its @Expose annotation): public class User { @Expose String username; @Expose String…
George Hilliard
  • 15,402
  • 9
  • 58
  • 96
0
votes
1 answer

Can I use activerecord mId to select item

I want to send an activeandroid object in intent, but I find it is not serializable. I think I can send mId (what getId() returns) in intent and select record in the new activity. However, how can I select item using mId? P.S this database does not…
vincentzhou
  • 710
  • 6
  • 18
0
votes
1 answer

ActiveAndroid: Subqueries?

I'm using ActiveAndroid in an app for database interaction. I need to join a few tables and then filter the results, which I would usually accomplish using a SQL query with a sub-query. How might one accomplish a sub-query using ActiveAndroid? If a…
SuperDeclarative
  • 1,609
  • 4
  • 18
  • 32
0
votes
1 answer

How to get data from ActiveAndroid to support ListView virtualization

As far as I know, Android listview shows the data virtualized (meaning it loads only the visible ones), so it is fast as it can be. I have lots of data to get from the database (around 2000 but with lots of data in the fields), and I use…
Nestor
  • 8,194
  • 7
  • 77
  • 156