Finding a memory leak with Xcode 4 Instruments

25 May
25/05/2011

Over at the fantastic Facebook iOS Developers group, we had a discussion yielding 40+ comments about a memory leak and how to detect it with Instruments.

I’ve created a brief screen cast based on the discussion we were having. While it actually shows pretty basic Instruments stuff, I still find even experienced devs struggling with the details.

Follow me on Twitter (@24z) for mostly iOS related tweets and if you’re not yet a member, join the tribe on Facebook.


Ignore ringtone mute switch during MPMoviePlayer video playback in iOS

24 May
24/05/2011

Recently I stumbled across an issue in one of the apps we are creating over at GrandCentrix: When playing back video using the MPMoviePlayer framework, the ringtone mute switch switches off all audio.

This default behavior is significantly different from the one iOS users learned from the built-in YouTube app.

Worse: If users start video playback with the mute switch turned on, they might believe they’ve got a faulty signal, as they won’t here any audio right from the beginning.

Turns out, it’s easy to fix:

[obj-c title=”Ignore the ringtone mute switch”]

– (void)viewDidLoad {
[super viewDidLoad];
NSURL *url = [NSURL URLWithString:@"http://cdn.grandcentrix.net/video/ios/stream.m3u8"];
MPMoviePlayerViewController *moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:url];

NSError *_error = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &_error];

[self.view addSubview:moviePlayerViewController.view];
}

[/obj-c]

Note that you have to add the AVFoundation framework to your project. In Xcode 4 to add a framework select the topmost node in the Project Navigator, select your Target, click Build Phases and hit the little + icon.

Adding Framework in Xcode 4

This and more tips frequently get discussed over at the great iOS Developers Group on Facebook. If you’re on Twitter, follow me (@24z) for mostly iOS related tweets!


How to not get fooled by a social media expert con artist

14 May
14/05/2011

I live in Germany.

We are not exactly known for being a social media friendly country.

Some rightfully call us Blurmany, since our not-so-tech-savvy government forced Google into pixelating Street View images on home owners’ requests.

Also, we usually come a bit late to the Web 2.0 game, while letting Silicon Valley take the lead.

Lately, I noticed a disturbing trend in the timelines of my various social media outlets: More and more German Social Media Experts pop up out of nowhere.

While I strongly believe that given the pretty short history of the Open Social Web, nobody really qualifies to hold an “expert” title just yet, it’s interesting to see how many folks are bluntly trying to jump on the bandwagon.

Sure, there’s money to be made. Companies strive to invest their dollars into seemingly new holy grails. Advisers have been living from riding on trends for decades. Hence the Social Media Expert boom.

Fortunately, there’s one subtle difference this time.

Social Media is largely driven by transparency and the public availability of data. It’s way easier to verify, whether somebody trying to teach you, actually has a track record in the art of social media or just pretends.

In this article, I try to give some by no means expert tips, that hopefully help you to unmask your next Social Media Expert con artist. For the sake of brevity, I call them SMECAs for the remainder of the post.

1. Check out whether your SMECA believes Social Media equals Facebook

Oddly enough, I found many SMECAs confusing social media with just Facebook.

Strictly speaking, Facebook isn’t even a media outlet. It’s the largest social network in the world. It might turn out to be a great source for learning about behavioral targeting. And finding out whether people actually want targeted ads and offers. Early studies show, they might not!

But Facebook is not the only important player in the game.

So, if you find a SMECA talking 99% of his time about just Facebook, ask him about his experience on Twitter, Quora, Foursquare, Buzz, Digg, StumbleUpon, Amplify and others. While you’re doing so, ask for links to his profiles on these services.

If it turns out he’s not present over there, he might be an avid Facebook user, but unfortunately doesn’t have a clue about Social Media.

2. Check out your SMECA’s history

Things on the web move fast.

I’ve seen SMECAs being almost inactive on Facebook and Twitter for years and literally becoming hyper active when they wanted to get into the Social Media Expert business.

Now, you don’t become social overnight.

Social is all about building and maintaining relationships. It’s about long-term commitments and leveraging valuable networks. It takes time.

Unfortunately, Facebook does not provide an overview about a users activity over time. Try this: Visit the profile of your SMECA and switch to her or his Wall. Click on the little link named “Older posts” at the bottom of the News Feed. Click again and again. You’re moving back in time within the News Feed.

If you reach the beginning of his social media lifeline within less than 20 clicks, he’s a newbie. And maybe can learn about Social Media from you. But should never pretend being able to consult. We also don’t trust our businesses to first-graders.

