Apr 15, 2010
For some reason Apple reserves the ability to create iPhone frameworks for their own use. They are a very useful ability to have because they package headers together with a universal binary. „Universal“ meaning that you get binary code for multiple platforms rolled into a single file. Frameworks are also dynamically loaded which means that less binary code fills up your memory as only stuff is put there that is actually needed.
But alas, no frameworks for us.
Until now I am selling my components in the Dr. Touch’s Parts Store as source code which at the same time means that I could not provide demonstration versions to try out in your own code. If you have the code, what incentive is there to pay the price?
It has been suggested to me by several people independently to make a static library to solve this problem. Could be time- or otherwise limited, but then people could try the parts out and see how well they fit with their own work.
Also next to still offering access to my repositories at full price, I could be selling indidual versions without right to upgrade to get started at a substantial discount. Later if you find that the component really IS worth what I am asking for, you could upgrade to the lifetime upgrade plan via the SVN repo.
Another reason to figure out this Static Library Magic is so that I can bundle my own utility classes that I keep adding to and improving in a central place. This gives me the choice of adding an external SVN reference or to simply copy the static library into my new projects.
In this article I am describing how to create a universal static library for both Intel and Arm architectures, how to glue them together into a single file and how to add it to a new demo project.
Apr 13, 2010
I’ve been approached by several parties asking for a component to capture live video. I did my homework but had to find that without access to a hardware-based video encoder it is not possible to get real time frame rates on iPhones.
Interviewing the maker of the ShowTime Video Recorder app for iPhone 2G and 3G enlightened me a bit as to what tricks they used to pull off their app. They use AVI containers for JPEG frames and PCM audio. Other people seem to have a bit of success with compiling FFMPEG on the iPhone. But generally MPEG4 does not use less CPU power than encoding JPEGs, it uses MORE, causing even worse frame rates for live video.
And that’s ignoring the licensing problems you get when selling an app that has a h.264 encoder. A double-whammy in non-feasability for FFMPEG, all the more reason to find out the truth of the matter.
So we set out to build DTVideoEncoder to see for ourselves what kind of performance we can get. Unfortunately it turns out that even on a 3GS we are getting a maximum frame rate of 5 frames per second when encoding live screenshots. Polar Bear Farm hinted that they are only able to get their performance (of around 6 fps) because of heavy assembly-optimizing the JPEG compression library . But they communicated a disinterest in licensing it for us to put into a sellable component.
So we were stuck. Until actually somebody told us that instead of live video encoding he just wanted to add JPEG files to an AVI container plus audio. Because the JPEG files where already compressed he would not face the bottleneck of JPEG compression. Suddenly this specific use case reinvigorated the project.
Kris Harris – maker of the 8 Track Mind iPhone game – went back into the depths of the AVI documentation and polished up DTVideoEncoder to be usable for offline encoding and added the requested capability of adding an existing PCM audio file as soundtrack. Kris is a great developer and his code is awesome, I’m glad to have him on my Dr. Touch Core Team.
Here’s a demonstration of the Demo app that you get with the component.
DTVideoEncoder does not have any external dependencies. Because the external JPEG compression library did not yield any performance improvement over what’s built into the SDK we chose to go with the on-board method.
Hours and hours worth of research and coding went into in this simple to use component to warrant a price tag of several hundred dollars. But because of the limited utility we we set the price to the lower end of the spectrum, at 250 Euros. It might enable one or more interesting uses of offline-video on iPhone or iPad.
Podcast: Download (720.9KB)
Apr 07, 2010
A friend/coachee of mine teased me with a picture showing him in loving embrace with this new iPad. I will be a couple more weeks until I can actually purchase one for myself. So I figured, I would want to give several developers that read my tweets and blog articles a change to show off their new iDevice as well.
We Europeans have a bit more waiting time, especially guys from smaller countries who want the iPad just the same, but have to bear Apple’s worldwide rationing of iPads due to initial touch panel shortage.
Stefan Sorin Nicolin, from Spielhaus FTW, illustrates for us the general mood amongst non-US-would-like-to-be-iPad-developers. He still has to imagine their famous Today ToDo app running on the shiny thing.
But for some the motto of this article is the opposite …
Smile! You’re Actually Holding an iPad!*
* …and are ENVIED by most of the rest of the world
Apr 03, 2010
Having some contact with developers around the globe allows me (and by extension YOU, my dear reader) a glimpse of what kind of apps are going to become available with the iPad on April 3rd. More importantly, we can ask those busy developers – who struggled to be first in the launch line-up – what they thought were the difficult steps in designing and building iPad apps.
Being the good soldiers that we are, we let them have the glory from being first while being able to learn from the problems that the one or other Apple mine would have caused them. Maybe this way we can save ourselves some grief and frustration if we can avoid their mistakes from the get go.
So here are 5 of the first iPad apps and what their developers learned from making them.
Mar 28, 2010
I’ll be OOO during the next two weeks. I’m conducting an iPhone programming course for Vienna based Training company NOW Training.
The first day already occurred last Friday and I so far all participants seem really happy with my style of introducing them into the wild world of OOP with Objective-C.
I’ll be checking my iPhone’s inbox infrequently and in the evenings. But please be patient if I don’t respond right away to emergency code triage requests. 😉
Mar 25, 2010
When you look at the Contacts.app you see that Apple somehow manages to change the size of cells in UITableViews of grouped styling.
If you search around on the internet most of the solutions getting such a look revolve around making your own UIView and adding this as headerView to a section. Now if you want the cell on the right side to still behave like a cell is expected to behave then you have lots of work ahead of you. So I consulted the twitterverse and here props have to go to Jason Terhorst who hit the bull’s eye:
If I recall correctly from Apple’s example code, they just clear the background, and redraw that rounded rect at new size. It’s been a while since I did this, but I think I swapped in my own custom backgroundView.
I researched and experimented for a day to get it perfect. What follows is a description of how to pull off this magic trick, so you can do so too. The end result will look like this:
(Heart Icon by DryIcons)
Mar 23, 2010
At times you may find that you need a control that has not yet been provided for you. In my case I needed a star rating control for iWoman. Ladies will be able to star their love encounters. And the way how such a thing is done nowadays is via selecting between 0 and 5 stars. (If you now ask me to rig it such that your girl can only rate you with 5 stars, then I’ll bitch-slap you)
So I decided to make a UIView that would take UIImages for empty, half-full and full stars. Also I wanted to have some customizability like different numbers of stars and to be able to turn half-full stars on and off. That’s where I created multiple properties so that these values can be set from outside the instance. The steps are always: instance variable (“IVAR”), @property, @synthesize and if the property is a retained object then a line in dealloc.
I made this YouTube video to give you a demonstration and guided tour of DTStarRatingView.
Mar 20, 2010
With the sex apps removed Apple does not think we need protection any more. And lots more iPad-News.
Podcast: Download (21.9MB)
Show notes (aka my script) after the break.
Mar 20, 2010
I’m adding note taking to iWoman 2.0 and so I was thinking which metaphor would be one that users would understand and like. So I decided to mimic the look and feel of the built-in Notes app.
There where quite a few interesting things I had to learn and figure out and in this article I am going to share them with you. These are techniques that you can use in many other scenarios besides of making your own Notes view controller.
I was clear from the start that I needed to use a UITextView for the editing itself. Notes.app has several specialities that we have to figure out if we want to capture the look.
- Font is Marker Felt Thin, Size 19.
- each line sits on top of a grayish blue horizontal line
- the text view has a padding at all sides, something that the standard UITextView does not give us
- There is padding at the top, but still the text goes up to the corner
- the horizontal lines move together with the text and never end towards the bottom
- two static vertical brown lines line up with markings at the top and the bottom
- the body of the notes is not just a yellow gradient, but has some structure and speckles
- scrolled text disappears behind the images for the top and bottom edge
- The text view needs to be dynamically resized when the keyboard appears or disappears to prevent hiding of text.
Those where the challenges, in this YouTube video you see my solution and an overview of how I achieved it. More in-depth reasoning you find below.