Mat's Blog

Subscribe to RSS feed

Development flow for iOS

I have to start with the caveat that this is just the typical flow I have seen and I've used myself. I'd love to hear about your experiences developing for iOS in larger groups.

Development would first begin in interface builder by adding the UI component(s) that are required. I try to do as much in interface builder as possible and keep the controller lean.

Then you would go back to the controller and implement the appropriate commands. Ideally you would want to test that you've connected the view with the controller properly. I usually use the debugger to test this but in a larger project we would want to build an automated test here following good TDD practices.
The rules for where to go from here diverge a bit and become less clear. Depending on the task you might have to modify the core data model or perhaps there are some communication components that have to be called. Every developer will have their own preference on what step to do next and the steps are less prescribed.

Here are a few tips for smoother development

• test often and commit whenever you have a working copy. by testing after every little change you'll find that you'll save yourself a lot of time in debugging later.
• aim for a simple solution to a problem. if it looks like it's getting complicated step back and reexamine your approach. there is often a better way and this is the time you should ask others around you for their ideas.
• get something working and then proceed to refactor the code. don't forget the refactoring step as it is really important.
• if you have to make a large change to the model I would suggest discussing it with other members and perhaps even the product owner. the product owner will often have insight on future additions to the app that might affect how you would design the schema.


When it comes to code quality a developer always wants to follow these rules
• you want code to be readable and easy to understand. above everything this reduces complexity and will reduce bugs.
• unless you break readability you want to reduce the amount of code possible. Typically the longer the code the more bugs it will have.
• remove duplication in code. This is still reducing the amount of lines of code but it does more in that it allows for reuse of code and separation of similar logic which usually improves readability.
• Read Refactoring by Martin Fowler and follow those principles. Chapter 2 explains the reason we want to do all the things mentioned here.

Motuto - What is it and why aren't we seeing more apps like it?

I've got to start off by saying that I have been involved in producing this product but I want to remain unbiased in my review.

Motuto is a mobile app (currently for iOS) that allows you to connect to a live tutor from your mobile device.
It has all the basic tools you might expect from a tutoring app (live chat, shared whiteboard, etc...)
and a few you might not have thought of.
  • no scheduling (on demand access)
  • taking a photo (handy to work on your homework with tutor)
  • tutor can send math equations
  • background images for graphing or to pull up similar questions
  • build in bot to test the app


The fact that Motuto was designed to work well with educational content like Math is one of the key differences with Motuto. The tutor can send nice math equations across and pull up a Cartesian grid to do some graphing. All the events are saved and emailed to you when your session is done.

So that's what Motuto does and although it may seem like an obvious idea it's really the combination of the business model and app that make it work. You don't pay for tutoring you don't use, it's all on demand. The price is incredibly good and you have to figure that's with apple and their 30% cut. All on a platform that was really designed for communication. The app really takes advantage of the hardware. On a computer using a mouse to draw isn't as good as your finger. The ability to use the camera on the phone or the iPad2 makes it really easy to send a copy of your work to your tutor saving you tons of time not having to explain problems. Lastly but not to be forgotten, the app is on a mobile device. That means you can connect from anywhere. I can see a bunch of kids from school, on the bus, or even out of town connecting and using this.

If you don't believe me check it out for yourself. It's free to download and free for tutoring right now.
Check out Motuto

There is even an easter egg when you connect with the bot. Type in tictactoe to play against the computer and use different greetings like "Konnichiwa" to change the theme before you play. There are other theme that I leave you to find.

Back to Scrum

I haven't posted anything to my Blog in a while and I thought a little evangelistic blog post about agile development was a good place to start.

I wanted to make a few comments about the Scrum Master role.

In agile development the goal is to have small iterations that can be delivered earlier to the customer. Scrum helps to achieve that goal by creating three roles a product owner, scrum master and team members. The role of the Scrum Master may seem simple on paper but it is actually fairly complex and requires lots of attention in order to do it well. The primary goal is to make sure that work gets 'done' without any roadblocks. This in itself is difficult because the definition of done imposes a threshold of quality that is expected for the sprint. It's important to have done defined and to follow it faithfully. The longer features have to wait before being delivered the less value we are providing, and bugs and defects in the product will cost everyone much more in the long run, especially when you account for how bugs affect customer satisfaction.
The Scrum Master also has the role of trying to facilitate continuous improvement in the team. This can be everything from delivering more features or improving quality to improving the working conditions or dealing with certain individual needs. It is important to remember that the Scrum Master is a facilitator and it is the team that needs to participate and self organize to do better.
Whenever we have issues in delivering the high quality product we want and delivering it on time it is an opportunity for change. We want to be able to deliver a product after any or every sprint. Until we are able to do that with confidence we are not done.

The most important time in the sprint for me has always been the retrospective. It's the time to reflect on what can be done to be more effective.
"Why did that bug sneak through?," or "why was that story rejected" are questions you should be asking and the whole team should be trying to find solutions.
Don't go overboard either, try and solve and focus on one or two things and try to address them immediately in the next sprint. If you focus on too many things during the retro then you also have the problem that nothing gets addressed properly. Also make sure you review the changes you made last week.

