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

Android DB: Merging Two Databases Using SQL Dumps
Questio about AdMob ad url to application
trouble importing android-remote-stacktrace
ADT rev20 - apps don't install on any AVD
View will get twice at onItemClick
downloading xml from ftp in android
Notification upon ended parsing of web response
How to transfer “data” between two device (android,iphone)?
write spinner selected value to database
Using AsyncTask to download an XML file
Screen resolution / Physical size
android - showDialog(); error
linux joining multicast group setsockopt returns errno 19 device not found
Foreign keys in android 2.2 and higher
HttpURLConnection, HttpClient and HttpPost request not working with POST request in Android
Android custom row layout in ListView with flexible height

Categories

HOME
notepad++
jmeter
datastore
youtube-data-api-v3
components
owl-carousel
google-cloud-functions
static-site
nsbundle
soa
aws-cli
rds
square
jquery-ui
webix
pkcs#11
joomla3.0
fhir
resultset
emoji
line
libusb
dynamic-sql
template-engine
shortest-path
cfml
boost-icl
google-maps-autocomplete
breadth-first-search
articulate-storyline
undertow
libigl
gmock
windows-server-2003
xcode-ui-testing
genexus-sd
user-defined-functions
browser-sync
tizen-tv
jaws
carrierwave
gitlab-api
livelink
scatter3d
angularjs-material
installshield-le
keras-layer
dynamic-jasper
fossil
getlasterror
watchman
chronicle-map
double-click
nanoc
term
gitlist
user-defined-fields
launchctl
twilio-click-to-call
arq
reindex
janus
cronexpression
cudd
model-associations
expectations
gogs
tracker-enabled-dbcontext
uiactionsheet
user-management
concept-insights
maybe
flock
poppler
phonertc
rpart
dronekit-android
airbrake
avahi
java-security
showdialog
rickshaw
insight.database
cancellation
renderer
extjs2
koala
android-audiorecord
kogrid
octal
diem
cuda-gdb
lambdaj
wiimote
jquery-address
filemerge
qglwidget
ie-compatibility-mode

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