Programming and general geekiness.

Archive for March, 2012

HTML5 Canvas Stick figure animator

This morning I remembered a program that I haven’t used in years: Pivot Stickfigure. The program was a pretty simple animation tool for making 2D stickfigure based animations and it was fairly popular a few years back and there are many thousands of videos that have been made with it on YouTube. I thought it would be interesting to make a similar tool to Pivot Stickfigure that allowed me to create simple animations, however I figured it would be more interesting if I made it with HTML5 Canvas.

Before I started I decided that rather than having individual frames I would have a keyframes system. This would allow me to create smoother animation (even though I’m not that great at it). I put together a load of JavaScript that stores the animation in JSON format (and also displays it so that you can ‘save’ your animation). Unfortunately my version doesn’t really allow for more than one stick figure however it could, in theory, be added at a later date. I also added in a bunch of sliders so you could manipulate each frame and choose at what time point you wanted it at.

The above video shows my shocking first attempt at making an animation. Unfortunately my computer’s least favorite activity is screen capture so its a bit slow but if you want to check out the web app please click here and if you want the JSON for my animation click here (you can just copy and paste it in).

Things I’d like from Android

Android is a good platform – not a great platform, but a good one. I’ve been doing a lot of Android development recently and it certainly has many good features and it is easy (and cheap) to make an app for the system. There are, however, a great number of problems with Android from a developer’s point of view. This is a rough list of things I would like to see from the Android project. I don’t think that it necessarily needs them, but I think it would be a good thing for the platform if it had a few of them:

  • SVG support everywhere: A major problem with Android at the moment is that you have to create at least three different copies of the same icon for use in app because Android apps can run on many different devices at different resolutions. If all icons were changed to SVG it would be possible to just include one copy of the icon and know that it would be shown at maximum quality on all screens. This would also be useful when Android displays eventually get to a higher pixel density (as in the iPhone and iPad) as icons would never appear pixelated. SVG font support would also be handy but not a requirement.
  • Better font support: Android currently comes with three fonts whereas Windows Phone and iOS come with over fifty. You can include fonts in your app however if you wish to do this you have to change the font of each View pragmatically rather than via styling or XML which can increase the size of the app and also make it slower. Again, SVG font support would be useful.
  • Higher PPI displays: When the iPhone got a Retina Display the only way that Android devices could get a similar resolution was to get bigger screens because Android wouldn’t run as well on higher density displays. There should be some big system changes to get this support.
  • One Android: It amazes me how phone manufacturers have fragmented Android by adding new UIs and alternative apps. Whilst some of these are really great it often means that some devices won’t receive a major update for months after it has been released because the UI is being developed. If Android could go back to being pure Android it would make it a lot easier for developers and require less testing of apps.
  • Google Play gift cards: This seems like a painfully simple thing to do but it is one of many reasons why iOS developers make a lot more than Android developers. It is a well known fact Android users ‘don’t like buying apps’ however the problem is that most of them can’t. When you set up an iTunes account you either have to type in your bank details or set it so that you will use gift cards however this is not required for Google Play registration. As most Android users have not created a Google Wallet account they can’t buy Android apps. By selling gift cards everywhere (as iTunes does) more people are likely to start buying apps.
  • Better integration between Eclipse and Google Play: Currently you can create an app in Eclipse, export it and then upload it to Google Play. It makes a lot more sense, however, to integrate the two so that developers sign into Eclipse and then press one button to upload an app to Google Play. This would also simplify the process of creating in-app purchases.
  • OTA updates: Most iOS devices are now running iOS 5.x and many are already running iOS 5.1, which came out in the last month. On Android most devices are still stuck with a two year old version of Android because phone manufacturers (who are responsible for updates) have not chosen to update to Ice Cream Sandwich. If Google were to take over the updating of Android devices it would probably mean that more people were using the latest version of the software.
  • Better emulator: The Android emulator is very good however it can be incredibly slow when trying to emulate Android 3.x and Android 4.x devices.

Keep Calm 2.0

I have updated Keep Calm for Android to version 2 so that it now uses them same UI as Keep Calm Pro.

Keep Calm on Google Play

Keep Calm Pro on Google Play

New Android app: Keep Calm Pro

It’s been just over two months since I originally published Keep Calm on Google Play and the time has come to upgrade it to introduce new exciting features. Keep Calm Pro is now officially available and introduces the following new exclusive features:

  • Updated rendering engine so that text always appears on the poster and so that it appears at the maximum size possible
  • New menu that makes the app easier to use and reduces time between loading the app and saving/sharing the finished poster
  • The option to use the standard sans-serif font or Open Sans Light
  • Change the text color
  • Change the icon to one of 50 included icons or any image from the your Gallery which is automatically resized, cropped and recolored so that it looks great at the top of the poster
  • Change the background color and choose whether it is a solid color, linear gradient or radial gradient
  • Change the background to an image of your choice from your Gallery
  • Improved wallpaper rendering for higher quality

