Quick Sequence Diagrams January 6, 2012
Posted by henrychin in Uncategorized.add a comment
www.websequencediagrams.com
Check out this website if you need to quickly create a sequence diagram to show to a colleague. Just type in words what the sequence should look like and the web page auto updates with appropriate sequence. You can even save you text and reload it back later and best of all save image and send to your colleague for further discussion. This is great for those quick ideas and best all you can collaborate with friends on designs.
BBM Music change in strategy August 31, 2011
Posted by henrychin in Uncategorized.add a comment
Music Industry
RIM recently announced a new cloud service to lure music enthusiast to use BlackBerry mobile devices. In part this is an attempt by music industry to make up for lost revenues. Current trends for CD sales are down ~13% as mentioned in article from artistpr.com website. People are opting to go with direct streaming services such as Pandora, Spotify and iTunes. Not to mention another announcement by Facebook looking to also get into social music as a move to create communities of music lovers. The music industry deals with service providers represent new channel to market for the big players in music since they do not have the capabilities to create such services.
BBM Music Service Comparison
The new music service offer by RIM provides $4.99/month allowing up to 50 songs. The one advantage is the people can listen to friends music as well. So in theory the more friends I have that use the BBM Music service the more songs I can listen, leading to a network of music, potentially up to 50 x N friends of music. Does not appear to be any limit on number of friends to listen music from. This presents a social networking environment targeting some of the more younger generation. For young people this is a great service to start off with especially if you have a large social network of friends to share with. Recent trends in BlackBerry OS show demographics changing towards younger generation as shown from comScore diagram.

