Is it possible to program Android apps in Clojure? Can anybody suggest a good tutorial or book, if it is possible?
6 Answers
Yes, here is main project I am aware of: https://github.com/remvee/clojurehelloandroid
And here is a little tutorial http://riddell.us/ClojureAndAndroidWithEmacsOnUbuntu.html though I would not be surprised if this tutorial is outdated, as it was over a year ago when I played with the code following this tutorial, and remvee's code has since been updated.
EDIT: see the update here from Stuart Sierra and the Clojure/core group: http://groups.google.com/group/clojure/browse_thread/thread/876c90d3ae353c61
"Clojure 1.2.0 works "out of the box" on Android, but startup time is still a problem. Some members of Clojure/core have experimented with ways to make this better, mostly by selectively removing stuff that isn't needed at runtime.
Follow http://dev.clojure.org/display/design/Android+Support for news. The last update was by Aaron Bedra, a Clojure/core member, in December 2010. I wouldn't say it's a high priority right now, but neither have people lost interest.
I personally would not recommend writing an Android app in Clojure if you intend to release it right away. But if you're interested experimenting with Clojure on Android and making it better, then go for it."

- 5,393
- 3
- 32
- 31
Clojure benefits greatly from the android 2.2 JIT compiler which greatly improves class load times. Clojure creates lots of small classes which was taking 'forever' to load on previous android versions.
check out this 'in progress' work on a swank plugin for androiding with clojure

- 90,827
- 27
- 201
- 284
-
3heh, I thought 'swank' here was just another adjective. – Matthew Mar 08 '11 at 18:23
-
3I see, I will attempt to find where this moved to. Pretty cool 404 though :) – Arthur Ulfeldt Nov 14 '11 at 19:23
A new option for Clojure on android is ClojureScript.
ClojureScript compiles Clojure into JavaScript which you can then wrap in an app. This bypasses the Dalvik-VM entirely and avoids the load time issues, if your app is suited to javascript. many apps looking for more tight integration with the platform can't use this approach. If your app can live with out tight platform integration this could save you a lot of time.

- 90,827
- 27
- 201
- 284
I know this is a bit old, but just in case someone stumbles on this, clojure on Android has come a long way since the answers above. The lein-droid and the Neko projects do make it a lot easier to write full android programs using clojure from begining to end.

- 81
- 1
- 2
This has been answered before. Yes, it is possible with a few minor hacks. However last time I tried it was extremely slow and very memory hungry. This was with Clojure 1.1 and Android 2.1. Things might have been improved since then.

- 1
- 1

- 9,789
- 2
- 36
- 53
-
13it does seem that everytime this question gets asked it gets better answers :) (as in the answer is closer to "yes it works" and farther from "it may work someday") perhaps next time it's asked we will get a really 'good' answer – Arthur Ulfeldt Jan 10 '11 at 22:05
Search for "Clojure REPL", "Clojure" or "Sattvik Software" in Android Market and you will find an excellent REPL. I've been using it in my XOOM 1 Tablet, first with Android 3 and now with Android 4.0 without any problem.
If you search hard enough you will find programs for Java (Java IDE), Ruby (Ruboto IRB), Python, Lua, Perl, Javascript (SL4J for the last four, also SigmaScript for Lua), ISLisp (tiny-ISLispdroid), OCaml (OCaml Toplevel), Scheme, C, C++, C#, Pascal, Basic and even Forth!
I regret they still don't have one for Scala!

- 201
- 1
- 6
-
3This question was not as much as "How can I run Clojure code on an Android device" but rather "how can I write android apps in Clojure" – Nov 11 '12 at 18:06