Questions tagged [realm-java]
99 questions
1
vote
0 answers
Building realm from Source and using AAR in Android project
I have built the Realm-Java from the source and generated below files as per the Offlicial-doc
a jar file for the Realm Gradle plugin
an aar file for the Realm library
a jar file for the annotations
a jar file for the annotations processor
Now…

Adi
- 425
- 4
- 14
1
vote
0 answers
how can get deletion or insertion notify realm inner list?
i have ticket class and message class like below.
i want set change listener just for inner message list in special ticket id no whole table message.
i read about result and object changeListener and Notifications but i can't find any solution ;…

amin mahmoudi
- 630
- 7
- 26
1
vote
1 answer
Java Realm Out of Range Exception
Fatal Exception: java.lang.ArrayIndexOutOfBoundsException
Out of range in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsResults.cpp line 108(requested: 0 valid: 0)…

zngb
- 601
- 1
- 7
- 24
1
vote
1 answer
Realm delete all except one table
This is Realm Java so I'm doing
realm.beginTransaction();
realm.deleteAll();
realm.commitTransaction();
I have 20 or so Realm classes. I only want to keep one.
Instead of doing
realm.beginTransaction();
realm.delete(Table1.class);
…

zngb
- 601
- 1
- 7
- 24
1
vote
1 answer
Java Realm Results sorting in Java 7?
public class Leaderboard extends RealmObject {
String score;
}
RealmResults leaderboardList = realm.where(Leaderboard.class).distinct("score").findAll();
The results are Strings which are actually just large numbers stored as…

zngb
- 601
- 1
- 7
- 24
1
vote
1 answer
realm java force creating of new realm instance
If you create new RealmConfiguration and then call Realm.getInstance(configuration)
it will use the internal cache. If i delete the realm file, then create new instance of configuration calling of Realm.getInstance(configuration) won't create new…

luky
- 2,263
- 3
- 22
- 40
1
vote
1 answer
Realm, complex linked query
in the official docs, https://realm.io/docs/java/latest/#link-queries - there's an example how to select owners of "Brown Fluffy" dogs.
My questions is, how do I select only those not having Brown Fluffy (and, obviously, those having no dogs at…

saabeilin
- 610
- 7
- 15
1
vote
0 answers
MapStruct - mapping RealmList relationship
Okay, I'm not very sure how to ask this but I'm going to try.
I am using MapStruct to map my incoming network objects to database objects. I use Realm.io as my local datastore. Some of my objects have RealmList which store their relationships,…

barnacle.m
- 2,070
- 3
- 38
- 82
1
vote
0 answers
How to connect to Realm Amazon EC2 instance in Android?
I created a EC2 instance based on Realm public AMI: ami-9f1522e4. It seems to be working fine.
I am trying to connect to it in Android with the following code
String authUrl= "realm://54.173.116.160:9080/auth"; // 54.173.116.160 is my instance…

georges49
- 11
- 1
1
vote
1 answer
How to use two different realm configurations
I'm working with the default realm instance, which contains some schemas. Now, I want to create a new schema in a different realm instance. So I have created a new Realm configuration, and when I query or store entities for this new schema, I use…

Victor Manuel Pineda Murcia
- 650
- 8
- 20
1
vote
1 answer
Realm in Fragment causing NullPointerException
I'm confused as to how to handle Realm in fragments when the fragment's activity extends a base activity that controls Realm.
In other words, I have this structure:
Base Activity -> User Activity -> Base Fragment -> Fragment
Everything works fine,…

user656217
- 21
- 2
1
vote
0 answers
Realm not update existing data in ONE-MANY Relationship Android
I have been using realm about more than a years, in many cases realm is good choice to construct Android database instead using SQLite. I have been using realm for one-one, one-many relationship and good for it. But, a moment a good. I discover…

raditya gumay
- 2,951
- 3
- 17
- 24
1
vote
2 answers
Android realm sorting list of objects
How I can sort list of RealmObjects by two parametrs? For example first param is name (Need to sort it alphabetically), second parameter is a bit complicated and related to 3 dates: I have a range dates (for example fromDate currentDate and toDate).…

Alexander
- 13
- 4
1
vote
1 answer
How to handle Realm transactions on Android
In several pieces of sample code out there, I've seen patterns that look like this:
try (Realm realm = Realm.getDefaultInstance()) {
realm.beginTransaction();
workWithRealmData();
realm.commitTransaction();
}
The question is - is this safe?…

tmtrademark
- 944
- 6
- 21
1
vote
0 answers
What is the order of elements obtained from Realm query?
When executing findAll() or findAllAsync() query in Realm, without explicit sorting, such as:
RealmResults results = realm.where(MyRealmObject.class).findAll();
what is the order of elements accessible through the RealmResults…

maciekjanusz
- 4,702
- 25
- 36