Trying out this Influencer product from StrongMail

As you may or may not know this product allows you to create quick and easy social marketing campaigns...

Quick and easy, eh? I will keep you posted. Been at it a few hours already and I think it might
be a problem with the fact that my test website is local and not visible from the web. Which wouldn't work for a real web campaign.

The ad link works great it's the link in the email, it never shows the Recipient Panel. grrrr


Congratulations Opera on making it onto the iphone app store.

I was reading an article yesterday about Opera making it to the iPhone store. I am extremely pleased by this decision because it shows that Apple is ready to allow 3rd party apps that replicates their apps if they are done well.

Of course the Opera mobile does have the extra benefit of doing pre-compression before it makes it to the phone.

Congrats!!!

Solaro IPad app released

Been working on a project called Solaro. www.solaro.com
It's a resource for students grades 6-12 that they can use to study or practice for their tests.

It's one of the most comprehensive resources online available for kids and it's entirely built
to the local curriculum so everything they see is relevant.

We've just released an ipad version of the app and we are pretty sure it's the first IPad app of it's kind.

iTunes link

So much to say. New version of Document Courier and Document Sync

It's officially released. Go and download the latest versions of Document Courier and Document Sync.

Now you can upload full folders with one easy step.

Document Sync and Document Courier

Its been a long time...

Ok, I have a lot of interesting stuff to post but I won't quite post it until I have this next project setup.
The one thing I did have trouble with was setting the value for a checkbox.
You would think this would be trivial but I realized a few things.

The Markuper script doesn't translate tags that are within tags and not within quote. I am not sure why but that basically means that that following doesn't get translated.
<input type="checkbox" {{checkedvar}}/>


So to get around this I used the xpath approach to get to the variable.
var access_node = template.xpath("//input[@id='ds_autosync']")[0];
access_node.setAttribute('checked','checked');

Security Violation using XMLHttpRequest

This was an error that had me banging my head against the wall for a while.

If you are using an XMLHttpRequest you might get the following error.

JavaScript - widget://682251721593684393281251651206/index.html
Event thread: _index
Error:
name: Error
message: Security violation
stacktrace: Line 118 of linked script widget://.../script/script.js:
http.send(null);


If you are like me you read the Article from opera about ajax and widgets. This applies to Unite as well.
Opera Widgets and Ajax: connecting to multiple servers

The one thing they don't mention here is that you need to enable network access for your app.
This is how you do so. smile
<widget network="public private">


Markuper Bug or Undiscovered Feature

At some point your code may become complex enough that you might want templates that include templates.

There is a good tutorial on Markuper and it shows you how to do so. In a previous blog entry I explained how you have to pre parse the document to have access to the DOM.

It turns out that if you use a data-list inside an embedded template and have to call the parse function more than once than the data-list will duplicate data.

The workaround is to move data-list into your top level template.

File Uploader finally deployed

So our reign has finally ended. There is a new file uploader with pretty much the same features except it allows you to manage your files from the interface and not only from the operating system.

I had some issues running it on my mac not sure why but feel free to download whichever suits your fancy.
Once I have a bit more free time (it is summer after all) I am planning on doing something cool with it.
So you might want to stick around.

New Version

Version 2.0
A new version of the app is up.

With this release we added the following features
  • More descriptive error messages
  • Ability to customize the maximum size for your download folder
  • Added percentage bar to show you how full the directory is.


It was probably not worthy of a full major release upgrade but the next version 2.1 will have the ability to show the files and folders in the directory. It will also alert the user of any new additions.

Update Today smile
Document Courier 2.0

Posted new version waiting for approval

Haven't blogged in a while, but that's because we are nearing
a deadline at work and that is keeping me busy.

However we did get some work done and were able to push up a new version.
You should see it soon.

Running a task in the background

Here is the post I promised about background tasks.

It wasn't necessary for the Document Courier to have a task running in the background since almost there was always
an action from a user in the app. At least so far...

But I wanted to find out how to have a task running in the background checking to see if new files had been added to the directory from another source.

The best way I found to do that was with the setInterval function. You specify a function() to call and the time in milliseconds. Obviously since these services run in the background you probably want to make sure you don't poll too often.

A classic example would be checking for an update and showing a notification to them.
setInterval( function () { 
    if(checkForNewFile()){
        widget.showNotification('A new file was added!!!);
    }
}, 60000 );


That will cause a message to popup on the users screen and the app will have a little red notification symbol next to it.
You also have the choice of using the widget.getAttention() method which will cause the app to flicker in windows and the icon to jump in OS X.

Testing would be nice

The one thing that I find hard in Unite is to do the testing.
I am referring to unit tests and functional tests.
Because it is sand-boxed it is really difficult to test apart from inside the unite system.
I am thinking I might be able to create another config file to load my js file with my code.

I haven't blogged in a while but I will later this weekend. Expect a post about running a background task this weekend.