Unfortunately camera integration didn’t work too well initially so in version 1.0 you will need to select the ‘Gallery’ option before pressing ‘Menu’ which then gives you the option to take a new photo. Please note the image of the teacup used in the screenshots is licensed under Creative Commons license from Wikimedia Commons. All other images used by the app are in the public domain.

Keep Calm Pro is by far the best Keep Calm and Carry On app available for Android at just 50p/99c.

User guide for Keep Calm 1.x

I first released Keep Calm for Android over a month ago and it remains the best Keep Calm and Carry On app available on Google Play with over 30,000 downloads and over 200 ratings. Recently I’ve had a number of comments suggesting that the ‘app freezes on the loading screen’ and other basic problems so I thought that I would write up a quick guide for basic usage. Please note that I am launching an awesome update to the app within the next week which gives it a completely new UI with loads of new options.

1) The home screen

This home screen (its not a loading screen!) is pretty simple and you can just press ‘Design’ to get going. There isn’t much interesting stuff on the ‘About’ screen.

2) The design screen

This screen is also pretty easy to use. When typing the text you do not have to have it on separate lines and if you do have it all on one line it gets split by word. Capitalization isn’t important because this happens automatically, staying true with the original poster. If you don’t type in anything the default text of  ‘KEEP CALM AND CARRY ON’ is used. The icon button probably doesn’t need any explaining – just tap it to be presented with a choice of 50 icons and then tap the one that you want to use. Tap the color button to pick a new color.

The color system used by version 1.x isn’t great, sadly (although it uses a color wheel in version 2). The sliders use the RGB color system where each color is represented by its red content from 0 to 255, green content from 0 to 255 and blue content from 0 to 255. To put it in perspective the color black is R0, G0 and B0 (because it doesn’t have any red, green or blue) and white is 255, 255, 255. The sliders therefore give you a choice of 16.7 million colors. You can the tap ‘Use Color’ once you are happy. Unfortunately version 1.x doesn’t allow you to change the text color so I have to recommend that you use darker colors.

3) The final poster

Once you’ve tapped ‘Design’ you’ll be able to see a preview of your final poster. The poster is rendered at 600 pixels wide by 900 pixels high. You can either tap the poster itself or press the Menu button on your phone to display the menu. As of version 1.2.2 tapping Save will save the image to the SD card and then display it in the Gallery app. In earlier versions it seemed that a user had to reboot their phone or wait a significant amount of time for the image to appear in the Gallery however a bug with Android stops the Gallery app refreshing by itself so I added one line of code to force it to refresh. Sharing will display a menu of different options for saving, dependent on which social networks’ apps you already have installed (so you’ll need the Twitter app to share on Twitter, the Facebook app to post on Facebook, etc).

Setting as wallpaper works exactly like saving except that a new image has to be generated because Android handles wallpapers in peculiar ways and requires a landscape image so it occasionally takes a while to set the wallpaper on older devices, but on new devices it is pretty much instant.

Hopefully this guide will have helped some of the users that are having issues with version 1.x. If you have an older version than the most recent 1.2.2 update I highly recommend that you update although in a week there will be an awesome new update that will give loads of new features, such watch this space!

Happy Pi Day!

20120314-065820.jpg

My iPad 3/HD bets

Well. Today is officially iPad 3/HD day. Here are my bets in decreasing likelihood:

  • Retina display – it would be a crime if this didn’t happen
  • Siri
  • Quad core with A5X chip inside
  • 1GB of RAM
  • New 128GB model
  • Better cameras
  • No home button
  • Cheaper iPad 2S ‘Small’

As well as the iPad, iTunes will probably be updated along with the Apple TV to support 1080p content, especially because of a Retina Display.

Pricing apps

App development is becoming increasingly common and everyday hundreds – if not thousands – of new apps are released each day. Mobile platforms, along with the web, are the most popular deployment bases. The main mobile OSes all offer an online app store of some sort that allows developers to either give away their apps for free of force users to pay for them.
A large number of apps are now ad-supported so that developers can still profit from free apps. The only problem with this model is that ads often really damage the user experience, especially in games because they just get in the way of what the user is trying to do.
The biggest alternative to ads without charging for the app is to have in-app purchases so that users have to pay for additional features in the app. This is a lot more efficient than ads because it maintains a contained user experience that is solely focused on the app itself. My belief is that these in-app purchases should add to the user experience rather than not having them making the app worse. An app with in-app purchases should function perfectly reasonably without the user having to pay to make it better – instead they have the choice. At the same time I’ve got absolutely no objections to users being encouraged (but only subtly) to purchase additional features.
At the end of the day if you’ve made a really great app you should charge for it but if you feel you can reach more users by making it free and letting them pay for some extra features in-app purchases are probably an equally good if not better option.
After that I’ve made a mental note not to try posting from the WordPress iOS app.

Follow

Get every new post delivered to your Inbox.