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

Trying create a chat with Fragment?
NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
Attribute is missing the namespace prefix
Content quickly disappears
Data is not changed after editing sqlitedatabase in android
How to connect asmack (xmpp client library) with openfire (xmpp server)?
Intent Service with network state change
How to make child views automatically take a new line to fit the parent width?
Show/Hide top bar like chrome, but with some static content and a listview
Delete number from contacts
Android draw image with width 1029 * height 1029 pixel
Do I need a data connection in order to get TELEPHONY_SERVICE?
How to convert PDF to HTML on android?
cordova Android Jquery geolocation issue
Android Tests - Determine if WebView is Zoomed - Pinch Zoom
Import Facebook SDK Android Studio 0.8.14

Categories

HOME
go
android-studio-2.2
hessian
javacc
carousel
vxml
big-o
nested-if
title
bing-maps
sendgrid-api-v3
openbugs
nancy
nodemcu
lilypond
ksh
pagespeed
object-storage
opentk
corpus
delimiter
android-maps
firebase-analytics
quantlib
browser-sync
sqsh
custom-controls
eviews
scatter3d
r-grid
linkedhashmap
login-script
fossil
jwplayer6
timing
filesystemwatcher
odroid
kill
odoo-website
glm-math
smoothstate.js
libgphoto2
user-defined-fields
netbeans6.8
datamaps
trojan
stdmap
d3-force-directed
cpu-cache
cronexpression
cudd
autosar
builtins
neon
mongodb-php
nss
ellucian-scribe
nupic
halcon
relativelayout
toran-proxy
gocql
morton-number
include-guards
intel-c++
video-player
fuelcms
uncompress
linked-tables
entity-framework-4.3
jquery-forms-plugin
shopizer
xmltype
procedural-programming
adehabitathr
browserify-shim
genymotion-call
raygun
unix-socket
reflector
ios8-extension
paste
fpdi
bin
light
embedded-fonts
abstract-data-type
insert-id
boost-msm
lambdaj
azman
hibernateexception
entity-attribute-value
lr
twitterizer
svk
undefined-index
instantiationexception
hbm2java
skype4java
glui
flvplayback
commercial-application

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