Be Tv future

May 7th, 2009

With version 1.1 being available in the App Store for more than a week now, it’s time to look ahead. The update has received some very positive reviews mainly because it fixed some of the issues users had with Be Tv, like localization. By the way, as of today Be Tv has been downloaded more than 16.000 times, thanks everyone!

As for version 1.2 there are 3 main features which are in my opinion the most critical. Being: offline usage (caching), the ability to reorder channels (favorites) and the addition of program details. Although I can’t confirm if all three will make it in version 1.2.

While I have been working on these features secretly, there is something more important that needs to get done first. And that is finding a new partner to supply the information, enabling us to ensure the availability of the data. Currently Be Tv does not include program details, simply because our current partner does not provide this data. But this will hopefully be solved soon.

If you know someone who might be able to help Emmer Inc with this, be sure to leave a comment or send a mail using the in-app mail button.

Caching using WCF REST Starter Kit in Medium Trust

April 26th, 2009

Caching is one of the features provided by the WCF REST Starter Kit released by Microsoft at CodePlex. Jesus Rodriguez has written a walkthrough on how to get it running. The kit was designed to run under Medium Trust, but if you want to use caching in this trust level, you’ll have to configure it a bit differently.

System.Security.SecurityException: Request for the permission of type ‘System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ failed.

Using Jesus’ approach you’ll be greated by a nice Security Exception, for some reason you can’t configure the caching in the Web.Config in Medium Trust. Luckily you can add all the caching configuration as attributes to your method. You’ll have to remove the <caching> block from the Web.Config, but leave the aspNetCompatibilityEnabled tag enabled! Here’s an example:

Instead of using this XML configuration:

<caching>
   <outputCacheSettings>
      <outputCacheProfiles>
         <clear/>
         <add name="SampleProfile" duration="30" enabled="true" location="Any" />
      </outputCacheProfiles>
   </outputCacheSettings>
</caching>

We add these attributes, unfortunately you’ll have to add these attributes to every method you’d like to cache. There are more attributes available, you can see them using the IntelliSense, but this configuration mimics the XML config.

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class SampleService : ISampleService
{
   [WebGet(UriTemplate= "/results")]
   [WebCache(Duration=30, Location=OutputCacheLocation.Any)]
   public Atom10FeedFormatter GetData()
   {
      ...
   }
}

Note: Tested in the ASP.NET Development Server provided by Visual Studio 2008 SP1. The OutputCacheLocation enum is located in the System.Web.UI namespace.

Facebook like loading indicator

April 25th, 2009

When performing an action that may take some time, it’s advised to show something to signal that the operation is being performed & the application is not crashing. Here’s an example on how to accomplish a loading indicator as used in the iPhone Facebook application.

Loading View

First we’ll create the actual loading view, let’s add an empty XIB to our Xcode project called LoadingView. Add a UIView to the nib and drag a UIImageView onto it. Use a vector program like Inkscape to create a black rectangle with rounded corners. Use a UILabel and a UIActivityIndicator to create something like the screenshot to the right. Be sure to check the animating property of the activity indicator and change the alpha of the root view to 0.8 for intance, since we want the view to be slightly transparant.

Once we’ve made the actual view, it’s time to show it.

- (UIView*)newLoadingView {
   NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"LoadingView" owner:self options:nil];
 
   NSEnumerator *enumerator = [nib objectEnumerator];
   id object;
 
   while ((object = [enumerator nextObject])) {
      if ([object isMemberOfClass:[UIView class]]) {
         return object;
      }
   }
 
   return nil;
}
 
- (void)doWork {
   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
   // Add lenghty operation.
 
   [loadingView removeFromSuperview];
   [pool release];
}
 
- (void)someMethod {
   loadingView = [self newLoadingView];
   loadingView.center = CGPointMake(160, 350);
   [self.view addSubview:loadingView];
 
   [NSThread detachNewThreadSelector:@selector(doWork) toTarget:self withObject:nil ];
}

We’re using the newLoadingView: method to retrieve the view from the nib, the reason we’re looping through the contents of the nib is one cannot garantee the order in which items are retrieved will always be the same. For instance the index of the loading view will be different in firmware version 2.0 and 2.1. We retrieve a UIView item, in this case the loading view, since it’s the only UIView in the nib. I’m sure this code could be improved though, using your own derived UIView and checking for this derived class would be better. The center property of the loading view can be used to position the view, the top left corner has coordinates 0,0. (If anyone has a better method of getting a specific view from a nib, do tell)

The someMethod method is the one to call to start everything, this method will show the actual loading view and start the doWork method on a seperate thread. The reason we’re using a seperate thread is not to lock up the interface, otherwise the interface would freeze while the lenghty operation would be performed. The doWork method hides the loading view once everything is done.

Extension: The above code has one disadvantage, when using a tab controller the loading view will disappear once another tab is selected, returning to the original tab will show the loading view again though. In some cases this behaviour isn’t wanted, how do we solve this? Instead of showing the loading view on top of the content view displayed by the tab controller, we’ll show it on top of all the views, on top of the tab controller.

// Show loading view on top of everything
[[UIApplication sharedApplication].keyWindow addSubview:loadingView];

And that’s all there is to it.

Update: here’s the correct method to load a view from a separate nib file.

Localizing Localizable.strings woes

April 22nd, 2009

While localizing the Localizable.strings file of Be Tv I encountered a rather curious (mis)behaviour. I used the NSLocalizedString macro wherever I needed to get my localized text and used the genstring command to generate the Localizable.strings file. I made a dutch and french localization of this file and everything was working in the iPhone simulator. Nonetheless when deployed to my test device, the localization was not working. Localized nib files were though.