Also, if you recognize that large parts of the older timeline comprise just so called mini-activities but at a certain point in the not so recent history, you see a sudden spike in daily posts – mostly sharing links from Washington Post and the likes – you likely talk to somebody who just got into the game. As he likely missed the impact of Social media for months and years, how good are the odds, he can help you develop a successful strategy?

Thanks got, it’s not easy to pretend a long standing history in Social Media. Even if hiring an expert PR person for the topic, aggressively pushing out messages on ones behalf, Twitter and Facebook timestamp every move. If you haven’t been part of the Social Web for long, this will remain pretty obvious.

3. Check out whether your SMECA actively participates in the Social Web

I’ve said this before: If your SMECA just lives on Facebook, drop him immediately.

Ask for a link to his Twitter profile. Check his followers, not only the total number but also who is following him. Do you find familiar experts like @scobleizer and @chrismessina following back your expert? These folks usually don’t easily follow everybody. Also, check the Twitter lists your SMECA is on.

While the total number of Twitter followers is not a straight indicator for Social Media expertise, in Germany if you’re having less than 1.500 followers, this usually means, you’re watching the game, but not driving it. Simply speaking, the expert voice you’re having doesn’t seem to attract a great enough entourage.

If your SMECA – for whatever weird reason he might give – is not present on Twitter or inactive, drop him immediately. He’s gotta go back to school.

The next thing you might want to check, is her or his blog.

The Social Web is one of the hottest topics in tech these days. Blogs still play a vital role. In fact, they are the most linked-to content sources on Social Networks. Real Social Media Experts usually have a lot to say. And they are eagerly sharing their thoughts. Not just by quoting Washington Post, but by voicing their own ideas.

Thus, almost every Social Media Experts maintains a personal blog.

If your SMECA states, content creation is not his specialty, or hides behind a huge multi-author company blog, invite him for dinner, but don’t ask for advice.

This post got longer than initially planned. I hope the next time, a Social Media Expert approaches you, you’re prepared to ask some key questions.

What’s your experience? Have you seen folks in your network trying to participate from the hype, lately? Do you have anything, I might want to add to this list? Feel free to voice yourself in the comments!


My two favorite Google I/O 2011 announcements and some other observations

13 May
13/05/2011

Like many of my friends, I’ve been following Google I/O 2011 curiously earlier this week.

Much has been said about the event, but I cannot resist to add my thoughts about a few of the announcements and Google I/O in general.

Blocking non-US developers is evil (and certainly not open)

When the keynote address started, I was surprised to find Google blocking the live video stream for anybody outside the US. The fasted VPN tunnel provider in the world solved it for me, but I really wonder why Google thought that Google I/O would only be valuable for the Northern American Android developers.

Me being in Germany, for Google I must live in a very fragmented part of the world.

Google Music – not interested

I might very well have been one of the first to request an invite for Google’s new cloud music service, as I accidentally stumbled over the invite link even prior to the announcement, but haven’t heard back from Google since. Not a single word.

And today, I’m not even interested anymore.

Pretty much anybody seems to agree, that Google Music will be just another big fail. Unfortunately, we’ve seen many of those coming out of Mountain View lately.

It’s not only me who doesn’t get how forcing users to first download music from a third party and then asking them to upload everything back to Google should have any advantage over what cloud storage providers like Dropbox have been giving us for years.

So, I’ll sit and wait for Apple. Very likely, they will get it right, again.

The Android Anti-Fragmentation Alliance

It’s not its real name. I made this one up.

Anyway, probably the single most important announcement for me – apart from remote controllable light-bulbs – was the foundation of the Android Anti-Fragmentation Alliance.

Verizon, HTC, Samsung, Sprint, Sony Ericsson, LG, T-Mobile, Vodafone, Motorola, and AT&T joined a special task force promising customers to bring updates to devices quickly and efficiently at least for the first 18 months after the initial release.

I have no details as to how this alliance is formally structured. It’s also difficult to imagine what sort of pressure (and how) Google could potentially put on any of its members, in case of not fulfilling the promise. Given the open nature of the Android ecosystem it’s hard to really see this working.

However, at least this broadly acknowledges the biggest problem in Android: fragmentation. And it offers a neat solution. Whether it’ll work out, remains to be seen.

My Motorola Xoom is still eagerly awaiting Honeycomb 3.1…

The Google Places API, now open for everybody

I’m a developer at heart.

Opening up the Google Places API for the mainstream developer was the single most valuable development related announcement for me. This means, web and mobile developers are now able to not only leverage Facebook Places but also seamlessly integrate Google Places into their experiences.