RIMs Drive for Younger Users
BBM Music service will have serious issues when competing against music enthusiast who already have a stockpile of music (1000′s songs). Service offered by Amazon looks more appealing giving people access to thousands of songs for just $5/year. While iTunes is providing a matching service that does not require uploading your songs, if the same song exists in iTunes then people have access to the same song even if the sound quality is better for just $25/year.
I do not want to rain down on RIM (considering they are canadian, hey!), certainly a good attempt to lock in younger generation with limit cash to spend. But as the user grows and wants to expand their music collection this will be difficult considering the 50 song limit. From the get go this service will be under tough competition, but I do see some possibilities for RIM to expand the service by providing incentives to link other BBM services together with music. Another crazy idea to promote social music is by increasing monthly song limit base on number of social music friends in your network. So for example say I like top 40, pop, rock and jazz categories. By creating a social network of friends that exceed 20 friends I would get 5 more songs allowed in my monthly limit. Doubling this to 40 friends gives 10 more songs, get it. Only time will tell, but hopefully this service will do better than BB App World.
Android becoming more like Apple iOS or is it August 15, 2011
Posted by henrychin in Google, Mobile Communication, Motorola.add a comment
Google Ups The Ante
Google will buy Motorola Mobility for $2.5B pending regulatory approval. Interesting move by Google, I guess they realized the benefits that Apple was doing by providing specialized software for dedicated mobile handsets. By taking advantage of the tight integration between both hardware and software can lead to more enrich user experience. This has certainly been the way of Apple and now that Google now has this ability consumers will reap the benefits. This places Google and Apple on similar playing field, now if Microsoft and Nokia can get something going then we can truly see a three horse race. Though do not discount RIM out the picture just yet. Their QNX operating system has the potential but I truly thing they are at least 6 to 9 months away from making this happen on their blackberry devices.
Google now has the ability to marry Android OS with Motorola handsets, something that Google has lacked since the beginning of Android. Google tried with Nexus One by partnering with HTC, but this was a flop (http://techchunks.com/technology/the-nexus-one-is-a-flop-135000-phones-sold-in-74-days/). Google had very little control over the design and the ability to marry Android custom features in with the phone was not possible.
Patent Fight
A key driver for buying Motorola Mobility is the recent fight for intellectual assets. There is certainly interest from all high-tech companies to protect what they have, but more and more companies are using it as a strategic advantage (i.e. offence) over their competitors. This is especially noticeable with Apple when it comes to protecting their brand and related look and feel consumers get when holding an Apple product. By getting a hold of such patents, Google now has the ability to enforce their own look and feel that is unique to Android. Something that will differiate Google phones from Apple phones.
Some speculate if Google would of bought Motorola Mobility if they did not lose the bidding for Notel patents. Recent weeks has showed considerable interest in Interdigital patents, considering they have 8,800 issued patents and over 10,000 in the pipe. Apple now owns Nortel patents (mostly communication related), forces Google hand to buy Motorola Mobility in order to beef up their patent fight. Interesting how Motorola was able to in few short years able to issue over 17,000 patents and 7,500 pending patents. Could be that Motorola strategy was to sell off their division all along. Especially, since Motorola just announced $56 M Q2 loss (http://www.engadget.com/2011/07/28/motorola-mobility-reports-56-million-net-loss-in-q2-3-3-billi/).
Cost of Buying Earlier
Arstechnica has an interesting article on what if scenario of Google buying Motorola unit back in 2010 (http://arstechnica.com/tech-policy/news/2011/08/what-google-lostand-gainedby-not-buying-moto-in-2010.ars). Basically, Google could of saved $6B if they had bought out MM earlier. Not to mention saving even more money with the failed Nexus One phone. Oh well live and learn, but now Google embarks on new journey that involves both hardware and software. Something they have little experience with.
Post Motorola Dilema
Here is an interesting article from visionmobile that talks about the different business models of Google and Motorola and the apparent reasoning for buying Motorola was mostly for the patents. Another interesting point about the article is the control Google will have over OEM vendors in terms of software dictatorship and compliance towards the Google Android way. Kind of reminds me of how Apple has total control over their value chain and the strict requirements.
Update
It appears Google overpaid for Motorola due to the interest in IP rights. SEC filings show initial offer at $30 but quickly moved to $43.50 over concerns of competing bids.
iOS 2D Drawing App using Quartz 2D August 9, 2011
Posted by henrychin in ipad app.Tags: draw, graphics, iOS, iPhone, mobile, objective-c, Quartz 2D
add a comment
iOS has a colossal list of frameworks and APIs to help developers create amazing apps. In particular Quartz 2D provides the basis for any drawing application. Some of the features offered by Quartz 2D include path-based drawing, painting with transparency, shading and drawing shadows just to name of few. Check apple documentation in XCode Organizer or on Apple developer website (http://developer.apple.com/library/ios/navigation/) and search for Quartz 2D. I was curious about how 2D drawing works using Quartz 2D and so I decided to use developers favourite tool, “Google” to find sample apps that demonstrate drawing basic shapes such as rectangle, ellipse and lines using iOS device (iPhone / iPad). If you ever tried OmniGraffle on iPad then a much simpler version. Google’s quick response showed an endlist selection of websites but nothing interesting or worthwhile. So I decided to embark on creating a demo app that can draw basic shapes. I am going to dispense with pleasantry and assume that you have basic knowledge of Objective-C and C programming language. You should be pretty comfortable with XCode, I am using the latest XCode 4 and iPhone v4.1 and iPad v4.3 release.
Step 1
Create a new XCode project by selecting File->New->New Project. Which should bring up template window that shows various templates to choose from. Select View Based Application and press next button. Next enter product name, company identifier and select iPad for Device Family.
By default SampleDrawApp folder contains three sets of files. The first set is SampleDrawAppDelegate files that include header (.h) and source (.m) files. Next is the controller files (SampleDrawAppViewController) including nib file. Finally is the MainWindow.xib file to round out the files in this folder.
Step 2
Create canvas class to allow 2D draw objects to be drawn on. This class will serve as the main UIView that will allow sub-views to add/remove draw objects later on. In addition, this class will be used to link ViewController with custom UIView class (i.e. Canvas). To create a new class first select SampleDrawApp folder in the left-hand pane. From main menu select File -> New -> New File menu item. Dialog box will appear, select Objective-C Class icon. Two files will be automatically created, Canvas.h and Canvas.m. Modify Canvas.h to include three new properties called origin, width and height. Make sure to synthesize the properties in corresponding class file. Here is what it should look like. Canvas.h
#import @interface Canvas : UIView {
CGPoint origin; CGFloat width; CGFloat height;
}
@property (nonatomic, assign) CGPoint origin;
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign) CGFloat height;
@end
Canvas.m
#import "Canvas.h"
@implementation Canvas
@synthesize origin;
@synthesize width;
@synthesize height;
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
return self;
}
/* // Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect { // Drawing code
} */
- (void)dealloc { [super dealloc]; } @end
Next link SampleDrawAppViewController.xib file to Canvas custom class by selecting the xib file to bring up Interface Builder. Select Canvas view and bring up Identify Inspector pane. Under Custom Class select Canvas and save the file. Now comes the interesting part where we make changes to Canvas.m to support drawing 2D objects.
Step 3
Add initWithCoder method instead of initWithFrame method when initializing a UIView class from xib file. Normally, you would overwrite initWithFrame, but this is a special case where xib file is creating the UIView. Set default properties for origin, width and height to look something like this.
- (id) initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
NSLog(@"initWithCoder");
self.origin = CGPointMake(0,0);
self.width = 0; self.height = 0;
}
return self;
}
Step 4
drawRect() method is the main callback that enables the app to draw custom drawing on user interface. In order to draw the app uses Core Graphics API to perform a lot of the drawing. To start off, the CGContextRef is used to provide a context for drawing. Therefore any drawing must pass along CGContextRef object. Before we can draw anything, we need to get acces to the context to begin with. By default Core Graphics will instantiate an instance of this object before calling drawRect method. This allows the code to call UIGraphicsGetCurrentContext() to retrieve the context. Note, calling this method from within another method (other than drawRect) will cause UIGraphicsGetCurrentContext() to return nil instance. To see a line on the screen you need to set the line width by calling CGContextSetLineWidth(context, 2.0). This creates a line of width 2 pixels wide. The default color for any line is black so setting the color will be helpful visually. Use the command CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor);to change to color to blue. Next create CGRect object to store origin, width and height information. Here is what it should look like:
- (void)drawRect:(CGRect)rect {
NSLog(@"drawRec"); // Get current context
CGContextRef context = UIGraphicsGetCurrentContext();
// Set line width
CGContextSetLineWidth(context, 2.0);
// Set color
CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor);
// Create rectangle co-ordinates to draw
CGRect rectangle = CGRectMake(self.origin.x,self.origin.y,self.width,self.height);
if (self.width != 0 && self.height != 0) {
[Canvas drawRectangle:context useDimension:rectangle];
}
}
Ignore the method call for drawRectangle for now, I will talk about this in the next step.
Step 5
drawRectangle method takes CGRect information and draws a simple rectangle using Core Graphics. To draw a rectangle use CGContextAddRect method. To add some visual appeal fill the rectangle with red color like this:
+ (void) drawRectangle:(CGContextRef)context useDimension:(CGRect)rectangle {
NSLog(@"drawRectangle");
CGContextAddRect(context, rectangle);
CGContextStrokePath(context);
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor); CGContextFillRect(context, rectangle);
}
Notice that this method is define as a class method so make sure to add method definition in the interface file.
Step 6
Next step involves implementing UIResponder touch methods to process when a user touch the screen and how user interface should respond. Here is the code for now, I will explain the content in more details later.
// touch gesture has begun, collect touch point
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
self.origin = [touch locationInView:touch.view];
self.width = 0;
self.height = 0;
NSLog(@"xOrigin=%f, yOrigin=%f", self.origin.x, self.origin.y);
}
// touch gesture movement detected, set width and height measurements
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { // get current X,Y co-ordinates
UITouch *touch = [[event allTouches] anyObject];
CGPoint offset = [touch locationInView:touch.view];
self.width = offset.x - self.origin.x;
self.height = offset.y - self.origin.y;
// update display to dynamically show object being drawn
[self setNeedsDisplay];
}
// touch gesture ended, finalize any drawings details
- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { // store co-ordinates in drawObject for display for drawRect method
if (self.width != 0 && self.height != 0) {
// add object to canvas for display
self.width = 0;
self.height = 0;
// update display
[self setNeedsDisplay];
}
}
// touch gesture canceled
- (void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{
// NSLog(@">>>touchesCancelled");
}
Step 7
Run the app and see what it does. When you run the app tap and drag and you will see a red rectangle being drawn. When you let go notice how the image disappears. Well this is because the image is not being stored as a UIView subview to the Canvas. More on this later.
Objective-C alloc & init objects July 25, 2011
Posted by henrychin in objective-c.add a comment
Been some time since my last post. Recently have time to look into iPhone/iPad development and getting my feet wet with mobile applications. Decided to add some short posts that I found interesting or useful for people developing in iOS. Here is the first of many.
Developers that come with java background shouldn’t have a big problem transitioning over to Objective-C (OC), many of the OO concepts still apply here. One thing common in most OO languages is the concept of creating an instance and initializing the object. People familiar with old C style memory management can remember the common memory function malloc or calloc. No different here in OC, main difference is you do not need to specify the size of memory to allocate. For example:
MyObject *someObj = [MyObject alloc];
Simple isn’t it! So what about the init message. Well there appears to be no hard requirement for all objects to implement the init method. So what is the purpose of this method? As with any new object that is instantiated, default settings need to be defined. If MyObject class has two variables called geoLocationLat and geoLocationLong then theses variables should be initialized to default values (i.e. zero). But keep in mind if you decide not to set default values this can be potential bug in future when you try to figure why MyObject is using weird values. Here is some info from Apple describing the use of init method.
An object isn’t ready to be used until it has been initialized. The init method defined in NSObject class does no initialization, it simply returns self.
Simply put, this means the init instance method (denoted by minus sign in front) is a placeholder for tasks that some classes need to perform before they are used. NSObject related objects do not have to initialize anything. However, it is good programming practice to always run the init method after allocating a new object in case the parent class may have some custom initialization code that needs to be executed.
Another related class method (denoted by plus sign in front of method) is called initialize. The runtime system sends an initialize message to every class object before the class receives any other messages and after its superclass has received the initialize message. This gives the class a chance to set up its runtime environment before it’s used. If no initialization is required, you don’t need to write an initialize method to respond to the message (Reference: The Objective-C Programming Language by Apple)
With all these initialization methods this allows the developer to provide consistency when developing applications but more importantly provides a programming paradigm that is well-regarded in OO community.
iOS vs Android June 30, 2010
Posted by henrychin in Mobile Communication.add a comment
All the talk these days is about which device is selling more. Not too long ago CNN/Fortune reported (http://tech.fortune.cnn.com/2010/05/10/android-demolishing-iphone-in-sales/) that Android was demolishing iPhone sales. Then came Apple WWDC and the launch of iPhone 4. Steve Jobs just had to comment on this and make it right, indicating that iPhone is still strong. Recent reports from AppleInsider (http://www.appleinsider.com/articles/10/06/28/apple_announces_iphone_4_sold_1_7_million_in_first_three_days.html) shows iPhone 4 sold 1.7 million devices in just three days. This is just one leapfrog after another.
With all the data coming out of the wood work, is it fair to compare these two operating systems just on numbers. Another comparison point is the feature set that these two systems provide. A lot of people are blogging about the hardware capabilities that each phone provides (iPhone 4 vs. HTC EVO 4G). The real comparison is the firmware/operating system that runs on top of the device. As a side note, I remember talking to a RIM engineer and all the person could talk about was the hardware specs. I don’t think this person realize the key success factor for Apple iPhone is the user interface. This is what started the smartphone wave to begin with. The one-touch access to apps, touch gestures, and the ease of use. Google is catching up with user experience on Android, but Apple has the advantage.
One aspect that people seem to forget is that these two systems have a different market strategy. The Apple brand name is strong, in fact it one of the most recognized brands in the world. The iPhone is geared for consumer market with emphasis on style and luxury. While Android is nerd version of iOS, meant for practical and efficient use. In addition, Android is expanding into consumer play onto a number of third party devices, tablets and TV set top boxes. Googles dominance in the advertising space will grow at an astonishing rate.
In the end, I think iOS and Android devices will have a bigger market share over other smartphones such as Nokia and RIM. While Microsoft will all suffer and lose market share. In particular, Microsoft is always a late comer and will have little impact on the mobile OS market share. RIM will have the biggest lost. There is very little interest in BlackBerry App World and the BlackBerry Storm was suppose to be the iPhone killer (just like Palm Pre) but only 500,000 units sold in first month (http://moconews.net/article/419-blackberry-storm-sales-promising-but-not-spectacular/), shows promise but not the iPhone killer that they once hoped. While Nokia continues to lose market share quarter-over-quarter. Just like App World, Nokia’s version called Ovi is not doing well at all. This just shows how strong iOS and Android are positioning themselves to become a dominate force within mobile operating system market space.
Update: June 5
Found an interesting article from Mashable (iOS vs Android: Developers Weigh In) summarizing original report from Appcelerator about Mobile Developer Survey concerning the level of interest between iOS and Android development.

- Interest in tablet development has spiked since Apple introduced iPad.
- Short-term interest in Apple iOS, while Android remains as a long-term interest.
- Second-tier platform, such as Nokia, RIM and Windows Mobile lost ground. The confirms my thoughts going forward for these platforms.
- Large enterprises are seeking mobile development as oppose to small enterprises.
- Porting applications across platforms is the number one pain for developers.
How many developers develop for iOS vs. Android? Here is a visual image of the current market.

Communication and Business Process June 9, 2010
Posted by henrychin in Communication Enable Business Process.add a comment
For those of you who are new to this topic, check out this link from wikipedia (http://en.wikipedia.org/wiki/Communication_Enabled_Business_Process). Another term that I’ve seen is Communication Enabled Application (CEA – more Googling). In plain English, this is the marriage of many different types of technology with businesses that perform a specific task. Take for example, a traditional video store (i.e. Blockbuster) that has a customer suggestion box at the front counter. Now, any consumer-oriented business will value client feedback and suggestions. Think of the painful process that is require to collect the user forms and to manually enter the forms into some sort of electronic organizer (spreadsheet, database). Next step is to forward this information to the store manager and regional director. The whole process could take days if not weeks to complete. Instead, people could be more focus on customer satisfaction.
Ever since Avaya coined the phrase Communication Enabled Business Process (CEBP) and Gartner decided to use the same term, this technology has been all hype. Since mid 2000′s CEBP technology has been an early adopter technology. However, there is growing interest in the past few years (2008) to reconsider CEBP to be at early stages of mainstream adoption. This is where Geoffrey A. Moore and crossing the chasm has some relevance. Of course, there have been announcements by big players (Nortel – now defunct, Cisco Pulse, Avaya), indicating successful win with major fortune 500 companies. Just look at the list of case studies provided Unified Communications Strategies website (http://www.ucstrategies.com/unified-communications-case-study-library.aspx). Majority of these wins are big name fortune 500 companies, while other case studies talk about technology and not the value add to businesses.
The more interesting use cases are the ones related to small / medium companies that have limited resources and capital at their disposal. Think about it, if a large companies can fork out a few hundred thousand for an all in one solution then what’s the difficultly or challenge in doing that. The servers and hardware have already been tested in lab environments and external integration with actual business process is limited to a few database queries or web service calls. A small company has to be truly agile and cost conscious. The head techie has to worry about keeping everything running smoothly or else shit hits the fan and someone’s gotta pink slip. IT folks want minimal overhead when adopting or using new technology. The current big players have a tough battle to win over SME market. But that’s where I think the money lies, 85% of businesses in North America are SME.
So what are the options out there besides the big players, well there are few startups that are looking interesting. One player called Ribbit was bought out by BT. Ribbit has gone silent in the last while, understandable since the take over. VoiceSage and IfByPhone look promising. In fact the VoiceSage blog has some interesting comments on CEBP in general.
Final comment, CEBP has potential to break out in the next couple of years. The real market potential is in the SME market. The real question is identifying the niche market where SME can gain real business value with little hassle and greater top line return on investment.
iPhone 4 June 9, 2010
Posted by henrychin in Mobile Communication.add a comment
Apple recently announce the new iPhone 4 with newly renamed iOS. Heard Apple had to jump over some hurdles to get approval of the name change from Cisco. Boy, must of been some big time lawyer fees for that name.
Apple is certainly keeping pace with competitors and in some cases staying one step ahead of the game. The new display (from what I heard) is amazing. Way better than EVO and Droid.
The big feature, or as Steve calls it the “surprise” that no one expected is the FaceTime video chat. Only draw back is that people have to use over WiFi, so not a true mobile offering. This feature starts to open doors for a number of markets. For example collaboration software can enhance user experience by using direct face-to-face with people to see situations first hand (think news reporter) or quick whiteboard sessions with R&D folks half way around the world. No more complicated video conference service. The power is in the hands of user.
This will be a game changer for Skype. Now, people can chat directly using video instead of using Skype service or client. VoIP is already bundled in with iPhone. Think of the apps that geeks are developing right this minute to take advantage of FaceTime.
Certainly a worth while device to consider for people who have 2G and 3G versions of the iPhone.
EMBA Experience January 8, 2010
Posted by henrychin in Uncategorized.add a comment
Been some time since my last post. I can certainly see the light at the end of the tunnel now that I have 12 more weeks left until I graduate. This has been a long time coming but certainly an enjoyable ride. Just a few more courses and one major international strip to China to help a big engineering firm define their market entry strategy. Should be interesting, not to mention the late night parties celebrating the end of school. Looking forward to this, but more importantly the beginning of some interesting opportunities that I see in the horizon.






