Adding ORMLite in Android Studio and Maven

1,557 views
Skip to first unread message

Joe Lagomarsino

unread,
Jan 30, 2015, 4:10:22 AM1/30/15
to ormlite...@googlegroups.com
I'm trying to build a project in Android Studio and I can't really find any great info on the best way to get ORMLite into the project. "compile 'com.j256.ormlite:ormlite-android:4.48'" in the apps build.gradle seems to add ormlite okay but it's incredibly old code missing a litany of great features that have been added in the last couple years. Does anyone have any idea why the maven repository has such an old version of ormlite?  Anyone have a tutorial or some hints on the best way to get a recent version of ORMLite into an Android Studio project?

Andrei Verdes

unread,
Jan 30, 2015, 4:24:29 AM1/30/15
to ormlite...@googlegroups.com
Hi, 

I downloaded the last sources from 
and 
and built 2 .jars , and then added them to my project.

The thing is that they are still under development and I wouldn't recommend them for production.
I'm still using 4.48 which is doing a nice job.

Have fun! 

Joe Lagomarsino

unread,
Jan 30, 2015, 4:45:40 AM1/30/15
to ormlite...@googlegroups.com
Thanks for the quick response.  I will try learning how to build the jars and add them to the project.  I'm updating an app that relies on cursors and loaders and really want the apptools that were added since 4.48's release so I can replace all the boilerplate database code without changing the UI code too dramatically.

Andrei Verdes

unread,
Jan 30, 2015, 5:26:58 AM1/30/15
to ormlite...@googlegroups.com
Yeah, the cursors and loaders were the main reason I explored the 4.49 implementations, but there are some performance issues on 4.0.1 older devices using the OrmLiteCursorAdapter.
The preparedQuery.mapRows(...) it's really heavy(performance wise). Upon scrolling, OrmLite creates a lot of objects for you to bind with the view and the ui has a lag on scrolling(on my HTC One Mini and on the Samsung S3 Mini).
I came up with another solution based on 4.48 that is faster and less memory consuming. 
I'll post some gists today and reply again with the link.

Andrei Verdes

unread,
Jan 30, 2015, 9:27:39 AM1/30/15
to ormlite...@googlegroups.com
Here, as promised this is my implementation.
It is more classic oriented, and faster than the solution in 4.49.
The downsize is that you should map rows manually. It's not ORM anymore...


Please let me know if you have any question. 
There may be some errors... :D, I'll make a project out of it in the nearest future :D
Reply all
Reply to author
Forward
0 new messages