android


How to upgrade my realm db in android [duplicate]


This question already has an answer here:
Upgrade realm in an Android project
1 answer
In my android project, we are using Realm db version 0.87.4. Currently Realm in version 2.3.1 for android.
Our android application already released in Playstore and many user using it. How to upgrade my realm db version without losing any data and functionalities.
I thought some Realm methods may be deprecated or removed from latest Realm Db
Currently Realm db is in version 3.1.4 for Android. In order to migrate your database to the latest version,you have to change the RealmConfiguration code as follows
RealmConfiguration config = new RealmConfiguration.Builder()
.schemaVersion(1)
.migration(new MyMigration()) // Migration to run instead of throwing an exception
.build()
Assuming your schema is not changing, you also have to create the MyMigration class as follows,
public class MyMigration implements RealmMigration {
#Override
public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
}
}
You may refer to Realm Docs for more info

Related Links

Make Android share screen as a camera instead of native cam for instagram live
Android JobQueue get job status
Parse nested json using Realm?
favourite and unfavourite image in recyclerview gets in intial state when scrolled how to resolve it?
PendingIntent is cancelled after cleaning the app from recent app list
Where is location of user input data at intercepted request in Xamarin Webview?
App crash when calling BitmapDrawable.draw(Canvas canvas)
Exoplayer and ProgressBar
Android: post data from custom thread to different (fragment) layouts in tabbed activity
App timeout when not touch screen after x time
Android - How to use images instead of RadioButtons in AlertDialog
How do I create a new activity when clicking on an item in my list view, without depending on my current activity in my controller?
how to detect whether the android phone is dropping to the ground?
Android v14 SwitchPreference not changing values
How to generate code coverage tests for unit tests when you have product flavors on Android
How to get a callback when a ListView finishes rendering after being attached an ArrayAdapter?

Categories

HOME
phpword
spark-streaming
jmeter
redux-form
static
rendering
bitbucket-api
nsbundle
mips
maxscript
mvc5
startup
activecollab
flatpak
internationalization
entitymanager
alpacajs
atlassian-stash
replication
blade
ios10.2
inno-download-plugin
jquery-callback
onload
gpio
delimiter
mat
wcag
sinch
vex
deltaspike
kodi
activexobject
vue-chartjs
sim-toolkit
watchman
tasm
sharp-snmp
placeholder
knime
opencmis
jide
clarifai
dtsearch
twilio-click-to-call
lightning
google-cse
scalding
arules
trigger.io
rxtx
branch-prediction
javafx-css
restore
cvxpy
grails-plugin
beamer
i386
riot
upx
realsense
assertion
rpart
dronekit-android
branch-and-bound
ansi
broadband
rapidsvn
android-cookiemanager
mdichild
authlogic
extjs2
xmltodict
breakout
sqlclr
qi4j
veracity
dajaxice
objectquery
flex-mobile
user-tracking
winmain
uipagecontrol
strsep
xui
inline-formset
socketserver
cfwindow
lxr
glui
dsl-tools
lobo-cobra
int64
xslcompiledtransform

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App