Live data from Hacker News

Show HN: Realm for Android

realm.io

31–40 of 66 posts

Re: Show HN: Realm for Android

#31
post #16

Just as a heads up your documentation doesn't work with the newest version of the Android Gradle plugin (0.13.0), see here: http://stackoverflow.com/a/25939518/472021 the `android-apt` dependency needs to be switched to 1.4 else you get: A problem occurred configuring project ':cachetest'. > No such property: projectDependencies for class: com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated Edit #1…

This is good feedback — we definitely expect to be polishing the API quite a bit in the weeks to come, just like we did on iOS> You have to use Realm.createObject because objects are strongly tied to one Realm at a time. We could introduce standalone objects you can create with regular constructors but you’d be a really heft performance hit there. RealmLists are mostly used to model relationships at this point, so yo…

I was trying to add in a Realm test to a benchmarking project I already have set up to see how quickly I can retrieve a list of Stack Exchange sites from disk/db/etc, the Site model is laid out here: https://api.stackexchange.com/docs/types/site -- each Site object can have anywhere from 0 to N related_site objects, which in my current model I just have as a RelatedSite[], since my test case is running all the different ways to cache/read at the same time I was trying to make a method in my RealmObject version of Site that takes in a regular Site object and transforms everything over, but I couldn't figure out how to translate the RelatedSite[] array into a RealmList without actually iterating through every one and recreating them by hand.

Re: Show HN: Realm for Android

#32
Honestly, SQLite has a lot of utilities, tutorials, useful adapters and UI hooks in Android. Core Data similarly on iOS. If you want me to go to your framework instead, you'd have to provide something better than just redoing the API. E.g. network sync like Couch does.

Re: Show HN: Realm for Android

#33
post #32

Honestly, SQLite has a lot of utilities, tutorials, useful adapters and UI hooks in Android. Core Data similarly on iOS. If you want me to go to your framework instead, you'd have to provide something better than just redoing the API. E.g. network sync like Couch does.

[deleted]

Re: Show HN: Realm for Android

#34
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 testBatchInserts() throws PerformanceTestException {
        SQLiteStatement stmt = db.compileStatement("INSERT INTO "
                + EmployeeDatabaseHelper.TABLE_EMPLOYEES + " VALUES(?1, ?2, ?3, ?4)");

        db.beginTransaction();
        for (int row = 0; row 
So there you go: no intention to mislead. Us overlooking prepared statements when we originally benched iOS was definitely a regrettable error but we do try to improve. Thanks for helping us along the way.

Re: Show HN: Realm for Android

#35
post #31

Earlier quoted context omitted.

This is good feedback — we definitely expect to be polishing the API quite a bit in the weeks to come, just like we did on iOS> You have to use Realm.createObject because objects are strongly tied to one Realm at a time. We could introduce standalone objects you can create with regular constructors but you’d be a really heft performance hit there. RealmLists are mostly used to model relationships at this point, so yo…

I was trying to add in a Realm test to a benchmarking project I already have set up to see how quickly I can retrieve a list of Stack Exchange sites from disk/db/etc, the Site model is laid out here: https://api.stackexchange.com/docs/types/site -- each Site object can have anywhere from 0 to N related_site objects, which in my current model I just have as a RelatedSite[], since my test case is running all the differ…

Thank you for bringing the subject up! Importing data from JSON in a painless way is very high on the priority list. Right now we don't have an elegant solution for your specific use-case, but we're working on it so stay tuned! Please feel free to join us in the mailing list as we would love to hear more about your project and help with it if possible!

Re: Show HN: Realm for Android

#36
post #2

Where does the 20,000 iOS users stat come from? I think it's really cool what Realm is doing.

Hi orta! The estimate is calculated from a mix of indicators: # of downloads, # of forks on Github, traffic to our docs, apps on GitHub, apps on the App Store and a few other things, using the same kind of math MongoDB and others have been using to publish this sort of stats in the past (it’s not cumulative at all, and there’s a healthy safety ratio built into the math to provide a very conservative estimate). Of cou…

This is a non-answer.

Re: Show HN: Realm for Android

#37
It's great to finally see a serious alternative for data storage on Android, and not just one wrapping SQLite at that. While you may not be completely sold on Realm, competition is always a good thing, and from what they are showing, they're definitely bringing that - both on speed and usability.

Re: Show HN: Realm for Android

#38
post #20

Can you use Realm with Phonegap applications?

Technically yes, you could write your own JavaScript wrappers using the bridge (and alias the API differences between iOS and Android) but that’s probably cumbersome at this point. We do hope to make a version of Realm for Phonegap soon.

What about Xamarin?

Re: Show HN: Realm for Android

#39
post #38

Earlier quoted context omitted.

Technically yes, you could write your own JavaScript wrappers using the bridge (and alias the API differences between iOS and Android) but that’s probably cumbersome at this point. We do hope to make a version of Realm for Phonegap soon.

What about Xamarin?

[deleted]

Re: Show HN: Realm for Android

#40
I usually use the following code for this purpose: public void testBatchInserts() throws PerformanceTestException { SQLiteStatement stmt = db.compileStatement("INSERT INTO " + EmployeeDatabaseHelper.TABLE_EMPLOYEES + " VALUES(?1, ?2, ?3, ?4)");

        db.beginTransaction();
        for (int row = 0; row 
Post reply on HN