Tag Archive | "iOS"

Using TestFlight SDK with MonoTouch

When developing applications getting reliable and good feedback and information from your testers is vital to the quality of the application you are creating. A great tool that can help you with this as an iOS developer is TestFlight.

If you are unfamiliar with TestFlight check their website for detailed information, but in short; it is the easiest way to distribute beta builds of your application to your testers. In addition to distribution TestFlight has an SDK that you can implement in your code to track  usage and states in your application. With the SDK you can also ask the user questions that is related to a checkpoint, or also ask for general feedback. This can be implemented per view or for the whole application. The TestFlight SDK also has a log feature where you can for instance in your error handling automatically upload exception messages. Global application crashes is automatically logged to TestFlight.

Getting the SDK to work when you are using Objective-C and Xcode is easy, but as a MonoTouch/iOS developer using MonoDevelop it is a bit more tricky, not much but a little bit. Following is a step by step guide  on how you can use I use it and find it useful.

The guide assume you already have MonoDevelop installed with MonoTouch. If you just want to test the version i have created to see the question and feedback windows you can download my sample app on here: http://testflightapp.com/install/1644edbe8988e1750d800e262288cbc2-MjE3MjQ3Mg/

You can also download the sample app source code from here.

1. MonoTouch bindings for TestFlight

The first thing you will need is the MonoTouch TestFlight binding library. Download that to you computer from http://tflig.ht/MA8ycg

2. TestFlight iOS SDK

Download the TestFlight SDK zip file to your computer from https://testflightapp.com/sdk/.

3. Create your TestFlight.dll library

When the download is complete, copy or move the zip file with the SDK to the “binding” folder inside the MonoTouch library you downloaded in the first step. then open a Terminal window and navigate to the same binding folder. Once there just run the command “make”.  The “make” command creates a TestFlight.dll file that you will use in your application.

4. MonoDevelop

Open or switch to MonoDevelop and create a new MonoTouch iPhone application and add a reference to the TestFlight.dll file you just created.

One that TestFlight uses is the uniqe device identifier (UDID).This has been deprecated as of iOS 5 so be sure to NOT include references to that in the version you plan to submit to the AppStore! But for  identifying devices in betatest it’s great! Some parts of TestFlight can also be used in live applications like the TestFight.Log(string message); feature, that you can use in case of errors in live applications, The feedback windows can also be useful if you haven’t created you own feedback system.  So, there’s only one way to have some code compile for release and some at other times and that is by using debug symbols like this

      // Some code to execute when the debug symbol is hit.
      // Other code to execute when the DEBUG symbol 
      // isn't present (for instance in RELEASE)

In my projects I always have at least three different configurations. Debug, Release and TestFlight. Debug I use while developing, Release for uploads to AppStore and TestFlight for uploads to TestFlight. To create a configuration for your app solution (that will apply to all projects in the solution) right-click on the solution and select options, then choose build -> Configurations. Add a configuration called TestFlight (or any other name you choose). If you have more than one project in your solution that the main app project depends on remember to set the configuration mapping too.

Secondly you need to configure the TestFlight Configuration. Right click on your project and choose Options. I always use the same configuration as for Debug since there’s no real difference except that I will upload this. There are two options you need to configure for the TestFlight configuration. under Build -> iPhone IPA Options you need to check the “Build ad-hoc/enterprice package (IPA), and create the debug symbol by going to Build -> Compiler and type “TESTFLIGHT;” without quotes. If you already use a DEBUG; symbol in your code you can append that here by typing “DEBUG;TESTFLIGHT;”, then all code that is marked for compiling while debug will also be compiled in the TestFlight build.

You can now use this in your code.

      // Some code to execute when the debug symbol is hit.
      // Other code to execute when the DEBUG symbol 
      // isn't present (for instance in RELEASE)

5. Development

The IDE is configured and you have the library, it’s time for implementation. This guide is how I have implemented it. It works and like this way of doing it, but I don’t know if it’s the best way or smartest way of implementing it so if anyone has suggestions for improvements I’ll be happy if you let me know.

The first thing I do is to Identify the device and start the TestFlight session by calling TakeOff. I do that in the Main.cs file.

