I want to synchronize the android application with server. In Server i have maintained last update date through trigger as it uses SQL server but my android application uses Realm so how can i set current date time in a field whenever any row is inserted or updated. Any suggestion would be highly appreciated.
use this
realm.beginTransaction();
RealmResults<ModelClass> hallos = realm.where(ModelClass.class).equalTo('name', 'hello').findAll();
for (ModelClass object : hallos) {
object.setTimeStamp(timestamp);
}
realm.commitTransaction();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With