I spent this afternoon to speak on a seminar in University of Pasundan, to talk about creating and selling mobile apps. Mostly talk about how to make money in mobile apps industry and how to jump into mobile apps development. I’ve talked this kind of stuffs many times so my slide is quite the same as previous ones.
Month: April 2012
Consuming and Parsing JSON Service in iOS 5 – The Easy Way
Let’s say I want to get tweets from Twitter.
- I send HTTP request to Twitter with “Accept” header set to “application/json”
- Receive returned JSON and parse it
- Do whatever I want with parsed JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
//The URL of JSON service NSString *_urlString = @"http://twitter.com/status/user_timeline/andri_yadi?count=50"; NSURL *_url = [NSURL URLWithString:_urlString]; NSMutableURLRequest *_request = [NSMutableURLRequest requestWithURL:_url]; NSDictionary *_headers = [NSDictionary dictionaryWithObjectsAndKeys:@"application/json", @"accept", nil]; [_request setAllHTTPHeaderFields:_headers]; [NSURLConnection sendAsynchronousRequest:_request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse* response, NSData* data, NSError* error) { NSError *_errorJson = nil; NSArray *_tweetArr = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&_errorJson]; if (_errorJson != nil) { NSLog(@"Error %@", [_errorJson localizedDescription]); } else { //Do something with returned array dispatch_async(dispatch_get_main_queue(), ^{ [self didLoadedTweetsWithResult:_tweetArr]; }); } }]; |
Above code uses two API provided only in iOS 5 or later:
- Asynchronous and block-based handler NSURLConnection
- NSJSONSerialization
You don’t need any third party libraries.
Logging in RestKit
RestKit is sent from heaven. It’s super awesome. But a lot of magics and mysteries happen under the hood. Logging is the easy way to examine what happen.
To activate logging or change the logging behavior, all you have to do is adding/changing Preprocessor Macros in Build Settings of RestKit project.
iOS Development – Offline Class for Jasakom Community
30 Rocks!
Waking up in the morning, taking a bath, turning on my Mac, and I got this reminder from my own computer:
Yeah, I know I’m 30 now. And being 30 is not as bad as I thought. When the clock ticked to April 9, 00:00, and the day’s changed, all the sadness and worries went away and ready for the big start. Lucky, I’m surrounded by people who’s cared much to me, my future wife, my mom and dad, and my sister. And off course, friends are there supporting me.
The Last Day
This is my last day of being 29 years old, umur berkepala dua. Dalam kurang dari 7 jam, angka depan umur akan bertambah. There’s a mixed feeling, between grateful and sad. Bersyukur karena diberikan kesempatan untuk hidup selama ini dan bisa berbuat sedikit banyak bagi diri sendiri dan orang lain Sedih karena I wish I could do more selama umur berkepala dua.
Some say umur berkepala dua adalah masa keemasan seseorang. Sukses atau tidaknya seseorang for the rest of his/her life, terukur dari seberapa sukses dirinya dalam umur 20an. If Steve Jobs’ worth 100 million dollar when he’s 30 years old, then how much am I? really need to think about it.
AR.Drone & Kinect at GeekFest ID Event
My team and I were at GeekFest event. We’re invited as one of exhibitor since my company – DyCode – is the contributor to the event. We’re the creator of the official GeekFest mobile apps.
A memorable moment during the event was when our booth was unexpectedly surrounded by the crowd. How it’s not, we demo something that may (just may be) never been done anywhere in Indonesia. We flew AR.Drone there. Not only using iPhone app, but also using home-made Kinect app (that I created a day before :P).
Hello world!
Finally! After blogging here and there, mostly about technology, I have my own blog. Never really went into blogging much before, since I’m a man of action, instead of just writing (no offense writers/bloggers). However, at my last day of 29 years old, new dawn of 30 is ahead, I feel much wisher. And wise man needs to spread the words, not only by talking, but also by his writings.
I did blogging at Indonesia .NET Developer Community, Nokia Indonesia Community & Enthusiasts, and iMadCamp (that then become id-objectivec.org), but never really had my own blog. The main reason is discoverability as my writings were mostly about software development (iOS, .NET, Qt, and Java), I want them to be read as many persons as possible. Never much about personal life and thoughts.
Since I already have my own blog now, I can write whatever I want. One thing I promise you, the posts are worth to read 🙂