Facebook Places has been available a bit longer via the Open Graph API and I’ve been using it to offer users faster input in many iOS applications.

Also I very much appreciate that Google not only opened the basic Places API, but also took care for the auto completion part. The latter one facilitates the integration of nice text fields with speedy suggestions with almost no code.

I got so excited, I wrote an iOS prototype the same day.

Planning to publish the tutorial and sample code here later today.

Apart from that, too much “in a few weeks” and pseudo exciting stuff for me

Besides that, I’m pretty much disappointed.

When I wanted to learn about “Android Market for Developers” this morning, I found the Google Mobile Blog being down. Or at least the link on google.com/io no longer working:

I like the spirit of “beta” but not if all beta means simply is: down.

While one might not like Apple’s secretiveness, usually when Apple announces stuff during these sorts of events, it becomes immediately available. After all, that’s what a developer event is for: Get us excited, get the stuff into our hands! Or?

For me, this year’s Google I/O had way too much announcements that got me excited the first place, only to find out that it’ll not be available for the next few weeks. Or US only.

Honeycomb 3.1 being a pretty good example. I get tired of asking my Xoom to check for updates, just to get disappointed day after day. The lack of a clearly communicated roll-out plan does not help either. And no word about Android 3.x becoming Open Source.

Also there were too many things I found pseudo exciting.

While my respected friend Robert Scoble seems to like them, Android remote controlled light bulbs that might be available at the end of the year, didn’t really click with me.

Home Automation has been a pretty hot topic here in Germany for quite a while. We already struggle from fragmentation in that area, too. Adding another standard to Z-wave, Zigbee and the likes might not make things better.

Taking into account how Google TV (last year’s big Google I/O announcement) totally flopped, I don’t have great hopes for Android Home.

Overall, I disliked more parts of the keynote than I liked.

Hugo Barra carried it out a bit too wanna-be-cool for my taste.

At the point where he’d mentioned “and all without a single cable” the fifth time, the obvious attempt to shoot at Apple really got on my nerves. After all, Google doesn’t even have an online music store. Dismissing the amazing success of the iTunes ecosystem doesn’t do any good.

It gets worse, when you come up with something as terrible and not thought through as Google Music.

I’d love to see Google focus more on existing products

Closing this article off, I’d like to make clear that I’m not a Google hater. Not at all.

I do love Apple. Not for their business ethics. Not for many things. But ultimately for their ability to focus on their products and making things right. In an era where everything is beta, and beta almost seems to become a quality certificate, I in fact love Apple and if it’s only for not bothering me with beta quality products, but putting the user at the center of everything. Not the geek. Not the tech blogger.

In fact, I personally am an avid Gmail user and have two Google Enterprise Apps accounts. My  company heavily relies on Google Docs.

It disappoints me even more, that there hardly seems any innovation in that area. Or at least nothing worth talking about at Google I/O.

I still can’t check out with my Google Enterprise Apps account, but have to keep Gmail for that.

There are many other services, that have not been transitioned for paying Google customers either. They killed Wave. Google Profiles only work with Gmail accounts. The list goes on and on.

Remote controlling my fridge from an Android device might be good for getting a laugh in front of a large audience, but it doesn’t add a lot to the value of the Google products most people use every day.

My hopes are out for Google I/O 2012. I hope the company will find back to its strength.

Now continuing to wait for Android updates to be rolled out to the fragmented part of the planet, I’m living in.


Missing the YouTube app on your Xoom?

10 Apr
10/04/2011

If you happen to be one of the first to own a Motorola Xoom, chances are, you’re running into an issue where the native YouTube app is not available.

As of this writing, the Xoom is the only tablet that runs Google’s shiny new Android 3.0 for tablets, codenamed “Honeycomb”.

Given that Motorola and Google demoed this exact YouTube app as a proof of Honeycomb’s great new capabilities, it is extremely unfortunate, that there seems to be an increasing issue with the app not showing up on freshly unboxed Xooms.

While I absolutely love my iPad 2, my professional life sort of forces me to play with the Xoom, too.

I admit, Honeycomb is not all that bad. There are almost no apps, yet, but overall I’m surprised by its performance, pleasant animations and smooth operation.

The YouTube bug is plain annoying.

As is the total silence from Google’s and Motorola’s side. This problem has been reported by hundreds of users since the Xoom launched. It should have been commented about and addressed by now. Well, there’s still a lot to learn from Apple. Certainly, just “being open” is not enough.

After digging for almost six hours, I found a non-official fix, the exact steps are available over at The Next Web.

Hope it might help other disappointed Xoom early adopters.


