realm-database

How to apply multiple filters to realm database results

青春壹個敷衍的年華 提交于 2020-07-10 07:47:50
问题 I am new to programming & trying to apply filters using UISwitches Currently I have: A realm database returning all the objects A UI that uses Switches to send filters Things Attempted: Subqueries, however I don't know the proper format to write it for realm Goal: Apply multiple filters to realm database results User Interface: Realm Database: class Question: Object { @objc dynamic var neverAttempted: Bool = true @objc dynamic var correct: Int = 0 @objc dynamic var flagged: Bool = false @objc

How to apply multiple filters to realm database results

杀马特。学长 韩版系。学妹 提交于 2020-07-10 07:47:04
问题 I am new to programming & trying to apply filters using UISwitches Currently I have: A realm database returning all the objects A UI that uses Switches to send filters Things Attempted: Subqueries, however I don't know the proper format to write it for realm Goal: Apply multiple filters to realm database results User Interface: Realm Database: class Question: Object { @objc dynamic var neverAttempted: Bool = true @objc dynamic var correct: Int = 0 @objc dynamic var flagged: Bool = false @objc

How to backup Realm DB in Android before deleting the Realm file. Is there any way to restore the backup file?

匆匆过客 提交于 2019-12-18 04:12:44
问题 I am working on an Android application where I will be deleting Realm before copying the new data to Realm. Is there any way I can take backup of the data before deleting it and restore it back if something is wrong when using realm.copyToRealm() ? 回答1: Realm.writeCopyTo might be helpful for this case. You can find doc here. //Backup Realm orgRealm = Realm.getInstance(orgConfig); orgRealm.writeCopyTo(pathToBackup); orgRealm.close(); //Restore Realm.deleteRealm(orgConfig); Realm backupRealm =

Saved ImageView not appearing after saving it as byte[]

a 夏天 提交于 2019-12-13 04:05:38
问题 I am planning to save this ImageView : to my RealmDatabase, but the image is not appearing when I want to retrieve it. it should appear here: here is the my onSaveExpense code public void onSaveExpense() { //TODO - BITMAP EXPENSE ICONS if (mCategoriesSpinnerAdapter.getCount() > 0 ) { if (!Util.isEmptyField(etTotal)) { Category currentCategory = (Category) spCategory.getSelectedItem(); String total = etTotal.getText().toString(); String description = etDescription.getText().toString(); Bitmap

How to backup Realm DB in Android before deleting the Realm file. Is there any way to restore the backup file?

≡放荡痞女 提交于 2019-11-29 04:17:17
I am working on an Android application where I will be deleting Realm before copying the new data to Realm. Is there any way I can take backup of the data before deleting it and restore it back if something is wrong when using realm.copyToRealm() ? Realm.writeCopyTo might be helpful for this case. You can find doc here. //Backup Realm orgRealm = Realm.getInstance(orgConfig); orgRealm.writeCopyTo(pathToBackup); orgRealm.close(); //Restore Realm.deleteRealm(orgConfig); Realm backupRealm = Realm.getInstance(backupConfig); backupRealm.writeCopyTo(pathToRestore); backupRealm.close(); orgRealm =