Categories
iPhone app

Don’t jail break the iPhone

Reading Time: 2 minutes

Learned the lesson the hard way again. 🙁 🙂

I think nowadays jailbreak is not as popular as the early days of iPhone. And I did that also to my iPhone 3g, reason being I don’t want to stuck in contract with AT&T, so I jailbroke it and put in T-mobile prepaid card, and gave it to my wife. Now the consequence part.

Recently I want to sell this phone, as we no longer use it. We probably have not touched it for couple years. Since I gave my old iPhone 4 to my wife about 2 years ago. And I made a mistake put it in “factory unlock” category for this phone, which is not true. I found a buyer. But when I tried to remove the content of this phone, by going to settings, it got stuck. I had to put it in DFU mode by following this instruction. Also I had to upgrade it to iPhone 4.2.1, which is the last updated version of iPhone 3g. After that obviously I lost the jailbreak, as it does not take a T-Mobile SIM card to activate. Luckily I found a H2O (AT&T network) SIM card, and I was able to activate the phone. Note in the early days of iPhone, a SIM card is required to setup an iPhone. I was also be able to restore the content from iTunes backup after that, which is cool as I did not backup the contacts on the phone previously.

Long story short, I had to cancel the order, and put it on sale again in “AT&T” category, as this is no longer an unlocked iPhone. The morale of lesson here is jailbreak is not “factory unlock”, it consistently need to keep up once we update the phone, which is a hassle. Had I stayed with AT&T, I would get an unlocked code, and get it unlocked officially. Just like what I did with the old iPhone 4.

PS:
I thought about it more, since I paid the early termination fee, and I requested for device unlock via AT&T website. Did it couple times, and it worked. The first time it did not work due to my own mistake, they asked for email confirmation in which I need to confirm my email by clicking on the link. After the carrier unlock, I was able to restore the iPhone 3g to iOS 4.2.1 and use a T-mobile SIM card to activate the phone. Now I put it back in Apple iPhone 3G 8GB Black unlocked category on Amazon again.

Categories
iPhone app

iPhone backup photo extract and online photo backup

Reading Time: 2 minutes

I learned the “iPhone photo backup lesson” the hard way a few years ago. At the time I was leaving the company (planned exit) and I need to turn in the company iPhone 4s, I did iTunes backup (encrypted, more on this later) on my PC, as well as on iCloud (paid $20 for 10gb extra space, the free one is 5gb). But where do I get the photos back? At the time I did not know there are software to extract photos out of the iTunes backup. So 6 months later, I bought a new iPhone 5s partly to get my photos back (restore the backup from iCloud to the new iPhone). Btw, this approach is a way described in this osxdaily article. A bit pricy option though.

Until today I need to restore some photos from an iPhone 3g backup, and I tried both the picturescue app (Mac only, $10), and the more pricy option of iPhone Backup Extractor ($30 for home, and $70 for Pro). The difference is the former only extract photos, the latter extracts contacts, SMS, etc. Also the Pro version works with the encrypted iTunes backup.

Online photo storage
My last tip is about online storage of photos. In the past I tried iCloud (paid), Dropbox (free), Google photo (15gb limit for free), Amazon (prime membership, for Fire Phone), and last but not least Microsoft OneDrive. I found OneDrive to be good as I got free space (115gb , among them 100gb is Bing bonus expires on 2/9/2017). So in other words Microsoft is consistent with Google on free space (15gb). I also used Google Photo (google drive) for backup on iPhone too (after returning 4s to employer). But on Google I have 17gb free space. Both Goolge and Microsoft offers $2 ($1.99) a month for 100gb extra space. So this comes at $24 a year. Better than Apple iCloud a few years ago. I don’t like iCloud because it’s not as intuitive as Goolge Photo or OneDrive. And I get to see/browse the photos online via desktop. I think I will stick with OneDrive for a while. One trivia on OneDrive, at one time I tried to back up Apple iPhotos files to OneDrive (about 35gb), it did not work out. One reason being the slow network speed. But I think there might be software related issues too.

PS
One may ask why I resort to the iTunes backup for the photos, and why not directly get it out from the phone. Good question. In this particular case, the iPhone 3g w/ iOS 3.1.2 appears too old for Windows 7 and other OS to recognize as a digital camera. I tried 4, 5 computers (2 Macs and 3 PCs) to this phone and none worked. But the iTunes still works with the iPhone, that’s why I backed up the phone via iTunes and tried this route. So in a word, the photos jumped through the following hoop.

