Category Archives: Objective-C

SnappyCam App looks very good

I just read about this on Techcrunch and try it out, it is a very handy camera app. Although I am not sure the image result looks actually great because it is only 213kb? I also would love to know how he can do it

Snappy Camera

Snappy Camera

 

http://techcrunch.com/2013/07/31/fastest-iphone-camera/

Your standard iPhone camera app is actually pretty slow, able to take just three to six photos per second at 8 megapixels each. But with SnappyCam 3.0, you can shoot 20 full-resolution photos per second thanks to a breakthrough in discrete cosine transform JPG science by its inventor. Twenty frames per second is fast enough to capture shot-by-shot animations or every gruesome detail of an extreme sports crash.

Windows Phone Potential?

I normally hear from Windows developer to say that their Windows market share is much bigger than the total of iOS and Android together. And the sales of Windows 8 has bypassed all the sales of iOS and Android from the beginning to now.

Windows Phone 8

Windows Phone 8

It is quite unfair to compare the whole Windows 8 with iOS or Android. And if we do take that demand into PCs and laptops, then why the hell we do not compare the supply side? It is very clear that if Windows 8 could be a shared platform between PCs, tablets and phones, then all the old software, all the old games would have beome compatible to the Windows 8 system in the short amount of time. And many apps for tablets and phones would be quite different than the ones in PC. No, I don’t mean technology, I am talking about the business model, the purpose of the software.

I don’t mean that iOS and Android is a better market than Windows Phone for indie business. These markets have become very competitive and continue being so. You either have to figure out a market niche or be very lucky.

iPhone v.s Android

The smartphone game is over. The tablet game will be finished soon, within 2 years.

iPhone versus Android

iPhone versus Android

 

 

Android wins, iPhone loses. 75% v.s 15%, soon will become 85% v.s 5%. But that doesn’t matter much for Apple. Apple is a brand for high-end products. They don’t aim to gain all market share. To gain market share, Apple has to attack more of the low-end market, which means they have to lower their price. However, matching other supplier’s price may be harmful for Apple’s brand, although they may achieve it by more efficient supply chain and factories.  To become a high-end brand, Apple spends a significant amount of money on their brand and will not scarify it for the market share.

But in this ecosystem war, the bigger ecosystem leads to a win by monopoly. When 75, 80 or 85% of the market is using Android, app developers will flock to there, and make the ecosystem become much more valuable for customer. To continue earning a lot of money, Apple has to continue what it has done best under Steve Jobs’s empire. New product, new market, new value, or new software that people are willing to purchase with high-price.

What will be the next Apple’s product? Probably Apple TV, I am not even sure about that.

And the important questions for most of us, as app developers, what should we do? Should we all move to Android yet, should we change our strategy of iOS first, Android second? Or should we start discussing about Mobile Web App?

I am writing more on the Mobile Web App v.s Mobile Native App in the next post, catch it soon.

Suggested Frameworks for iOS

Here are some suggested frameworks for iOS development, since I have used all of them quite a lot. I think they are good frameworks/libraries that you may need to know. It could save you a good amount of time in researching and reinventing the wheel.

List of Frameworks/Code Snippets for Objective-C:

List of some good components

CorePlot : Core Plot is a plotting framework for OS X and iOS. It provides 2D visualization of data, and is tightly integrated with Apple technologies like Core Animation, Core Data, and Cocoa Bindings.

Core Plot Graph

Core Plot Graph

iPhone Cocoa Http Server:

CocoaHTTPServer is a small, lightweight, embeddable HTTP server for Mac OS X or iOS applications.

Sometimes developers need an embedded HTTP server in their app. Perhaps it’s a server application with remote monitoring. Or perhaps it’s a desktop application using HTTP for the communication backend. Or perhaps it’s an iOS app providing over-the-air access to documents. Whatever your reason, CocoaHTTPServer can get the job done. It provides:

 

Google Objective-C coding standard

I am not sure what coding standard you follow, but I usually follow the Objective-C coding standard of Google for code formatting:

Spacing And Formatting

Spaces vs. Tabs

Use only spaces, and indent 2 spaces at a time.
Line Length

Each line of text in your code should try to be at most 80 characters long.
Method Declarations and Definitions

One space should be used between the - or + and the return type, and no spacing in the parameter list except between parameters.
Method Invocations

Method invocations should be formatted much like method declarations. When there’s a choice of formatting styles, follow the convention already used in a given source file.
@public and @private

