Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create simple GUI project (Hello world) for Android on Clojure?

I'm new to Java/Netbeans but I want to try something on Android. I choose Clojure but the start isn't so easy at all. I installed mode for Netbeans and clojure and can run simple swing applications.

I found https://github.com/remvee/clojurehelloandroid but I can't translate it to NetBeans solution even I don't know how to specify if for Android (Dalvik) Virtual Machine.

(ns us.riddell.TestProject
  (:gen-class
   :extends android.app.Activity
   :exposes-methods {onCreate superOnCreate}))

where are android.app.Activity from coming / how to install / add it ?

And is it the same alike working with swing for GUI on Dalvik Virtual Machine.

I really want NetBeans Clojure GUI Hello World for Android :)

Thank you.

like image 642
cnd Avatar asked Oct 11 '22 21:10

cnd


1 Answers

Here you have a complete tutorial with a link to a GitHub project. In that website you have a couple of articles about working with Clojure on Android (they are even releasing a Clojure REPL for it). Nonetheless, bear in mind that working with Clojure is Android is not smooth at all, there a tons of problems with Dalvik VM and the functional aproach.

Don't know if you can work from Eclipse, given that the plugin is very basic and complains if you don't have a .java Activity, for instance. But you can do it for sure working with adb from the shell and with emacs. Being that i mentioned emacs, here's a very simple blog post on a "Hello World" with the Clojure/Android/emacs combo. As for Netbeans, trully don't know, but it is not the popular choice for Android nor for Clojure, so i don't know how well it might deal with them.

like image 62
ferostar Avatar answered Oct 14 '22 02:10

ferostar