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
2
votes
0 answers

How to create a model with a compound key in ActiveAndroid

Does anyone know if Compound keys are supported in ActiveAndroid (http://www.activeandroid.com/). and if so how to implement them? I have searched and gone through the documentation but I don;t seem to find anything on this matter.
velval
  • 3,072
  • 36
  • 45
2
votes
1 answer

I can not save the associated models (ActiveAndroid)

I use the library ActiveAndroid with RetroFit. if I have a simple model, it all works well. but if the model contains a different model, I do not know how all this is stored in the database My model: @Table(name="User7s") public class User extends…
2
votes
3 answers

ActiveAndroid - how to get last row id?

I need to get last inserted row's id in ActiveAndroid database table and I can't find any information about that in documentation. Is there proper method to do this?
elhm
  • 145
  • 1
  • 10
2
votes
2 answers

ActiveAndroid Pre populate table using schema migration

I want to create a table for the first time (DB version = 1), and insert into it 2 rows by default. The table needs to be created automatically by ActiveAndroid, and the records should be inserted by the SQL I wrote in 1.sql file. The table looks…
Idob
  • 1,620
  • 4
  • 16
  • 27
2
votes
3 answers

what should i store colors as in sqlite?

I am storing things in a sqlite database. One of its attributes is a color. When I display this, I want to do objLinearLayout.setBackgroundColor(some_int) Normally I'd use R.color.red in place of some_int. However, I am persisting the color, and…
HukeLau_DABA
  • 2,384
  • 6
  • 33
  • 51
2
votes
0 answers

How do you add a SQLITE TRIGGER in ActiveAndroid

I've only managed to do this using SQLiteUtils.execSql(), what I'd like to know is how I can put the commands inside the assets/migrations/.*.sql files. In theory it should be possible but I keep getting syntax errors.
user1923613
  • 626
  • 5
  • 11
  • 31
2
votes
1 answer

ActiveAndroid database location change dynamically

I am developing an Android App and thought of using an ORM to leverage some of the database work, i've seen a few and they all seem good for the job, now I only have one main issue left, i haven't found a way of setting the database location on…
maxandonuts
  • 595
  • 7
  • 19
2
votes
1 answer

Storing HashMap with using ActiveAndroid library

I have a class: @Table(name = "Control") public class Control extends Model{ @Column private String name; [...] @Column private Map properties; } I have other fields in this class, but i wrote here only those…
Peter Szucs
  • 1,116
  • 9
  • 18
2
votes
1 answer

ActiveAndroid lib and foreign keys

I'm using active android to work with SQLite on Android. For example, I have the following Pets table with this structure: @Table(name = "Pets") public class Pet extends Model { @Column(name = "Name") public String name; @Column(name =…
StupidFox
  • 376
  • 3
  • 19
2
votes
1 answer

ActiveAndroid set instance id

Is it possible to set ID of certain record? I'm importing multi table database into my application database, that is mapped to ActiveAndroid model. I get it over http in json. It would save a lot of work to preserver those server-side ids on records…
Lubos Horacek
  • 1,562
  • 10
  • 28
2
votes
2 answers

Maven complaints about Joda-Time even though I installed it

Because I want to use ActiveAndroid and ActiveAndroid-Validation I need to use Maven (which I never heard of until yesterday). So I installed maven and then tried to install ActiveAndroid. I wrote a custom serializer in ActiveAndroid using JodaTime…
kramer65
  • 50,427
  • 120
  • 308
  • 488
2
votes
1 answer

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 @Table(name = "Books") public class Book extends Model implements…
Josue Montano
  • 521
  • 4
  • 16
2
votes
3 answers

ActiveAndroid - no fields are created

I just tried to use ActiveAndroid. Following their tutorial from here, I set everything. I added the manifest entry: application android:name="com.activeandroid.app.Application" ... meta-data android:name="AA_DB_NAME"…
Nestor
  • 8,194
  • 7
  • 77
  • 156
2
votes
3 answers

How do I install ActiveAndroid for use with Eclipse?

I'm learning Android and Java at the same time, so sometimes I get hung up on the Java side of things. I'm trying to use the ORM library ActiveAndroid, but the archive I downloaded doesn't contain a .jar file, just a libs folder and a src folder. …
talloaktrees
  • 3,508
  • 6
  • 28
  • 43
1
vote
1 answer

Android : Jackson with ActiveAndroid

ActiveAndroid has a constraint that all its entities need to inherit from a certain base class and need to have a one parameter constructor taking in the Context (from the activity) as the input. [Not a fan to this constraint]. With gson, I can…
CF_Maintainer
  • 973
  • 2
  • 12
  • 30