static void Main (string[] args) {
      try {
         UIApplication.Main (args, null, "AppDelegate");
      catch(Exception ex) {
          TestFlight.Log("Unhandled Exception:" + ex.Message);
          // rethrow to resume normal action on unhandeled exceptions......
          // app crash...

So, here we use the TESTFLIGHT symbol to only use the UIDevice.CurrentDevice.UniqueIdentifier when we build for TestFlight. If this code is used in the release and uploaded to AppStore it will be rejected and we don’t want that. It is important to notice that if you use the SetDeviceIdentifier you can only distribute your app to testers defined as members in your TestFlight team. That means that you cannot distribute it to anonymous testers.

I have also surrounded the  load of AppDelegate with a Try/Catch to handle any errors that may bubble all the way up and crash my app. Things that I should have caught earlier in code. Now I at least have a mechanism to capture it and tell me and that is very useful.

Other methods we use in the TestFlight library is PassCheckpoint(string), Log(string) and OpenFeedbackView().

The PassCheckpoint method is used to tag events in your app that the user reaches. It could for instance be when a button is pressed or a view is loaded.

TestFlight.SubmitFeedback(string feedback)

This can be used in live apps to gather user feedback.
MonoDevelop has full support for direct upload of apps to TestFlight and have a good guide on how to do it here http://docs.xamarin.com/ios/tutorials/TestFlight_Support. Uploading to TestFlight is as easy as compiling.
How you use the TestFlight web site is an article for later so until then, play around and you’ll figure it out.


Use Facebook to Comment on this Post

Posted in Code, iOSComments (0)

Am I loosing faith?

Ever since I was invited by Microsoft (Norway) to Las Vegas and the unveiling of Windows Phone 7 at Mix in 2010 I’ve been super stoked about the new MS mobile os. It was new, it was (is) fun to use, and it has a great potential. Once a decent phone was available in Norway i jumped on a HTC Titan phone and I’ve almost never looked back to my iPhone days…

but… now, over two years later whats happening?

At Mix in Las Vegas 2010

Nothing is happening!

We are waiting for Windows 8! and we are waiting for Nokia (or any other vendor) to start manufacturing more phone models. For two years Microsoft has worked on convincing their huge mass of developers to “convert” or extend  to app development for Windows Phone 7. For what? to publish apps to a smart phone os with 2.2% global market share?

Some numbers; Windows Phone have had a drop from 2.6% in 1Q2011  to 2.2% in 1Q2012 according to IDC Worldwide Mobile Phone Tracker, 24. may, 2012. In the same timeframe Android went from 36.1% in 2011 to 59%. Apple and iOS from 18,3% in 2011 to 23 in 2012. This is global market share numbers. The Windows Phone numbers also include any Windows Mobile devices still being sold. I am not sure if these numbers also include all the industrial type rugged devices that (still) run Windows Mobile and/or Windows CE/Embedded. For Microsoft i hope not. In Norway the numbers are a bit different. Android is the biggest platform with about 50% of the market, iOS has between 40% – 45% and Windows Phone has reached about 5%.

With these numbers in mind, and as a technology advisor; What is my motivation to try to get clients and customers to pay Windows Phone app development? I have no idea! More and more lately I have advised customers to just wait with the Windows Phone app because there’s no real ecosystem for it. At least not in Norway yet. I still wonder when we’ll be able to use all the cool features they show off in the “Smoked by Windows Phone” campaign.

I have “defended” the Windows Phone market share earlier (and not long ago) because I believe that a drop in market share partially can be explained by lack of a variety of device models and that people who used to have Windows Mobile devices aren’t ready to “upgrade” to Windows Phone yet, They want to try something else first.

If it’s Windows 8 we’re waiting for that’s ok with me, but I am a bit puzzled that for the last two years the ONLY (almost) group Microsoft has promoted WP to is their developers. No campaigns (in Norway) aimed at the consumers that the developers needs as motivation for developing.  Me, I’m not worried, Android and iOS apps are easy to sell, they have the user mass. We can wait until sometime around spring 2013  or longer when people start adapting the Windows Phone 8 (if they do) we  already develop all our software with C#, MonoTouch and MonoDroid from Xamarin anyway so we’re ready for whenever Microsoft can provide some motivation for me to recommend my customers to invest time and money into Windows Phone.

On a personal note I can say that I really like Windows Phone no matter their early technological flaws. I believe that the world needs 3 major (equal) mobile platforms and I hope Microsoft succeed, but It’s not right for me to suggest or “sell” the idea to clients that they should invest in this early. There just isn’t a commercial market there yet.


Use Facebook to Comment on this Post

Posted in Technology, Windows PhoneComments (0)

App Test: Fun Clock Norwegian for iPad

A while ago I was asked if I wanted to try out, and write a review of the iPad application “Fun Clock. Learn to tell time in Norwegian“. In short, Fun Clock is a training game designed for children from the age of 4 to 10. The goal is to teach children to understand the clock and read the time. Luckily enough i have in my immediate family testers in the target audience, and put Hedda (5) and Sebastian (10) in charge of testing the game. If you want to read my norwegian review you can read that on mobilteknologi.no

First, a short promo video of the game:

From a technical point of view I think the user interface looks nice and works well. The Norwegian voice-over also works well and I think it sounds a bit like it’s Alex Rosén that has the lead voice over role (do not know if that ‘s correct or not). The only odd choice from the publisher in my opinion is that you MUST keep your iPad’en “up side down” for some reason. The game does not rotate as it should when you rotate the iPad.

The game also only use sound/voice as a means of communicating tasks in the game so you are totally dependent on sound. Bring headphones :)

The game itself is divided into 5 “levels” and in each level you can achieve from 1 to 3 stars according to how well you manage the different tasks in each level, this encourage the player to try again to get a better score, in a way that we are familiar with from games like Angry Birds. There is also some tutorial movie clips that will teach you more about the clock and time. There are 3 movies. One for hours, one for minutes and one for learning digital clocks. These movie clips are there to teach basic concepts of time.

Hedda (5) was impatient and wanted to play right away, so to get her to sit and watch the movie clip was a challenge.

Another important prerequisite for using this game is that you can count quite well, and I think it might be too much for some 4 or 5 year olds. For the youngest ones it might be a good idea to try together with an elder sibling or parent. You  as a parent  can play along with your kids and teach them the basics of time at the same time.

The first level task is to place the numbers and pointers on the dial correctly. A task that is quite easy, but require that you know the numbers from 1-12. Hedda ended up with 2 stars on her first try.

The second level is to set the time in whole and half hours. The first 4 tasks using a red and a purple ball. The dial shows “holes” for where to place the balls.These tasks Hedda did with no problem. The red ball is placed where the hour hand should be, and the purple ball is placed where the minute hand should point. Next up there is four tasks where you pick one of three clocks. Choose the correct watch based on what time you are told, here it soon became much more difficult for Hedda because she must be able understand the clock to do it. The movie clip does explain it, but it was hard to get the 5-year-old girl to both watch and learn :) The last four tasks on the level was there Hedda almost gave up because  according to a time you are told you must move both the long and short hand to the given time on the dial, we ended up with 0 stars in this task, so we took a second look at movie clips, but it was still difficult because the counting knowledge is still not at 100%

The third  level, you set the time quarter to and  quarter past and on the fourth level you set the time in 5 minutes intervals. The fifth is where you learn minutes and where you need to be able to count to 60. The levels follow the same template for tasks as for level 2,  but when you get to five minutes, and 1-minute you get more choices, which makes it even more difficult.

When you have completed all levels you are awarded a diploma. The diploma can be stored as an image and/or shared on Facebook. Curious since according to the user guidelines of Facebook none in the target audience for the game is allowed to own a Facebook profile…

Another nice feature is that the game have an option to reset if you wish. Either once or every time you start the game.

All in all I think it’s a good, educational game, but think that the ideal age for most will be around 6-8 years old. I also let my 10-year-old son Sebastian test the game, but both he and I soon discovered that he was too old for this. Hedda is still playing and think its great fun. Sometimes I help her a bit and she learns a bit more about the time every time she plays. She still doesn’t to watch movie clips :)

Mingoville’s game is available in the Apple AppStore for English , Danish , Swedish ,Norwegian , French and italian . There is also the English and Danish app for Android web board / phones in Google Play. More languages ​​are on the way so you can visit the game page for updates. The game also works on iPhone and Android smartphones, but I’ve only tested the iPad edition.

Use Facebook to Comment on this Post

Posted in AppsComments (0)