iPhone via iTunes back up => Mac picturescue => photos on Mac => USB stick => Windows PC => OneDrive

The USB stick part is optional, as OneDrive app exists on Mac. I did it because my Mac has smaller disk space than PC.

Categories
iPhone app

iPhone 6 and 6+ models for use in China

Reading Time: < 1 minute

Refer to Apple, and redmondpie.

It’s slightly cheaper to buy iPhone from US and use it in China. The trick is to figure out which one to buy, because not all models can be used smoothly in China. Some of the models are designed towards the US carriers (e.g. the T-mobile version). Here are the recommended models.

Short version
Go for the SIM free version:

iPhone 6 (model A1586)
iPhone 6 Plus (model A1524)

Long version
China has 3 main carrier, China Mobile (biggest), China Unicom and China Telecom. China Mobile has its own standard for 3G/4G implementation (those bands starts with TD), and it’s not compatible with the rest of the world.

Here is more details from redmondpie:

The SIM-free variant of the iPhone 6 and iPhone 6 Plus is the one which is tailored to be used pretty much anywhere in the world, with compatibility for 4G LTE capable carriers in various nations.

This model also works on China’s advanced TD-LTE and TD-SCDMA networks, so you can rest assured that all the necessary bands are there when you get hold of the device.

The SIM-free iPhone 6 and iPhone 6 Plus may not offer full compatibility with carriers in the United States, therefore you might be restricted to 2G or 3G on some popular networks.

Translation by Google:
请参阅苹果和redmondpie。

这是稍便宜,从美国购买iPhone,并用它在中国。关键是要找出哪些人来买,因为不是所有型号都可以顺利地在中国使用。有些机型都对美国运营商设计的(如T-Mobile的版本)。以下是推荐的机型。

短版
去SIM卡免费版本:

iPhone 6(型号A1586)
iPhone 6加号(型号A1524)

长版
中国有3个主要运营商,中国移动(最大),中国联通和中国电信。中国移动有自己的标准,3G / 4G的实现(这些频段开始TD),它不是与世界其他国家相兼容。

下面是从redmondpie更多详细信息:

在iPhone 6和iPhone 6加的SIM卡免费变种是是专为使用几乎在世界任何地方,用在不同国家的4G LTE能够兼容运营商之一。

这种模式也适用于中国的先进的TD-LTE和TD-SCDMA网络,所以你可以放心,所有必要的乐队在那里,当你弄个设备。

该SIM卡免费iPhone 6和iPhone 6加可能无法提供与美国运营商的完全兼容,因此你可能会限制到2G或3G上一些流行的网络。

Categories
iPhone app

Switch from iPhone 5s to Amazon Fire Phone

Reading Time: 2 minutes

I did a switch from iPhone 5s to Amazon Fire Phone about a week ago. This is not the first time I switched from iPhone to Android (Nexus 4), I did a switch for a few months in Summer 2013. It was ok, but I really missed iPhone for some of the features, and its smoothness. I think I still miss some of the things on iPhone, e.g., the “Cellular” in Settings tells me immediately how much data I used on iPhone. On Fire Phone (android), the UI is not as good. There were some rough edges esp. when switching apps, it slows down or when I tap on something, the response is not immediate sometimes (Safari). But for the most part, for a $80 phone (the price was $179, and Amazon offer a year prime membership there, which costs $99 by itself), I think it’s understandable.

I did get a Fitbit Charge from Microsoft store because Fire Phone does not come with pedometer. I didn’t intend to keep the Lumia Phone, so I sold it on Amazon right away.

By the way, since Amazon released Prime Music Players, I was fascinated by it. Essentially I don’t need Apple iTunes anymore 🙂 The Amazon app store does have some limitation compared to Google Play store, and some popular apps are not there yet, e.g., BoA and weChat apps. I read it’s possible to side load play store apps, but haven’t done so myself. Also, I still have the original iPad mini, so I can still use iOS apps there.

Some of strong points of Fire Phone
1) Large screen compared to iPhone 5s: 4.7″ vs. 4.0″, that’s meaningful.

2) Large storage room too 32 gb vs 16 gb, considering the OS and app sizes, the real usable space for phone/video/podcast is much bigger.