Misa Textures for Minecraft 1.4 Beta

01 Apr
01/04/2011

If you haven’t been living under a rock and like casual gaming, you might be a Minecraft player, too.

Recently, the game got updated to version 1.4.

Now, the build-in textures are pretty basic. That’s why many players patch their Minecraft binaries to run with Misa’s 64 HD textures, a third party texture pack that is not officially supported, but greatly enhances the game.

These textures have not been created by myself. I’m just a regular Minecraft user loving the work and effort Misa has put into these. So, full credits go out to Misa!

The community forums over at Minecraft can get pretty spamy with now well over six million registered players, so I’ve taken the liberty to provide direct access to the texture pack and the tool to patch Minecraft 1.4 (Windows/Mac).

I provide a mirror to the files for free, as a courtesy to the Minecraft community. I found the original links to be quite unstable under heavy load.

Installation instructions outlined here are still valid. (This links back to Misa’s original thread, which gets updated whenever a new version gets releases. So check it out frequently!)

I hope you enjoy it! If you do, why don’t you hit the little tweet button at the top of this post, or like it on facebook (below)?

 


iPad 2, speedy and just beautiful in white!

26 Mar
26/03/2011

In June 2009, over at TheNextWeb, I talked about how different the iPhone 3GS felt compared to its predecessor. The post was titled “It’s all about Speed: My first weekend with the new iPhone 3GS”.

Yesterday, the second iteration of Apple’s magic tablet launched in Germany and 24 additional countries.

And boy has it been a success for Apple!

A Google search for “iPad 2 sold out” yields 1.2 million results. I (successfully) queued in front of the Apple Store in Oberhausen where the staff had to send away more than 1.000 customers as they completely sold out within an hour and a half. Here is a short YouTube video showing the moments before the re-opening.

As many of my readers know, I’m one of the founders of Germany’s largest iOS development companies. I sort of have to always get the latest Apple gadgets. Not that I regret – of course.

Beautifully white

When I departed for the Apple Store, I planned to grab two black 64 GB WiFi + 3G models. Those sold out within the first 30 minutes. I was left with two white ones.

Prior to having the white model in my own hands, I was pretty biased that I wouldn’t like it. Many have stated the black bezel around the screen would make it feel larger to the human eye, so a white model would feel too small.

None of this is true.

I have to say that after spending a few hours with it, I even start to like the white model over the black one. As we expect from Cupertino, the white is a very elegant, glassy and stylish white. It’s not a cheap-crappy-plastic-white as we see it way too often in consumer electronics these days.

Now, I’m mostly using the device for media consumption.

Tons of US TV Series, kindle books and discovering stuff on the Web. As a consequence, I naturally use the iPad in many different living situations, places and even in bed. That’s where another advantage comes into play:

The white model simply blends in better.

It’s difficult to describe. It’s one of these subconscious subtle little differences that just feels better. But you have to experience it yourself.

All I can say is, if you’ve made your decision for a black model, make sure you play a while with the white one in an Apple Store nearby. As it happened to me, you might fall in love with white.

So speedy

I have to admit, I don’t care about the two cameras added to the iPad. FaceTiming with my family members is fun on the iPad 2 but I hardly ever FaceTime, anyway. You might wonder, if it’s not for the cameras, why go for an iPad 2 at all?

Well, almost two years after the iPhone 3GS I experienced a deja-vu:

Clearly, the performance boost is the key feature for me and the more I’ve used various apps on the iPad 2, the deeper the overall impact on my happiness. (I’ve written this exact last sentence two years ago, too, and today it is more true than ever.)

I am aware of folks who couldn’t wait to hooke the iPad 2 up to benchmark suites just to find out it’s not that much better in terms of pure technical specs. But I don’t care. There’s likely not a single consumer running benchmark apps anyway.

It’s the experience that counts. And the experience is dramatically better on the iPad 2.

Along with the new multitasking gestures introduces with iOS 4.3, the iPad 2 now switches between apps blisteringly fast. There’s hardly any recognizable moment anymore when you foreground your apps.

So lightweight

Another interesting area: Though the iPad 2 has only up to 100 grams less in weight (depending on the model), it feels significantly more lightweight. And I have to reiterate: It’s the experience that counts. Not tech specs. Consumers touch and feel – and decide.

I never had an issue with the weight of the original iPad, not even after hours of reading ebooks. But the much improved iPad 2 form factor is a very welcome addition.

Do I recommend an upgrade? Absolutely yes!

If you do use your iPad regularly, upgrade as soon as possible. You won’t regret it.

