realm

C# - how to delete row in realm - android xamarin

让人想犯罪 __ 提交于 2019-12-12 04:22:53
问题 i tried this method that I created but it prompts me an error: Realms.RealmInvalidObjectException:This object is detached. Was it deleted from the realm?' public void deleteFromDatabase(List<CashDenomination> denom_list) { using (var transaction = Realm.GetInstance(config).BeginWrite()) { Realm.GetInstance(config).Remove(denom_list[0]); transaction.Commit(); } } what is the proper coding for deleting records from database in realm in C# type of coding? 回答1: You are doing it the right way. The

Realm.io per-object permissions, compared to Firebase

梦想的初衷 提交于 2019-12-12 04:21:44
问题 I'm considering switching from Firebase DB to Realm.io. For my app, I need sharing items between users (in a many-to-many fashion). In Firebase there is a permissions language (and the Bolt compiler). What is the equivalent model in Realm.io? Can I share objects between users, with controlled permissions? EDIT: I'm talking about fine-grained per-object sharing, not coarse-grained per-database sharing. 回答1: In the current release, permissions are defined per Realm (collection of objects), not

Realm transaction using from different thread

三世轮回 提交于 2019-12-12 04:09:11
问题 I have writeToRealm method that I use very often. And I need to use it from different threads and cut boilerplate code. What is the better way for this task? private boolean writeToRealm(String user, String id) { SubscriberObject subscriber = new SubscriberObject(); if(mRealm.where(SubscriberObject.class) .equalTo(SubscriberObject.ID,id).findAll().isEmpty() &&mRealm.where(SubscriberObject.class) .equalTo(SubscriberObject.USERNAME,user).findAll().isEmpty()) { subscriber.setId(id); subscriber

How to check what class belongs AnyObject?

倾然丶 夕夏残阳落幕 提交于 2019-12-12 04:07:00
问题 For example, there are two models Realm Information import Foundation import RealmSwift class Music: Object { dynamic var id = "" dynamic var title = "" dynamic var url = "" } class DownloadMusic: Object { dynamic var id = "" dynamic var title = "" dynamic var path = "" } And there is a certain function func test(object: AnyObject) { } When a call is transferred as an argument 'realm.objects(Music)[0]' let realm = try! Realm() test(realm.objects(Music)[0]) Can I check in function, the object

User made from Realm object has same Primary Key Realm

送分小仙女□ 提交于 2019-12-12 03:46:23
问题 Im trying to use a real model to make a user profile, here is the model below: class UserProfile: Object { dynamic var id = UUID().uuidString dynamic var name:String = "" dynamic var age = "" dynamic var email = "" dynamic var userName = "" dynamic var passWord = "" override static func primaryKey() -> String? { return "id" } } I'm adding objects to the default realm file via an IBAction button as shown here: @IBAction func signUpButton(_ sender: UIButton) { try! realm.write { user.userName =

How do Realm add existing user data to the mobile platform?

此生再无相见时 提交于 2019-12-12 03:42:27
问题 I am currently using Realm as an offline database in the iOS app. if I were to add support for Realm mobile platform, will it automatically grab all the Realm user data and migrate it to the cloud? Or is there some code that is needed to move the data to the cloud? 回答1: Realm Mobile Platform is not a cloud service but consists of Realm Object Server, a server application you can run on your own (supports various flavors of Linux) and Realm Mobile Database. If you are already using Realm

Data is not updated promptly after adding the information using Realm in Android

时光怂恿深爱的人放手 提交于 2019-12-12 03:35:34
问题 I have implement Realm database in my App. At first I want to show some prelod data. Till now I have only three data here. I have implement a dialog fragment which I used to add data in Realm database. I have read the official documentation of Realm. But the implementation of Adapter class is so complecated for me. Hence I have used RecyclerView.Adapter in my Adpater class. Now the problem I am facing that After adding the information the data is not showing promptly.The data is not upadted

Gradle - Failed to resolve

怎甘沉沦 提交于 2019-12-12 03:24:05
问题 I know there are multiple threads on this already but not a single fix worked so I figured I must have a unique issue or be making a stupid error that someone smart can point out. I am trying to use the Realm Recyclerview (found here : https://github.com/thorbenprimke/realm-recyclerview) However I cannot get the gradle sync to go beyond error 29,13 Failed to resolve com.github.thorbenprimke:realmr-ecyclerview:0.9.12 My app build.gradle file looks like this : apply plugin: 'com.android

Setting a RealmObject to another RealmObject after retrieving it from Realm

人走茶凉 提交于 2019-12-12 03:19:08
问题 I am having an issue with Realm which is causing it to crash with a NullPointerException everytime I try and set a RealmObject to another after it's been stored. Eg. Person person = new Person(); person.setName("Martha"); Realm realm = Realm.getInstance(this); realm.beginTransaction(); realm.copyToRealm(person); realm.commitTransaction(); Person personFromRealm = realm.where(Person.class).findFirst(); realm.beginTransaction(); Pet pet = new Pet(); pet.setType("dog"); personFromRealm.setPet

Android Realm Abstract Class Instantiate

妖精的绣舞 提交于 2019-12-12 03:11:31
问题 I am trying to setup an AuotoCompleteTextview (in my MainActivity) where data is fetched from Realm database. So I'm using an adapter as following: public abstract class FilterableRealmBaseAdapter<T extends RealmObject> extends ArrayAdapter<T> implements Filterable { private final RealmResults<T> mRealmObjectList; private List<T> mResults; public FilterableRealmBaseAdapter(Context context, @LayoutRes int layout, RealmResults<T> realmObjectList) { super(context, layout); mRealmObjectList =