3) The camera is also good.

4) Some fun factor added on Fire Phone (or android), e.g. the daily changing theme (home screen background), for one.

Some migration tips
1) The contacts: I tried to put them on Gmail contacts, it syncs automatically.

2) Prime music: I installed the app (note the pre-installed music app is not Prime music app), and download the songs/album I like to have again.

3) Data usage: there is no way for Fire Phone to control the usage of cellular data per app, which iPhone does. I just turn off and on Cellular Data as time goes.

4) Fitbit: with the Fitbit on hand, the measurements of my steps are more accurate, as I did not carry iPhone 5s all the time. I do wear Fitbit all the time.

Maybe I will write a review for Fitbit charge sometime. The one thing I did (after I learned from Amazon product review) is I bought this fasteners to make sure I don’t lose it.

Categories
iPhone app

Upgrade to iOS 8.1.3: some tips and tricks

Reading Time: 2 minutes

I decided to upgrade to iOS 7.1.3 to iOS 8 recently due to the t-mobile wifi calling feature which is only available on iOS 8. Previously I tried to delay the update due to the main reason: my iPhone 5s is almost full and I need to back up and delete photos. I know people talk about just update it by the way of iTunes desktop (using USB/lighting cable connecting iPhone and laptop).

After back up my photos to two iPhoto library, and made an iTunes backup to my PC (laptop), I need to decide one thing quickly: whether I want o upgrade to iOS 8.2 which can be done from iPhone itself (Settings => General …), or do I go through the trouble to find 8.1.3 from web and restore it myself. I decided to go the latter, because I don’t want the Apple watch app on 8.2, also my company does not support 8.2 (I need to use it for company email). So here is the site I found the ipsw file. After the download, run checksum using this md5 command, then verify the SHA-1 digest using openssl command. Restore it using iTunes 11.1.5 on my mac (hold alt and click “restore” to open ipsw file).

The usual new iPhone setup afterwards (I used restore from iCloud, an old backup). After that I got all the email, plus the apps on the phone a while back (May 2014 to be precise). One interesting thing is I noticed even the phone call/messages are also back dated to May 2014. But iCloud had my recent contacts and it appears all intact on the phone.

Some odds and ends
The day after the update (yesterday morning), I found I could not install apps. Turns out there is a massive iTunes store outage (I found it out as I tried iTunes music and tried my iPad mini).

My Sienna audio does not recognize the “updated” phone. The trick is delete “car multi-media” from phone and pair it again. I have another post dedicate to this topic. Interestingly, my Camry 2012 audio recognize the the “new” iPhone without problem. Also, all the existing WiFi connections are gone after upgrade, so I need to ask around the Wifi passwords again 🙂

Google+ plus photo missed some recent pictures. I don’t think it’s a big deal, as I already have iPhoto and iTunes backup. But this combined with the iTunes outage, made me think twice about the cloud storage.

I will share more as I remember more things.

(Update 3-15-15) I learned form my friend, and also verified on my t-mobile account, the Wifi calling is not free. It’s merely use Wifi to enhance the signal. Because I am a prepaid user (legacy plan), so this does not really saving me money 🙁

Update vs. restore
The main difference between update and restore is like this: think Windows update vs. re-install the OS. In other words, all the stuff (files and software; pictures and apps) will be intact after update, but restore will get rid of all that. It will start fresh. The reason I did restore instead of update is I don’t have enough space on my 16Gb iPhone 5s.

Categories
iPhone app

2014 Year in review

Reading Time: 2 minutes

I was a bit late doing this, but I think better late than never.

Family and Personal Finance
We had baby (girl) No. 2 in the summer, baby Sophia is healthy and happy for the most part. I had to be honest, having 2nd kid is not as thrilling as the 1st.

With the birth of new baby, we had some more challenges to make sure baby No. 1 is happy. We have achieved this to large extent. With some caveats (see below). It’s almost unthinkable that Serenity will start kindergarden in the fall. Time flies. Enjoy it while we can. Leave the iDevices/mac if I can.

On personal finance front, I felt stretched a bit after the cost associated with new baby (hospital bill, etc.) and the preschool tuition for my older daughter. So in Sept. I made a painful decision to transfer Serenity to the preschool at church, which will save us some money. Initially I tried to bite the bullet and started some financial engineering such as refinance the mortgage (to get some cash). But it was not enough.

