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
7
votes
3 answers

ActiveAndroid Many-to-many relationship

I’m currently using ActiveAndroid, and have been trying to get a many-to-many relationship to work for the past few hours, however I just can’t get it to work. I hope you can help me out: I have the models “Student” and “Course”, a student can have…
Waclock
  • 1,686
  • 19
  • 37
7
votes
2 answers

How to disable scanning for model in Activeandroid

I would like to define my model classes in AndroidManifest.xml file using AA_MODEL tag and disable auto search. Because currently I get errors when application starts similar to: Couldn't create class. java.lang.ClassNotFoundException:…
Tomasz
  • 1,406
  • 1
  • 18
  • 28
7
votes
2 answers

How to update table with activeandroid after adding a new column

thank you for reading and helping :) I am using ActiveAndroid 3.0 - Android 2.2 - In my app I have a model called "user". initially I only created the model with (id, name, passcode) columns/attributes, I ran the app on the emulator, and it worked.…
dagger
  • 515
  • 2
  • 6
  • 17
6
votes
1 answer

SQLite suddenly considers everything as not an error

It started on an Android phone, simple create statement in a file inside the assets/migrations folder (I use a 3rd party library called ActiveAndroid and for 2 years it worked okay - I did not changed anything about that): CREATE TABLE IF NOT EXISTS…
Nestor
  • 8,194
  • 7
  • 77
  • 156
6
votes
3 answers

ActiveAndroid where with a "in" clause

I would like to know if it is possible and how I could do a where clause in ActiveAndroid with a "IN" clause. For example, I would like do do something like this: new Select().from(Table).where("id in ?", list).execute()
Bruno da Hora
  • 61
  • 1
  • 3
6
votes
1 answer

Testing ActiveAndroid with Robolectric

What can I do to get some test coverage on ActiveAndroid's ContentProvider in Robolectric? This simple test fails. The model: @Table(name = "Things") public class Thing extends Model { public Thing() { super(); } } The…
Fred Medlin
  • 830
  • 10
  • 18
5
votes
4 answers

Attempt to invoke virtual method 'java.lang.String com.activeandroid.TableInfo.getIdName()' on a null object reference

i am getting this Error java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.activeandroid.TableInfo.getIdName()' on a null object reference when i disable Instant Run i did not get any error my project works…
Muazzam A.
  • 647
  • 5
  • 17
5
votes
0 answers

ActiveAndroid: How to have different activeandroid meta-data in an android lib as well as android app

So, I have a Android library which is supposed to be used by multiple apps. The issue is the library uses Active android to store data and the manifest already has AA_DB_NAME, AA_DB_VERSION, AA_MODELS etc. defined.
Abhishek Sinha
  • 435
  • 4
  • 12
5
votes
3 answers

Active Android is it prone to SQL injections. Any known solution?

Android application is already developed using ActiveAndroid public static List search(String pattern) { return new Select().from(ModelNames.class) .where("title LIKE '%" + pattern + "%' or content LIKE '%" + pattern +…
Amol M Kulkarni
  • 21,143
  • 34
  • 120
  • 164
5
votes
1 answer

ActiveAndroid: Date columns not created

I am trying to store a Person object with ActiveAndroid. I set the birthdate like this: person.setBirthdate(new java.sql.Date((new Date()).getTime()));. After assigning all data i am calling person.save();. I get a list of all persons from the…
Liz_17
  • 51
  • 4
5
votes
0 answers

Joins with ActiveAndroid - how to get second table's data

I'm using ActiveAndroid and running a query with an outer join: List models = new Select() .from(NavigationState.class) .leftJoin(BundleItem.class) .on("aColumnName =…
nasch
  • 5,330
  • 6
  • 31
  • 52
5
votes
1 answer

Could not resolve active android dependency in Gradle when Active Android is included in library

I have a library project that includes active android using Gradle. To get it to work I have to add compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT' and add the repository for it like so: repositories { maven { url…
MungoRae
  • 1,912
  • 1
  • 16
  • 25
5
votes
2 answers

Gson serialization error class com.activeandroid.DatabaseHelper declares multiple JSON fields named mContext

The error im getting is "java.lang.IllegalArgumentException: class com.activeandroid.DatabaseHelper declares multiple JSON fields named mContext" I am using AndroidAnnotations RestClient to pull data from my Web Service and serialize into POJOs. The…
Darussian
  • 1,573
  • 1
  • 16
  • 28
4
votes
0 answers

Room vs Active Android

Recently google announced Room library to facilitate android local database storage implementation. Since I already used Active Android in my previous project, couldn't understand the advantages of Room over Active android. In fact implementation…
Niranjan
  • 1,879
  • 2
  • 22
  • 28
4
votes
1 answer

SQLite Order by WHERE IN clause

I'm using SQLite and I'm providing a list of id values to retrieve. However, the order of those id values is important and I want to retrieve the records in the same order. For example, SELECT * FROM todos WHERE todos.id in ( 1, 3, 2, 4 )…
Joshua Pinter
  • 45,245
  • 23
  • 243
  • 245
1
2
3
15 16