The @public and @private access modifiers should be indented by 1 space.
Exceptions

Format exceptions with each @ label on its own line and a space between the @ label and the opening brace ({), as well as between the @catch and the caught object declaration.
Protocols

There should not be a space between the type identifier and the name of the protocol encased in angle brackets.
Blocks

Blocks are preferred to the target-selector pattern when creating callbacks, as it makes code easier to read. Code inside blocks should be indented four spaces.

My New Book – 21 years old achievement

21 years old, I got my first book released, I was so excited. Buy it here

Pro iOS Apps Performance Optimization

Pro iOS Apps Performance Optimization

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Today’s iPhone and iPad apps developers are often running into the need to refine, improve and optimize their apps performances. As more complex apps can be created, it is even more important for developers to deal with this critical issue.

Pro iOS Apps Performance Tuning and Optimization covers many common but difficult problems when tuning and optimizing performance for iPhone and iPad apps and how to resolve these problems efficiently. This book gives you the following:

  • Basic knowledge on common problems in iPhone apps
  • Advanced knowledge over data structure, algorithms, multithreading, and network data in iPhone apps
  • Comparison with problems and solutions for Android and Windows Phone apps

After reading this must-have book, you’ll be ready to make the most of the processing power of the iPhone with your apps performance optimization know-how.

 

What you’ll learn

  • Benchmark your apps using emulators and real device tests
  • Increase and optimize UITableView performance in your iOS apps
  • Increase your app performance using image and data caching techniques
  • Tune your apps using algorithms and data structures
  • Improve your parallel data access using multithreading techniques
  • Optimize memory usage for increased battery life and better apps performance
  • Use native C code to address memory leaks or EXEC_BAD_ACCESS

Installing App with iPhone Configuration Utility

iPhone Configuration Utility

iPhone Configuration Utility

 

I always have problems finding a good tutorial for my customers whenever I send them the adhoc app for testing, so I write this post to have a basic place for me and everybody else to send to their beta tester/customer without touching to iTunes with the crazy syncing process. This can be good for JailBreak iPhone as well but this is another story.

 

1/ Download iPhone Configuration Utility.

You can download the iPhone Configuration Utility for Windows here, and for Mac here.

2/ Plugin and find your device

You can find your device easily, and then choose add button as shown in the red box

iPhone Configuration Utility - Device

Show Devices in iPhone Configuration Utility

3/ Select your app

Open Your File Browser and select the file you need, in this case is JobFinder.app

iPhone Configuration Utility - SelectFile

Select Application File

4/ Go back to device and open the Applications Tab

iPhone Configuration Utility - Applications

Applications Tab

5/ Installing the app in

iPhone Configuration Utility - Install Applications

Install Applications

 

New Twitter XAuth and Sharing on iPhone

This Twitter sharing library for iPhone has a great User Interface, comparing to my current library for Twitter Sharing, the only problem is that it does not work with new XAuth project. So, I decided to take that UI and merge into my existing codebase for twitter xauth and sharing. The new library allow you to login, share and logout

https://github.com/vodkhang/Twitter-XAuth-and-Sharing

And here is the result. It looks great and really like the UIAlertView in iPhone

Login To Twitter with iPhone

Login To Twitter

Share on Twitter

Share on Twitter

 

 

 

 

 

 

 

 

 

 

 

 

http://amanpages.com/sample-iphone-example-project/multiple-login-for-twitteragent/

Windows Phone 7 v.s iPhone Presentation in Barcampsaigon

Windows Phone 7 and iPhone Presentation

Windows Phone 7 and iPhone Presentation

Here is my presentation with Nghia Dang on the topic comparing the differences between Windows Phone 7 and iPhone Development. I share it here for others who cannot come. Contact me (vodkhang@gmail.com) or Nghia (nghiadang@kms-technology.com) if you have any questions:

Kms-Technology

iPhone Code Generation – Property

This is my new generation script, mainly copied from here with some improvements to meet my needs:

XCode Code Generation

XCode Code Generation

- Change the dealloc to [self.variable release] instead of [self.variable dealloc];

- Change the @outlet variable to check for the “UI” prefix rather than letting it put IBOutlet everywhere or I have to use 2 scripts at the same time.
- Add some of my own into the assign list

The second one is not a perfect solution for IBOutlet but considering that it doesn’t harm much except let some annoying IBOutlet out.