Reflect on my own mistakes on personal finance, mostly on playing the stock market, and over spend on things such as organic milk. I felt not very good. But again better late than never. I started shopping more on Aldi’s and try to control the discretionary spending. Also, for the stock market part, noticing the fall of oil and the DRIP (dividend re-investing program), I decided to put some money in Exxon Mobile Drip program. I also think about the performance of my self managed IRA account vs. the other 401k/Rollover IRA accounts managed passively (all mutual funds managed by professional money managers).

Career
I did not change job in the last year, hopefully I can stay at current place longer than past few years (change job almost yearly, see my year 2013 review, year 2012 review). Another important thing to consider is the feel of being challenged and learn new things, plus work/life balance.

Another interesting point is, since my wife seeing the benefits of the programmer job, and she is taking care of baby No. 2 full time now, she is thinking about learning java in her spare time. So hopefully we will have another IT professional in our household soon 🙂

Categories
iPhone app

Some tips for submit updated app to iTunes store post iOS8

Reading Time: 2 minutes

With (before) the release of iOS8, I noticed the iTunes Connect web interface has also been changed. But today is the first time I submit my app (update) to the store for last few months. There are some changes.

1) First, there is no “ready to submit app” button in the iTunes Connect, instead we just create a new version at ITC;

2) After that, we load the app to the app store, I used good old Xcode 5.1.1, which is the minimum version Apple requires now. Now here is a tip when submit from Xcode organizer, when I run “validate” before submit, it says I could not change “bundle” number, which I have not. Looking more carefully, it appears the good old Xcode 5.1.1 got confused with which app profile to use, and it picked the wrong one all the time. So I manually corrected it. After that I was able to upload the binary.

3) There is one more step, the actual “submit for review”, in the past the step 2) is sufficient. Now there is this extra step. In this step, it will ask questions similar to the questions being asked when we do “ready to submit” in the ITC in the past (before this change). In my case, since the app has “iAd”, it insists me check the Ad identifier selection, and after I check that, it let me submit (note I will try couple times, eventually I started over). But it appears not let me check “no” in the Ad section. This appears to be a glitch, I was able to submit my other 2 apps without any problem when checking no for the Ad identifier. There is another glitch though, that is I have to quit the app, before pick the newly added build, and submit for review. In summary, it appears ITC web page needs some work.

I will report more when/if I find anything new next time I submit app update. I noticed there is new marketing collaterals such as the preview video, and screenshots for 4.7/5.5 inch screen. My gut feeling is those will be required after this transition period. So hurry up if you have some app or update to release 🙂

(PS, 09-28-2014) One more thing, I noticed if I wanted to reject a binary (a build in new term), I need to create a new version. In the past, I could upload a newer binary with same version number. I think it’s probably a good idea to limit this back and forth. Note Apple added testFlight capability too. It should help app testing.

Categories
iPhone app

Why new Apple smart watch is not called iWatch?

Reading Time: < 1 minute

Here is my theory. Years ago I heard people in China mentioned “Apple Phone” (苹果手机), for iPhone. This is particularly true for older generation as their grasp of English is not as good as younger generation. So this time they decided just go with Apple Watch 苹果手表.

Note this is also their fourth main product category innovation since year 2000 : iPod, iPhone and iPad. If they stick with iWatch, the name will be too predicable. But this is secondary compared to the reason above, which is use their Apple logo, and name. Both are well known all over the world.

PS, saw this disturbing video about people lining up at Apple store for iPhone just for resell.

Categories
iPhone app

Calling restful POST PUT and DELETE methods in AFNetworking 2.0

Reading Time: 2 minutes

(Note 12-03-2015): for a more deep understanding of REST API and iOS usage of it, see this blog post by Mugunth Kumar. Very well written piece on REST. My tutorial below is meant to get hands dirty quickly on iOS web service calls 🙂

(Original 09-03-2014) Some example code here. For GET methods and AFNetworking 2.0 using a php web service, raywenderlich.com has an excellent tutorial. One problem I saw when I did this exercise is the service was expecting “application/json” for “Content-Type” (note the default is text/html, if we don’t specify in request serializer).


