redis on Android

5,440 views
Skip to first unread message

Xu Wang

unread,
Aug 28, 2010, 12:34:39 PM8/28/10
to redi...@googlegroups.com
Hi All,

Just wondering if somebody did some investigation on running Redis on Android platform? Or is it easy to port Redis to Android?

The backgroud for my question:
I have one small embedded application which use Redis as a message queue server, as I need to port my application to Android per customer request, I need to port Redis to Android too otherwise I have to use alternative IPC mechanism..

Regards,
Xu

Josiah Carlson

unread,
Aug 28, 2010, 7:09:16 PM8/28/10
to redi...@googlegroups.com
Android uses the Java language in the Dalvik VM. Some native C
support. Use google for more information.

Alternatively, writing IPCs is fairly straightforward with something
like XML-RPC, JSON-RPC, etc. It's not nearly as hard as you think.

- Josiah

> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.
>

Xu Wang

unread,
Aug 29, 2010, 4:53:40 AM8/29/10
to redi...@googlegroups.com
Josiah,

Thanks for the info..

Yes,  I did some googling already and knows it's using Java..

However Android is using Linux kernel too without glibc, it uses another google libc library.
I'm thinking  maybe it's possible to port Redis using in C and start redis as a daemon process inside Android.
So I can port my GUI stuff to Jave/Dalvik and use 127.0.0.1 to connect to Redis as the queue server?

Using alternative IPCs maybe not too hard but it will require
1) define API again
2) benchmark the queue performance, and maybe
3) change application architecture.

I hope redis can be running on Android..

BR,
Austin

Bjarni Rúnar Einarsson

unread,
Aug 29, 2010, 10:08:41 AM8/29/10
to redi...@googlegroups.com
Xu, this is possible, but could be a lot of work. I think what you will want is the NDK (native development kit) if I recall.

However, keep in mind that Android runs on many architectures, so you're going to have to do cross compiling and distribute multiple binaries with your app for this to work, unless you know in advance that the app will only be used on a limited number of devices, or you are part of an effort to build an entirely new Android distro from scratch where Redis can be included in the base image.

This may well end up being much more work than replacing the messaging layer in your app.

Also, keep in mind that mobile phones are still quite memory constrained - adding more processes and storing data persistently in RAM is not generally encouraged.
Bjarni R. Einarsson

http://beanstalks-project.net/
http://bre.klaki.net/

Joubin Houshyar

unread,
Sep 4, 2010, 11:47:24 AM9/4/10
to Redis DB
Ni Hao.

A JRedis user [http://github.com/antis0c] has tried it.
http://github.com/alphazero/jredis/issues/issue/29

A JRedis ri-m will need to be optimized for the constrained mobile
platform, but ri will do if you just want to explore.

Here is what you need to do (fork it):

- disable convert optimization.

This is probably the simplest and most measurable (from user point of
view) change. Remove the cost to allocate and populate the conversion
table.

- protocol base:

You'll probably want to adjust the buffer size -- cut it down
substantially. Presumably, you are not passing huge payloads to Redis
from your android (mobile) device, so 1024 should be quite sufficient.

And that should do it.

/R

Joubin Houshyar

unread,
Sep 4, 2010, 12:24:48 PM9/4/10
to Redis DB
(heh - read (too fast) as how to 'access redis from android' .. never
mind.)

On Sep 4, 11:47 am, Joubin Houshyar <suno...@gmail.com> wrote:
> Ni Hao.
>
> A JRedis user [http://github.com/antis0c] has tried it.http://github.com/alphazero/jredis/issues/issue/29

Xu Wang

unread,
Sep 5, 2010, 2:21:33 AM9/5/10
to redi...@googlegroups.com
Thanks for the info anyway.. if in the future I have ported redis server in Android, the client side will also be required.
Reply all
Reply to author
Forward
0 new messages