After fiddling with some Xcode settings, I gave up and resorted to Googling. Luckily I found this blog post, describing the exact same problem, giving an explanation why & providing a solution. Turns out the localized Localizable.strings file has the wrong encoding, UTF-8 instead of UTF-16. Change the encoding, do a clean rebuild and your localization is up & running.

To change the file’s encoding to UTF-16 from UTF-8, use ‘View’ –> ‘Text’ –> ‘File Encoding’ in XCode menu.

Credits go to Cagan Senturk.

Be Tv in De Morgen

April 16th, 2009

On Tuesday the 14th of April the Belgian newspaper De Morgen listed Be Tv as one of the 5 essential iPhone applications. Here’s a scan of the article, they did spell Be Tv wrong though. It was published on page 8 next to a larger article dedicated to the the billionth download in the App Store.

It’s nice to see how good Be Tv is doing, more than 11.000 downloads in the first 2 weeks. In the mean time, development of version 1.1 has entered the final stages.

Be Tv De Morgen

Thanks to Jan Vantomme for letting me know.

Update: the full page can be found here.

Be Tv launch statistics

April 12th, 2009

Now that Be Tv has been launched more than a week ago, I thought it would be interesting to publish some statistics regarding Be Tv. I’ve taken the first 8 days as data for the statistics from the launch date (2 April 2009) to 9 April 2009. Be Tv was downloaded 7.836 times in this period and was launched a little over 24.000 times.

Be Tv ranked 11th after only 430 downloads, 7th after 759 downloads, 5th after 1057 downloads, this was in the first 24 hours after the iPhoneclub.nl article. The number 1 spot was reached by the 6th of April after a little over 4.000 downloads.

Downloads

Another interesting statistic was the ratio iPhones vs iPod Touches, I somehow anticipated more iPod Touches than iPhones, since they have been introduced a lot earlier than the iPhones. The firmware graph is pretty predictable, firmware versions older than 2.1 we’re negligible (44 devices in total) and to my surprise there are some developers who are already running 3.0 on their (main) devices.

Models
Firmware versions

Be Tv remained 6 days at the number 1 spot and is at the time of writing (12th of April) still the number 1 in the free entertainment list.

Be Tv version 1.1 roadmap

April 5th, 2009

Now that Be Tv has been in the App Store for 3 days, it’s time to stop dreaming and start working on the next version. Although I haven’t been doing nothing, there’s quite a lot of PR work involved and supporting tasks to keep everything up & running. I’ve received numerous requests for new features and thought I should make my short term plan of attack known. Two issues kept coming back in the requests and I think it’s best to tackle these first before starting on some bigger features.

Version 1.1:

  • Localized interface: users who have set the interface language of their iPhones to Dutch or French will see Be Tv in the corresponding language. I didn’t think the English interface would get so many complaints.
  • French speaking Belgian channels: lots of (french speaking) people pointed out these were missing and with reason I must admit. La Une, La Deux, RTL TVI & CLUB RTL will be added.
  • Highlight current program in today detail: when opening the today detail the table should scroll down to the current program. This one isn’t as major as the first 2 issues, but it will add a lot to the usability.

These issues shouldn’t take too long to implement and they’ll make a lot of people happy. I’ve added a dutch and french summary in the App Store in the mean time, which should show up any time now.

There you have it, I hope you like it!

Be Tv ranked at #49

April 3rd, 2009

Who would have thought, after almost 6 hours of exposure on iPhoneclub, Be Tv is ranked at position 49 in the “Top Free” list of the Belgian App Store. Be Tv has received some great comments via various channels ranging from regular e-mail, Twitter replies, comments on this blog, comments on iPhoneclub, to normal App Store reviews.

At the moment Be Tv is being downloaded at a rate of a little over 1 download per minute (75 per hour to be more precise) and Be Tv is being fired up at double that rate, slightly less than twice per minute. Totaling 350 downloads in less than 6 hours, landing us on spot number 49! The server providing the schedules is holding up quite nicely, despite being hammered a bit. The launch has been quite hectic (no crashes though), due to all sorts of PR-stuff, but it has been (& still is) great fun!

Be Tv ranked at #49

I’d like to thank everyone for their positive comments & I’ll try to review every feature-request and see if it’s feasible in an upcoming release.

Update: as of this morning (3rd of April) Be Tv is ranked at #11!

 

Be Tv version 1 released

April 2nd, 2009

Be Tv logoIt has finally happened, Be Tv has been approved and can be downloaded in the Belgian App Store. After being in development & testing for almost 2 months, it was time to submit version 1 to Apple. I still have lots of stuff I want to add or change, but otherwise it would never hit the App Store. It took Apple a week to approve it, but it was worth the wait. Depending on the reception of Be Tv I might make it available in the Dutch App Store too.

The new Emmer Inc website has been launched as well and for being a developer, I think it turned out ok. As for Be Tv, I’d love to hear what you guys think of it in the comments.

See you in the App Store.

Codesign failed with exit code 1

March 26th, 2009

While building the final 1.0 product of Be Tv, I encountered the following error: “Command /usr/bin/codesign failed with exit code 1″. Searching the internet resulted in some posts with tips like check your certificates & provisioning profiles, check your app id for typos, .. After going through the whole distribution process, I was pretty sure that the aforementioned things were ok.

Eventually I found what caused the error, I had flagged the Info.plist file as Target, thinking it was necessary. (The checkbox at the far right) Unchecking it (which is the default state) solved it. When faced with the dreadful codesign error, here’s something extra you can check.