// POST method
-(IBAction)addBook:(id)sender
{
    // 1, note this is the base URL, typically it's the end point of REST web service
    NSURL *baseURL = [NSURL URLWithString:BaseURLString];
    NSDictionary *parameters = @{@"title": @"One Flew Over the Cuckoo's Nest",
                                 @"author": @"Ken Kesey",
                                 @"read": @false};
    
    // 2
    AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:baseURL];
    manager.requestSerializer = [AFJSONRequestSerializer serializer];
    manager.responseSerializer = [AFJSONResponseSerializer serializer];
    
    [manager POST:@"/book" parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
        self.title = @"Book added";
        _textView.text = [[NSString alloc] initWithFormat:@"Response JSON: %@", (NSDictionary *)responseObject];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"\n============== ERROR ====\n%@",error.userInfo);
        
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error adding book"
                                                                message:[error localizedDescription]
                                                               delegate:nil
                                                      cancelButtonTitle:@"Ok"
                                                      otherButtonTitles:nil];
        [alertView show];
    }];
}

- (void)setupForRemoveAndUpdateBook:(AFHTTPSessionManager **)manager_p bookIdString_p:(NSString **)bookIdString_p
{
    NSURL *baseURL = [NSURL URLWithString:BaseURLString];
    
    [_textField resignFirstResponder];
    
    int bookId = [_textField.text intValue];
    
    *bookIdString_p = [NSString stringWithFormat:@"/book/%i", bookId];
    
    *manager_p = [[AFHTTPSessionManager alloc] initWithBaseURL:baseURL];
    (*manager_p).requestSerializer = [AFJSONRequestSerializer serializer];
    (*manager_p).responseSerializer = [AFJSONResponseSerializer serializer];
}

// DELETE method
- (void)remove_book
{
    NSString *bookIdString;
    AFHTTPSessionManager *manager;
    [self setupForRemoveAndUpdateBook:&manager bookIdString_p:&bookIdString];
    
    [manager DELETE:bookIdString parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
        self.title = @"Book deleted";
        _textView.text = [[NSString alloc] initWithFormat:@"Response JSON: %@", (NSDictionary *)responseObject];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"\n============== ERROR ====\n%@",error.userInfo);
        
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error deleting book"
                                                            message:[error localizedDescription]
                                                           delegate:nil
                                                  cancelButtonTitle:@"Ok"
                                                  otherButtonTitles:nil];
        [alertView show];
    }];
}

-(IBAction)removeBook:(id)sender
{
    [self clear:nil];

    if (_textField.text == NULL || _textField.text.length==0) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Book ID required"
                                                            message:@"Please input the book ID"
                                                           delegate:nil
                                                  cancelButtonTitle:@"Ok"
                                                  otherButtonTitles:nil];
        [alertView show];
    }
    else {
        [self remove_book];
    }
}

// PUT method
- (void)update_book
{
    NSString *bookIdString;
    AFHTTPSessionManager *manager;
    [self setupForRemoveAndUpdateBook:&manager bookIdString_p:&bookIdString];
    
    NSDictionary *parameters = @{@"read": @true};
    
    [manager PUT:bookIdString parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
        self.title = @"Book updated";
        _textView.text = [[NSString alloc] initWithFormat:@"Response JSON: %@", (NSDictionary *)responseObject];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"\n============== ERROR ====\n%@",error.userInfo);
        
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error updating book"
                                                            message:[error localizedDescription]
                                                           delegate:nil
                                                  cancelButtonTitle:@"Ok"
                                                  otherButtonTitles:nil];
        [alertView show];
    }];
}

-(IBAction)updateBook:(id)sender
{
    [self clear:nil];

    if (_textField.text == NULL || _textField.text.length==0) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Book ID required"
                                                            message:@"Please input the book ID"
                                                           delegate:nil
                                                  cancelButtonTitle:@"Ok"
                                                  otherButtonTitles:nil];
        [alertView show];
    }
    else {
        [self update_book];
    }
}

Categories
iPhone app

iOS Objective-C interview questions

Reading Time: < 1 minute

I just throw some technical questions out here. Note Ray Wenderlich has a series on this. BlackPixel has an article too.

life cycle of UIViewController;

NSString property copy or retain?

frame vs bounds

category vs subclass

What is protocol (Apple doc; Ry’s Objective-C tutorial)? Create a protocol for List, and how to implement the “add” method for linked list (stackoverflow)?

block (how to avoid memory issue);

To be continued…