Poll: When using external library, do you study how it works?
Sunday, June 5, 2011 at 16:52 | tagged
iphonedev,
learning,
polls,
programming
Post a Comment |
Sunday, June 5, 2011 at 16:52 | tagged
iphonedev,
learning,
polls,
programming
Tuesday, April 26, 2011 at 7:16 | tagged
iphonedev,
programming With each release of a software, comes the burden of handling version upgrade: the process of modifying, updating, adding or cleaning stuff in the software internal data structures in order to use the new features that comes with each version of the software. The upgrade process usually happens at application launch time and should be fast enough so the user doesn't notice what is happening. This is certainly the case of all iPhone applications.
With every version of Ultimate Password Manager, the following is done at application launch time:
When the application was first released, a specific amount of setup was done to create the internal data structures for application runtime. NSUserDefault is used as data persistence storage. This is the baseline for the future upgrade process for users upgrading to a newer version. Modifications required to this baseline should be considered a delta. Here is a excerpt.
// initialize default application settings
// Initialize the NSUserDefaults values and write them to disk if this is first time launch!
[defaults setInteger:1 forKey:kFirstUseKey];
[defaults setInteger:0 forKey:kpasswordTypeKey];
[defaults setInteger:0 forKey:kshowTipsKey];
[defaults setInteger:0 forKey:kKeepPasswordHistoryKey];
[defaults setInteger:0 forKey:kShakeForNewPasswordsKey];
...
At the end of the block, with each release of the application, modifications made to the base data structures is done with successive calls to a method called ImplementVersionXXX. With each release of the application, a new call is added in the serie and in each of these method, modifications to the baseline data structures are done there.
[self ImplementVersion101];
[self ImplementVersion110];
[self ImplementVersion111];
...
[self ImplementVersion202];
[self ImplementVersion210];
The content of any ImplementVersionXXX is very simple:
-(void)ImplementVersion101;
{
[self UpgradeFrom100to101];
}
So in fact, implementing a version is a set of calls to upgrade the baseline data structures from version X to Y to Z.
Upgrading from version X to version Y to version Z
The upgrade process needs to take into account a very important fact: not all users upgrade their application at the same time. Some users may even skip many releases. For user A, the application may be upgraded from: version X then to Y then to Z but for user B, the upgrade could be from version Y to Z if the user bought the version at release Y time frame ! Here is a graphic illustrating this.
If the user download an update from the App Store, we need to know from, when the application is next launch by the user, from which version we need to upgrade. Here is how the check is done:
if (currentVersion == kRelease100) {
// We upgrade: 1.0.0 to 2.1.0
[self UpgradeFrom100toCurrentVersion];
[defaults setInteger:kRelease202 forKey:kschemaVersion];
[defaults synchronize];
}
...
if (currentVersion == kRelease202) {
// We upgrade: 2.0.2 to 2.1.0
[self UpgradeFrom202toCurrentVersion];
[defaults setInteger:kRelease210 forKey:kschemaVersion];
[defaults synchronize];
}
if (currentVersion == kRelease210) {
// This is the current release, we cannot upgrade from the current release !
}
Then, the content of a UpgradeFromXXXToCurrentVersion is very simple:
-(void)UpgradeFrom100toCurrentVersion;
{
[self UpgradeFrom100to101];
[self UpgradeFrom101to110];
[self UpgradeFrom110to111];
[self UpgradeFrom111to120];
[self UpgradeFrom120to200];
[self UpgradeFrom200to201];
[self UpgradeFrom201to202];
}
The content of any UpgradeFromXXXtoYYY is very simple:
-(void)UpgradeFrom111to120;
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:1 forKey:kshowLiveFeedback]; // new in 1.2
[defaults setInteger:5 forKey:kQtyOfPasswordsToGenerateKey]; // new in 1.2
[defaults setObject:[NSDate date] forKey:kInstallDate]; // new in 1.2
}
Now, a graphic illustrating all the method calls and how they relate to each other.
Sunday, December 19, 2010 at 12:09 | tagged
learning,
programming,
references When I first started to learn iOS app development and design, I started a little web site with all my dev notes. You can find it here: http://www.tinysofty.com/MyDevNotes/Start_Here.html. For beginners only. I might redesign this web site sometime in the future.
![]() |
| My Dev Notes - a simple reference web site that I started at the beginning of my iOS journey |
Friday, November 19, 2010 at 22:41 | tagged
development,
iphonedev,
platform,
programming,
tools Recently, a friend of mine asked me to test one of his iOS app he was working on for a while. A very simple app that is used to fill a very specific need. He wanted my feedback on the app (stability, user interface, wording, etc.). So I installed the whole thing on my iPhone 3GS and gave it a serious look.
After a while, I noticed this app was doing weird things visually:
This developer is actually using a framework called jQTouch. More information is available here: http://jqtouch.com/. Honestly, I felt a bit deceived. I felt that way because I thought this developer was trying to have it easy! Why not develop in full Objective-C? Why not a native application? The debate was open!
This is not the first time these questions are asked. And this won't be the last time too. After my initial reaction, I changed my stance. I tried to understand his motive for using jQTouch. I think they are reasonable. He wanted to write his first iOS app that is easy with tools that gives fast results. On top of that, the developer is already fluent with web programming languages. So, He went with what he was knowing best. How about the application quality then?
On the application quality, I can see there is a bit of a difference because I'm a developer myself. But, what about the normal user? They don't really care as soon as the app is usable and produce the desired result. I think this is fine. But, the same day, I had a chance to try this application: Ars Technica Reader for iPad (link to the article presenting the app and the behind the scene view!).
What does this story boils down to?
Wednesday, November 3, 2010 at 22:05 | tagged
api,
iphonedev,
programming In Ultimate Password Manager, I'm using the very popular RegexKitLite for a few pattern matching with regular expression. Here is a few line of code using this:
Wednesday, May 12, 2010 at 8:08 | tagged
development,
iphonedev,
programming One one the thing I want to improve with Ultimate Password Manager is the application launch time, particularly on the first application launch. Currently, on the first generation iPod touch, one of the slowest device, the application launch time are:
Application first startup launch times:
After optimizing the application delegate method applicationDidFinishLaunching, the new launch time are:
2.2.0: 5 seconds
For all versions of my application, the application launch times are 2.5 seconds which is not bad.
How I did the optimization? By splitting the code in applicationDidFinishLaunching as chunk. Before, this method was a long series of steps and tasks that was using to perform application runtime data structures and loading. By splitting these tasks in smaller methods, I can then schedule those in NSOperation queue operations.
Monday, February 22, 2010 at 15:41 | tagged
development,
ideas,
programming Can we include HTML files inside an iPhone application ? Yes! For what purposes ? Reasons to include HTML files could be:
Sunday, February 14, 2010 at 21:22 | tagged
development,
ideas,
programming,
what's wrong A few days ago, I've exposed a problem with the startup sequence of my application: uP@ssw0rdz!. See: Improving the SplashScreen on an iPhone application
The solution to the problem was to buy and integrate a part from Dr Touch: DTSplashExtender. The part is not cheap but to visually improve the application startup sequence, I think this is a good solution. Here is the final implementation:
The other good thing is that the animation sequence can be made of a sequence of pictures and can be interrupted at any time to get access to the final UI more quickly. A button can also be shown at the the end of the sequence if you want to show more complete information to the user.
By the way, Dr Touch web site if full of very useful information and hints for every experience level of iPhone developers.
What do you think of it ?
Monday, February 8, 2010 at 10:01 | tagged
development,
ideas,
programming,
what's wrong As you may already know, every iPhone application uses a .PNG file that is displayed to the user when the application is loaded by the iPhone operating system. This is done in order to make the user experience nicer: instead of showing a blank screen while the application loads, a nice graphic can be displayed instead.
The duration of the display is related to the application initialization process. For some application, this process is very fast and the splash screen is not on screen for a long time. But for other, the splash screen seems to take forever to disappear (because of a slow device and maybe because of too many initializations to be done at program launch).
For uP@ssw0rdz!, the loading process duration is in the middle, not too slow but not too fast depending of the device being considered. For version 2.1, lots of code optimization was done to make the initialization process faster. And, a new animation has been added in order to make things nicer. Here is a short video of this (pay attention at the way the animation starts at the fifth second from the start of the video):
This animation is not perfect. The spotlight appears too fast.
The implementation is very simple, the Default.png file contains only the base image, a different UIImage is inserted which is the base image plus the spotlights... So two .png are involved. Here is the code for that:
// make the application UI visible!
[window addSubview:rootController.view];
// Prepare the SlashScreen to be shown
// for the animation.
SplashScreen.frame = CGRectMake(0, 20, 320, 460);
[window insertSubview:SplashScreen aboveSubview:rootController.view];
[window makeKeyAndVisible];
self.hideSplashScreen;
Thursday, November 5, 2009 at 20:08 | tagged
programming It's been a few days now since I opened my first support case with Apple Developer Support in order to help me a problem with my application development. We had email exchanges back and forth everyday and the guy at Apple is VERY helpful. My problem has been fixed and I'm closer to have a final 2.0 product ready to be submitted to the App Store for review. I'm a very satisfied developer.