At the risk of being discursive I think behind this is the question of why the Android Studio / Gradle experience is so bad.
Typical Clojure experience :
* download project with dependencies listed in project.clj.
* Leiningen gets the dependencies thanks to Clojars and Maven.
* Project compiles.
Typical Android Studio / Gradle experience :
* “Import my Eclipse project”.
* OK project imported.
* Gradle is doing it’s thang … wait … wait … wait … Gradle has finished.
* Compile … can’t compile because I don’t know what an X is / can’t find Y library.
I’m not sure this is Gradle’s fault exactly. But the “import from Eclipse project” seems pretty flaky. For all of Gradle’s alleged sophistication and the virtues of a build-system, Android Studio just doesn’t seem to import the build dependencies or build-process from Eclipse very well.
It doesn’t tell you when it’s failed to import a complete dependency graph. The Android Studio gives no useful help or tips as to how to solve the problem. It doesn’t tell you where you can manually look in the Eclipse folders. It doesn’t tell you which library seems to be missing. Or help you search Maven etc. for them.
In 2016 things like Leiningen / Clojars, or node’s npm, or Python’s pip, or the Debian apkg (and I’m sure many similar package managers for other languages and systems) all work beautifully … missing dependencies are thing of the past.
Except with Android. Android Studio is now the only place where I still seem to experience missing-dependency hell.
I’m inclined to say this is Google’s fault. They broke the Android ecosystem (and thousands of existing Android projects / online tutorials) when they cavalierly decided to shift from Eclipse to Android Studio / Gradle without producing a robust conversion process. People whose projects work in Eclipse aren’t adapting them to AS (presumably because it’s a pain for them). And people trying to use those projects in AS are hitting the same issues.
And anyway, if Gradle is this super-powerful build system, why am I still managing a whole lot of other dependencies in the sdk manager? Why can’t a project that needs, say, the ndk specify this in its Gradle file so that it gets automatically installed and built-against when needed? Why is NDK special? Similarly for target platforms? Why am I installing them explicitly in the IDE rather than just checking my project against them and having this all sorted for me behind the scenes?
Over at the comments on Use Dropbox in place of iTunes I pointed out that, far from Android working straightforwardly, the problems I posted about here suggest that Google is actually breaking the “just working” file-system model that Android used to have.
Maybe this is in the name of security. Or efficiency. Or following Apple in wanting to control everything on the device through their own apps and protocols.
Whichever, I’m deeply disappointed with this.
(Dave suggested I noted that comment here on the blog to give it more visibility. Agreed, we need to draw people’s attention to this. We can’t lose the file-system as a widely used open protocol for different applications and vendors to communicate.)
Just found that this bug in Android is causing problems for my OWL / OWLdroid syncing. Issue 38282 – Android MTP support does not show recent files until the device is
Basically, when OWLdroid creates a new page, it writes a new OPML file to the Android’s local storage. But because Android now has some fairly complicated abstraction layers between your program and storage, including caching of directory listings, it means that although the file is there, not everything can see it.
I’ve been noticing this problem, possibly for a while.
Initially, I thought there were still a couple of (fairly infrequent and hard to reproduce) issues with the btsyncing between OWLdroid and my machine.
Then, the btsync seemed to break altogether as it seems that it can no longer work on the same directory that OWL does. (It’s not Bittorrent Labs’ fault, it semes there’s been a change to Android that restricts where apps. can write)
So I planned to update OWLdroid to be more compatible.
In the meantime, as a work-around I was syncing the directories via USB cable and meld. I used meld rather than rsync because it sees the MTP protocol which Android uses to connect to a PC.
However, today I was confronted with a mystery that brought me up short : meld could see and work on all pages except a new page I’d created two days ago on the Android device, which was invisible to it.
I could see the same file in Ghost Commander (my Android file-system explorer). But meld couldn’t see it. Further investigation showed that not even Nautilus (via. MTP) could see it. Or any subsequent pages I created.
After a bit of Googling, I discovered the bug linked above. Something that was been reported to Google two years ago and still doesn’t seem important enough to fix.
As far as I can tell, it’s a cache refresh when a file is created or rewritten. Obviously it OUGHT to be fairly simple to fix. Or if automatic refreshing is not the desired behaviour, at least to have an option in the Android file-system API that can force it.
Otherwise, Android become useless for any app. which is working on files. And while Google’s priorities may be elsewhere (the conspiracy theorist in me wonders if they’re trying to drive everyone towards their cloud storage), surely they can’t hope for Android to take off as an ecosystem which people can use to do real work (say, in the enterprise), if you can’t write apps. that reliably work on files (and have your changes seen by connected machines).
Anyway, it’s frustrating. And until I see some way to reliably solve this problem, it certainly knocks back the (already fairly leisurely, “when it’s ready”) release schedule for OWLdroid to public via the Play store. 🙁
Note that I’ve moved the navbar of OWL into the space which Bootstrap usually uses for the main menu. This is a big win in terms of space, and the fact that it’s now always visible, even when scrolling down long pages. I’m not sure, yet, how this will work on smaller / phone-sized screens.
Having contrasted Quora, positively with StackOverflow, I find that Quora is also starting to play the “word-shaping” game by which either an algorithm or a tone-deaf moderator decides to constrain how you are allowed to express your questions 🙁
No idea why they really feel the need to do this. But it basically has the effect of driving out all personal voice, subtle context to your question, potential for jokes, creative wordplay, malapropism, coining neologisms or anything else that keeps language alive and a delight for the intelligent mind.
Here’s my original (rejected) question :
Should I learn Clojure for Android programming?
I’d like to get into Android programming. But every time I play with it, I find it full of that verbose Java bureaucraticality that we all know and hate.
I’d like to work with a nice modern, higher-level language. (I’m mainly using CoffeeScript / Python these days) So, would it be worth me learning Clojure to do Android programming?
By this I mean two things :
– can you write Android apps. in Clojure at all (is the tooling there?)
– does Clojure buy you anything in the Android world? Or will I still be making the same long sequence of imperative calls to the same Java libraries that I’d be doing in Java? Ie. for this kind of application there isn’t much “compression” in Clojure compared to Java
I’m not saying this is a great question. Or perfect example of writing. But it is MY question, the way I wanted to phrase it.
Update : Got into a certain amount of argument about this. (Partly because I’m complaining.)
Here’s what I found myself replying :
If people prefer not to answer the question, that’s their prerogative. No problem.
The point is, is Quora going to set a “maximum sophistication” limit on questions, so that people who are capable of understanding a question that requires three paragraphs to capture its full meaning, are nevertheless prevented from writing or reading such questions because Quora has decided that only single-paragraph questions are allowed?
I think that will be a catastrophic loss. For me because I like Quora. And, I think for Quora, because it will become a less interesting place to be. I’ve already seen this happen on StackExchange. A place where I used to hang out every day, but where I now spend as little time as possible.
Question : Hey Phil, do you actually do any programming these days?
Answer : Yes. Quite a lot at the moment. Though it’s a bit all over the shop.
I’m dipping a toe into Android programming. (And, hmmm … Java …. I thought I’d got over my Java hangups by doing a lot of Processing, but it turns out that Processing just hides the crap and Android doesn’t. Why hasn’t Google picked up on Processing to turn it into a first-class Android art / game app. development environment?)
I’m mainly writing CoffeeScript. Some stuff related to my ongoing 3D modelling / desktop manufacturing projects. (Did I forget to mention those? I’m sure there’s a half-written blogpost somewhere.) Some work towards an SdiDesk-derived network diagramming plugin for Smallest Federated Wiki (held up by silly problems). Some other bits and pieces. I’ve recently been playing with Jison, which rocks. And I’m about to investigate angular.js which looks pretty good.
There’s a project for small stand-alone web-servers that I’ll talk about more if / when it takes off.
I’ve been trying to compile example VST instruments (C++) for some of my work with the Brasilia Laptop Orchestra, but it’s driving me crazy. (I may go back to Pure Data which can be embedded in a VST.)
A bit of PHP, just simple small web-services.
I’m going to be teaching an Arduino course soon. So I’ll be writing a bit of C and I want to try Occam-Ⲡ.
I’m still writing Python too. Mainly for short file transformation scripts or to prototype algorithms that later get translated into CoffeeScript.