Friday, June 20, 2014

Software development 002

What decided me to plunge back into app coding was that I saw a couple of articles on Firefox OS (which, as a person partially - yet strongly - committed to standards, I have been keeping a lazy eye on) saying that it was now possible to code an app for Firefox OS - which means using CSS, HTML5 & Javascript: see previous blog entry - and INSTALL and RUN that app on Android so long as at least Firefox 29 was installed in the same Android context. That's not perfect, because assuming the whole shebang works, I'm still going to have to tell students to install TWO things, but it's a psychological hurdle mounted in a couple of ways because:

  1. Firefox has mindshare, not like Frink, so I can avoid the "what is it?" conversations
  2. Some people will already have Firefox installed
  3. There are plenty of Firefox selling points separately
  4. It's a big step in the right direct; and Mozilla may manage to make a couple more, leaving Firefox out of the process altogether.
  5. No-one has to explicitly deal with Firefox post the installation; the app-runner is a background process
So, this is as close as I think I need. There's always a reason to keep on waiting for perfection, and I suspect that to an engineer, you only ever get P - delta 

I started by downloading the sample app "battery charger", and it works as a web page (i.e. by pointing a browser at the index.html file. It also works in the simulator which Mozilla provide as an add-on to Firefox; that's a new process to me and two things strike me immediately - one is that no set of instruction that can be written in finite time is ever going to be comprehensive (installing & running the App Manager / OS Simulator) but it will likely be close enough for a bit of fumbling to get you there. NB. Second is that this simulator works about a factor of 10 times faster than my Android simulator used to run a couple of years ago when I was trying to learn *Java-for-Android-in-Eclipse*

NB - this is not trivial, something that developers routinely forget. Non-experts get anxious, and if/when you are delivering - tools/courses/training/whatever - anxiety breeds resistance. The anxiety can't be avoided, but it can't be resented and it needs to be pre-empted if possible & managed if not.

The next step was to try to install this app to an actual Android environment, and get that working. It hasn't yet, although I've not spent more than 5 minutes and three different attempts. It's going to need more than fumbling; it's going to need thought. Anyway, I'll come back to that, because I'm sure it will be possible and although it's the main game conceptually, the biggest hurdle for me personally is app design and coding.

There's some helpful advice about app design and coding on the MDN - this M stands for Mozilla in Mozilla Development Network. It's helpful, but it (will) illustrate(s) a problem with crowdsourced materials because this advice is very simple; it assumes you know practically nothing (which is exactly my case) but other advice elsewhere is written for a much more knowledgeable coder. Moving through the materials, people are likely to alternate between patronised, supported and bewildered. (Can you alternate through three things?) 

The good piece of advice is "Write down in one sentence what your app will do". OK. My app will illustrate various (user-chosen) textual features in authentic (user-chosen) texts. That is simple enough to design, although it hides a lot of potential complexity. (What is "authentic"? Unrestricted choice? What does illustrate mean here?) I have a raft of further ideas, but I've drowned in my own pools of complexity before, so that's it for now. I'll talk about the questions later, but for now, I want a home screen with 2 (or 3) buttons. One will say "Choose text" and open up a list of texts to choose from. The other will say "Choose feature" and likewise open up a list of predetermined features - things I've worked out *how* to illustrate. The third button is just there for existential reasons.

The home screen will also have a header and some boilerplate text to explain what, where & how. Later on I'll add navigation and control features...maybe.

At this stage I know enough about Javascript to code a very simple program. I've read more about it that I've used. I think I understand the style  of the language. (I program by the simple expedient of writing speculative code and debugging it until it works. Usually after a couple of years per language the debugging is significantly decreased.) I understand HTML pretty well, and I've read up on HTML5. I grew up on markup languages (I was a proof reader once) so they don't phase me, plus I don't really think HTML is where the main problems lie in this architecture. For me, CSS is the big scary animal, on lots of levels.

Firstly, I'm not good at design. I'm a content-first animal; I'm not arguing for it, I'm just observing it in myself. I know how useful good design can be, and I know also that it is a sine qua non of the 21st century. If it's not competently designed, no-one will look at it. While this is a learning exercise for me predominantly, I'd also like the end product to be at least a little bit usable, even useful and used, perhaps. So I am really going to try and think about design. But it makes me anxious. Secondly, I hate the CSS syntax. Thirdly, I hate learning things which appear like a mass of details which I'm going to forever have to look up.

I think the final comment for today - I went looking for code to steal & modify in the "snippets" sections of the MDN. There's some useful stuff - but nothing I've found about designing home screens yet. Sure it may not be rocket science, but some mention of design & coding principles would be useful...???

No comments:

Post a Comment