Hello, On Wed Apr 10 11:42 2013, Junseok Lee wrote: > Hello! My name is Junseok Lee, and I'm studying CS at UC Berkeley. I was > lead to Clojure through my interest in the Lisp family of languages, > initiated by my studies of Scheme in my coursework. I've been lurking on > this group for a while and thought it was about time to introduce myself. > > I'm hoping to find an effective way to express Android UI layouts with > Clojure during this year's Google Summer of Code. I'm very well versed in > Java and the Android API, and am currently studying the core.match library. > My first thought is to implement something similar to Hiccup's HTML > generation. Am I on the right track or did I get the idea completely wrong? > > Any suggestions are welcome. Thanks in advance.
Thanks for your interest in participating in this year's GSoC. There have already been some good suggestions from other people, such as looking into Alexander's work from last year and Dave Ray's Seesaw. As you know, one of the quirks of Android' UI toolkit is that you need to (or at least should) design your user interfaces so that it can scale gracefully to a large number of different forms, e.g. different screen orientations, different display sizes and densities, different languages, different Android versions, etc. The Android SDK gives you tools to this via declaratively via a series of parallel XML files. This works well enough, but I believe it stands a chance for improvement. In my experience, some of the biggest pain points with this approach are: - While there is some mechanisms for XML layout reuse within the SDK, it seems like as the project and the number of supported configurations grow, it becomes harder to manage the XML. - Often times, within a layout, you'll have a lot of elements that have similar attributes all grouped together (width and height come to mind). Android gives you styles as a way of applying certain attributes to a variety elements, but it somewhat clunky if all you are interested in changing is one or two things. It would be nice to have some sort of cascading style mechanism withing the layout itself. - Once an XML layout is instantiated, it ceases to be data. There is no way to easily query or manipulate it at runtime. This means there is no way to tweak your UI at runtime and spit out XML. It also means any tweaks to your XML layout require a full redeploy of your app. As a result, I have been giving some thought on possible approaches to solve these problems, and it has occured to me that creating some sort of mapping of Clojure data to Android UI elements might make sense. Alexander did some work along these lines last year, but I would be interested in seeing the work taken further. I do not have any specific things I'd like to see done per se; however, some of the questions to ask when considering a solution include: - Can it be used as a library with Android projects using other languages, i.e. Java or Scala? - How well can does the solution integrate into Android SDK? - Is it possible to have a 'production mode' that imparts no additional overhead compared to Android's native approach? - How well can it be used to create tools to make it easier for designers to create layouts for Android? I hope this gives you something to think about. Feel free to post ideas on the list to get feedback from a variety of developers. Sincerely, Daniel
signature.asc
Description: Digital signature