Live data from Hacker News

Show HN: Realm for Android

realm.io

51–60 of 66 posts

Re: Show HN: Realm for Android

#51
post #47
post #23

Earlier quoted context omitted.

Eek so I actually have to make/use a setter for every single attribute of my models? That's definitely a deal breaker for me.

try using http://projectlombok.org/

That's neat. I'll have to keep that in mind for the future.

I wish Java would take a hint from C# properties through :(

Re: Show HN: Realm for Android

#52
post #46

I've always wondered how folks handle the Parcelable[1] interface with libraries like this. If you have a realm object that you want to have in memory between activity destroy/create how do you handle this? For instance if I rotate the screen the activity is destroyed and recreated for the new orientation. As I understand it the Parcelable interface and Bundle[2] is the way to handle this but how can you do this if y…

I use Parceler ( https://github.com/johncarl81/parceler ) with gson. So gson for network data, then parceler for passing parcels around between activities/fragments.

Doesn't this require annotating the class? What if I can't change the class implementation?

Re: Show HN: Realm for Android

#53
post #50

Is realm planning to make a c++ interface version, seeing how it's made in C++? A lot of cross platform cores use C++ since it Works Everywhere(tm) as an FFI to other languages & platforms.

Absolutely! That's actually already there. Even with nice expression based query syntax - looks like natural language :-) We havn't released it though since we plan to rewamp it into a more object oriented interface like in ObjC, Swift and Java. But if you really wanted to, nothing prevents you from using it (the .h files are there), except there is little documentation and the API will likely change. But yes, definitely it will come fully supported.

The nice thing is you can then make have e.g. common C++ code shared between your mobile app platforms (as quite a few do), and share state/data easily between C++ & Java or C++ & ObjC/Swift in one app. No fuss, one API, one shared datamodel, fully threadsafe between languages.

Would that be useful?

Re: Show HN: Realm for Android

#54
post #46

I've always wondered how folks handle the Parcelable[1] interface with libraries like this. If you have a realm object that you want to have in memory between activity destroy/create how do you handle this? For instance if I rotate the screen the activity is destroyed and recreated for the new orientation. As I understand it the Parcelable interface and Bundle[2] is the way to handle this but how can you do this if y…

You can always just put the model id (or some other way to requery) in the Bundle and look it up again after the configuration change.

Re: Show HN: Realm for Android

#55
post #53
post #50

Is realm planning to make a c++ interface version, seeing how it's made in C++? A lot of cross platform cores use C++ since it Works Everywhere(tm) as an FFI to other languages & platforms.

Absolutely! That's actually already there. Even with nice expression based query syntax - looks like natural language :-) We havn't released it though since we plan to rewamp it into a more object oriented interface like in ObjC, Swift and Java. But if you really wanted to, nothing prevents you from using it (the .h files are there), except there is little documentation and the API will likely change. But yes, defini…

Oh you could seamlessly-ish share data between c++ cross platform and java/swift? That would be pretty useful!

So this kind of flow would be pretty simple right?

1. C++ cross-platform layer receives a text message, records it in the realmDB.

2. Java/ObjC UI watcher on that realmDB table automatically gets a callback update.

3. UI gets updated with the new message being displayed.

4. The app gets killed because of a crash, the new message is still safely recorded in the realmDB, user sees it on app relaunch.

Re: Show HN: Realm for Android

#56
post #17

Given the insert speeds, I'm guessing they're (still) not reusing compiled statements. I mentioned this last time I saw Realm on the front page[1], but their benchmarks are misleading without at least mentioning that they're doing this. I'm still very much interested in Realm, and LOVE having a competitor to SQLite. But don't mislead your customers. [1]: https://news.ycombinator.com/item?id=8043332 where seepel finds…

With those numbers that's an understandable assumption on your part, but as it turns out the dev team did learn its lesson from your helpful pointers around the time we launched for iOS… I just checked our Android code and we are reusing compiled statements in our benchmarks (Inserts only since compiled statements are not available for multi-column queries, afawk). Here’s the code we use for inserts: public void test…

Glad to hear it! Guess it's more surprises between platforms :| Given that, I'm even more interested in the Android version, and definitely curious what the source code looks like - that's a respectable speedup, you must be doing something right.

Would you have the source code for the benchmarks available somewhere? On the iOS post there was a link, but I didn't see it on the android one.

Re: Show HN: Realm for Android

#57
I saw Realm's speak at Deview 2014 conference in South Korea, and they released android version during the presentation that introduce about Realm. When you guys opened up the terminal and deployed web service with android version during the seminar, It feels very impressive. Great job guys! :)

Re: Show HN: Realm for Android

#58
post #56

Earlier quoted context omitted.

With those numbers that's an understandable assumption on your part, but as it turns out the dev team did learn its lesson from your helpful pointers around the time we launched for iOS… I just checked our Android code and we are reusing compiled statements in our benchmarks (Inserts only since compiled statements are not available for multi-column queries, afawk). Here’s the code we use for inserts: public void test…

Glad to hear it! Guess it's more surprises between platforms :| Given that, I'm even more interested in the Android version, and definitely curious what the source code looks like - that's a respectable speedup, you must be doing something right. Would you have the source code for the benchmarks available somewhere? On the iOS post there was a link, but I didn't see it on the android one.

[deleted]

Re: Show HN: Realm for Android

#59

I saw Realm's speak at Deview 2014 conference in South Korea, and they released android version during the presentation that introduce about Realm. When you guys opened up the terminal and deployed web service with android version during the seminar, It feels very impressive. Great job guys! :)

[deleted]

Re: Show HN: Realm for Android

#60
post #55
post #53

Earlier quoted context omitted.

Absolutely! That's actually already there. Even with nice expression based query syntax - looks like natural language :-) We havn't released it though since we plan to rewamp it into a more object oriented interface like in ObjC, Swift and Java. But if you really wanted to, nothing prevents you from using it (the .h files are there), except there is little documentation and the API will likely change. But yes, defini…

Oh you could seamlessly-ish share data between c++ cross platform and java/swift? That would be pretty useful! So this kind of flow would be pretty simple right? 1. C++ cross-platform layer receives a text message, records it in the realmDB. 2. Java/ObjC UI watcher on that realmDB table automatically gets a callback update. 3. UI gets updated with the new message being displayed. 4. The app gets killed because of a c…

[deleted]
Post reply on HN