I'm developing a standard Android app (in java), but would like to implement some of the non-UI "business logic" in clojure. Are there any downsides to doing this, or issues that I should be aware of that would make this a bad idea?
I've done a simple test - calling functions in a trivial clojure library from an Android app, and this appeared to work without any obvious issues.
I've seen comments about issues with regards to time to load clojure.jar, but in my case clojure is not handling the UI.
I'm not clear if there are any other memory or performance issues I should be concerned about.
Update 16th Jan 2017
I encountered some issues when trying to use some slightly more complex clojure libraries, specifically one that depends on core.async.
With standard clojure 1.8 as a dependency I tried to:
new ClassDefinedInClojure()
where ClassDefinedInClojure is the AOT generated java class, but I got:
java.lang.VerifyError: Rejecting class clojure.core.memoize.RetryingDelay because it failed compile-time verification
I assumed that this was the result of the same issue identified here:
http://dev.clojure.org/jira/browse/CLJ-1472
But the problem still existed even after I'd rebuilt clojure 1.8 with the patch (http://dev.clojure.org/jira/secure/attachment/15351/clj-1472-2.patch) applied.
I am aware of of the android specific build of clojure https://github.com/clojure-android/clojure, but to be honest not clear how this differs from normal clojure and why it is needed. I did try using this as an alternative to the standard clojure library, but had the same issue.
With respect to my original question, this was useful - http://blog.ndk.io/state-of-coa.html