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

Firebase onMessageReceived not called when app in background
Errors with Custom ListView in Fragment [duplicate]
Check if Google Nearby is already allowed
Ionic - Android - Make Apache's cordova-plugin-camera store images in application's private dir
Polyline.remove on CameraPositionChange for Android
FirebaseApp initialization unsuccessful
Retrofit null response in a success request 200
Android UMTS tuner
non static method cannot be referenced from a static context android
Android iOS webview accessibilitiy
Customize the android native datepicker popup
Android WebView removes everything after a # in the URL after a redirect
Use a vector resource as application icon in android
Error to import Mudole to android studio 'com.github.lzyzsd:circleprogress:1.1.0#aar'
Get data from realm database?
Multiple API calls to create object

Categories

HOME
phantom-dsl
spark-streaming
rsa
interface
pascal
graphics
spring-data-redis
shiro
pclxl
appcelerator
character
qpython
augeas
mod-security
code-generation
frequency-distribution
esoteric-languages
intershop
undertow
ksh
google-api-client
windows-server-2003
xcode-ui-testing
custom-post-type
motion-detection
pylons
soot
google-earth
userdefaults
panoramas
mockjax
testbed
sammy.js
salesforce-communities
openalpr
amazon-ses
filesystemwatcher
bc
numberpicker
tasm
apollostack
android-exoplayer
oim
nanoc
rserve
bluez
mouseleave
template-toolkit
objectscript
cd-burning
vibrate
cronexpression
centrifuge
iotivity
appscale
nss
tracker-enabled-dbcontext
php-socket
piracy-prevention
phpgrid
jdk1.7
dot.js
broadband
bcache
openbabel
mass-assignment
webmatrix-3
browserify-shim
ssis-data-flow
crowd
angular-carousel
parallel-testing
malformedurlexception
wxformbuilder
extjs2
isqlquery
onmousemove
qtconcurrent
boost-msm
xcode3.2
ilasm
wiimote
update-statement
mysql-error-1205
google-floodlight
listactivity
tournament
timertask
object-database
qtabbar
cardspace

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App