If you bought into the initial hype but found yourself not really being an ebook person, you don’t watch great movies and tv series while you’re traveling or love the many great social media apps available for the platform, you might stay with your original iPad.

There’s one more thing I generally like about Apple products:

Hardly any other consumer electronics product in the market, has such stable second market prices even after a successor has been announced. I was able to sell my used original iPad for 500 Euros, effectively bringing down the cost for the new one to 299 Euros.

My lady keeps her original iPad for a while until it moves to our own little Apple Museum and I will be forced to get a second white iPad 2.


TestFlight and In House / Enterprise IPA support

24 Mar
24/03/2011

If you’re an iOS developer and haven’t been living under a rock, you might already love TestFlight.

In short, TestFlight dramatically simplifies the entire process of sending out test builds to your customers, partners and colleagues. Not only that, it also provides fantastic means of tracking installs and collecting feedback. If you really do not use TestFlight, yet, hop over now and register. It’s free.

One question, that I’ve seen asked many times is, whether TestFlight supports Enterprise builds. Quick answer: Not yet. It’s comming.

A little bit of background: Apple supports two kinds of iOS Developer Programs, Standard and Enterprise.

As a member of the Standard program, in order to distribute beta builds, you have to create Ad Hoc profiles and digitally sign your binaries with it. This ties the binary to a limited number of devices, identified by their unique IDs.

In addition to Ad Hoc code signing, the Enterprise program gives you In House profiles. Other than Ad Hoc, In House profiles are not tied to specific devices. Everybody who can get a hold of an In House signed binary, can install it. The device doesn’t need to be known upfront.

Currently, TestFlight is optimized for handling Ad Hoc builds, only. When you try to upload an In House signed build, you get this little message:

I’ve reached out to the folks at TestFlight and asked for a specific date. Haven’t heard back, yet. Once I get the info, I’ll update this post.


iOS 4.3 Personal Hotspot with T-Mobile Germany

10 Mar
10/03/2011

When iOS 4.3 officially came out yesterday, my iPhone 4 told me, I should contact Telekom.de to enable the (long awaited) Personal Hotspot feature.

Twitter and Facebook were full of German customers complaining that T-Mobile’s Service Centers didn’t have any up-to-date information on how to enable the feature. Being quite a heavy mobile user, I’m a member of T-Mobile’s Diamond customer group. I called them today and got an immediate response.

A minute after the call, I was able to start using Personal Hotspot.

Here is the deal: If you are on an “old” T-Mobile iPhone contract, tethering – which is the tech terminology for sharing your mobile Internet connection with other devices – was not included.

I was offered to switch from my old Complete XL contract into the new Complete Mobile XL version.

Now, when you do that, you gain tethering. But you also lose stuff. First your included monthly 3G bandwidth is reduced from 5 GB to 1 GB. Once you’ve used the 1 GB, the data connection speed gets throttled. Second, you no longer have free MMS included.

However, to circumvent the new limitation, you can add the Speed Option. This will bring back the monthly 5 GB data volume. At the same time, it’ll increase the speed to 21,6 Mbit/s as opposed to the 14,4 Mbit/s that your old Complete XL tariff gave you. The iPhone 4 hardware can only handle 7,2 Mbit/s anyway, but that might change with the iPhone 5.

The 3000 free SMS per month are included in the new contract, as well.

The Speed Option is available for 9,95 Euro per month. If you don’t want a new iPhone 4, Complete Mobile XL is available for 89,95 Euro in case you’re extending your contract.

You can change your tariff by giving a call to T-Mobile’s Service Center (2202 from your T-Mobile phone when you’re in Germany). Personal Hotspot will be available a few minutes after your call.

 


Calling all iOS devs: Join our Facebook group!

08 Mar
08/03/2011

This is a pretty short post.

A couple of months ago, on the day Facebook introduced its new Groups, I’ve started the iOS Developers community over there.

For me, it has now become a very valuable source to get in touch with fellow iOS developer peers from all over the world. We’ve also started to craft a couple of documents, pointing to open source frameworks and other resources that make our daily Objective-C lives easier.

Some folks messaged me that they don’t consider Facebook anything serious and pointed me to Apple’s Developer Forums and other existing sources.

And while I appreciate those other places – and use many of them myself – I still think it’s a good thing to connect with other iOS devs via Facebook. Seeing new tricks as part of my Facebook timeline has proven valuable more than once.

As many of my friends, I don’t strictly separate my professional from my private life. I love what I do for a living and both worlds are pretty much intertwined. I consider this a great privilege!

So without further ado and in sort of a blunt self promotion, if you’re in iOS development, why don’t you join our great community on Facebook?