tvOS tutorials collections

(10-06-2015 Update 2) Came across this one by tutsplus. Also the thoughts by Erica and savyapps.

(09-28-2015 Update) Came across this tutorial by madeupbypeople. Looks good. Also, note Xcode 7.1 beta 2 is coming out, along with iOS 9.0.1

(09-19-2015 Original) My Apple TV dev kit arrived. I haven’t done iOS dev for a while, not even get around the Apple Watch (I use a Fitbit Charge personally). But this new Apple TV thing seems really interesting, with all these TVML and TVJS things. There are not many tvOS tutorial right now, as this is really new and not many people get around it yet. But here are some I saw.

The following two both talked about TVML, TVJS and TVMLKit (the glue between TVML, JavaScript, and your native tvOS application per Kelvin Lau, see below). I know for traditional iOS developers Javascript may not be their favorite language (think Objective-C), but with the introduction of Swift, combined with the growth of popularity of Javascript in web development (both frontend and backend), we should at least pay attention to it. It’s much easier to setup a simple content navigation framework using Javascript and CSS (think websites) instead of Objective-C/Swift.

raywenderlich (Kelvin Lau @KelvinlauKL): Beginning tvOS Development with TVML Tutorial

Jameson Quave (@jquave)Developing tvOS Apps for Apple TV [Part 1] and Developing tvOS Apps for Apple TV [Part 2]

Mastering the tvOS Focus Engine: saw this at airbnb blog, this one is interesting because it talked about the focus and remote control. Note the game market is one focus of new Apple TV.

Quick Tip: How to use the remote control in your TVOS Apps for Apple TV in SWIFT

This one Hands-on with the tvOS SDK talked about porting iOS app to tvOS (note this is not a recommended approach). Nonetheless it’s interesting to see the gesture recognizer etc being discussed there.

I expect more tutorial and development on tvOS as we are close to the new Apple TV launch.

How to install Google Play Store on Amazon Fire Phone

One drawback of Fire Phone does not come with Google Play Store pre-installed. It comes with Amazon App Store instead, which has a much smaller collection. For instance, I could not find BoA app, wechat and all the Google apps there. Fortunately there is way to get around it, with the Google Play Store the Fire Phone becomes a middle range Android phone.

Make sure you do them in the right order: Account Manager, Services
Framework, Play Services, finally Play Store.
Account Manager
Services Framework
Play Services
Play Store
The first one you try to install (Account Manager) you’ll get a warning
it’s an unknown source and offer to take you to settings. Go to settings
and enable App Installation (allows installations from other sources (read
: Google Play))

Courtesy of qzmtl at mitbbs. This is the most simple instructions to install Play Store on Fire Phone. And I did it in 5 minutes or so.

Mobile Device Management

or MDM for the abbreviation. If you have read my blog for a while, you know I was a Blackberry fan, Blackberry was also my first Smartphone. The company (used to be Research In Motion) and the Blackberry has been in declining in recent years, and yesterday it announced buying the Good Technology (a rival mobile email technology provider). I have not used Good Technology based email myself, but have heard it being used in a few places I worked. Guess I was not important enough to carry a smartphone in those occasions :-)

Back to topic, Good Technology operates in a large space called Mobile Device Management, with a few competitors, MobileIron and AirWatch comes to mind for startups, then we have traditional players such as IBM and Citrix. I got to know MobileIron a few years ago as I was working on iOS dev and deployment and at the time, they have not IPOed yet. I looked at its stock price just now, and not surprisingly it did not do well. Just like Alex said in this Techcrunch article, it suggested this space is not gold mine. I knew AirWatch (which is bigger than MobileIron), was bought by VMWare in early 2014. If a company can go IPO, they would go IPO instead of being bought out. Of course this does not apply to Instagram and Whatsapp, as Facebook paid handsome money for them at the time. For Blackberry, it seems like a shrewd move as all these players are down at this moment, personally I felt MDM is a niche space that big player not necessarily want to crush startup, like Box or Dropbox situation (in that case, Google, Amazon, Microsoft Azure/OneDrive, and to less extent, Apple iCloud all compete). For BBRY, it seems like they just got some maintenance revenue to sustain for a while, while they try to turn around.

Don’t jail break the iPhone

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.

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.

iPhone backup photo extract and online photo backup

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.

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.

Chinese stock market, Robinhood trade referral

Note I have not talked about Chinese stock market for a long time (this is last time I talked, 2007 when I spent 6 months in China). It gets interesting lately because of its big drop and swing. Keep it a bit in perspective, the Chinese stock index Shanghai composite did not do well in last 5 or 10 years, compared to S&P 500 or Neikei. But last year it did very well, then followed by a big drop lately. I think a lot people just looked at the big drop, while forget about the 12 month or 5/10 year chart.

Robinhood, the free trade platform on smartphone, is giving some new invitations . Here is the Link, if you use it to sign up, you get $5 and I will get $5 too. So it’s a win win :-)

1-year chart (Shanghai Composite vs. Nikkei vs. S&P 500)

5-year chart (Shanghai Composite vs. Nikkei vs. S&P 500)

10-year chart (Shanghai Composite vs. Nikkei vs. S&P 500)

Work around for Excel lose leading and trailing zeros when importing csv data

This is from reddit. “…open a blank workbook in excel, then from the Data tab, under the “Get External Data” setting, choose “from text” and point it to your file. This will open the text import wizard. On the first step, choose “delimeted” and then “Next.” On the second, select the checkbox next to “Comma” then click “Next.” Now in the third step, the field should be shown, along with Excel’s best guess as to the data type. You’ll see that your numbered fields are shown as “General.” Click the column containing the numbers and change that field to “text.” Do this for all applicable fields that you want to save leading zeros for, then click “Finish.” (Excel truncates leading zeros if it thinks a field is a number. Leaving it as text will preserve the zeros.)…

My workaround is to stick an apostrophe (tick mark) for the numbers I want to keep the zeros. In other words that essentially make it a text by adding the tick mark.

iPhone 6 and 6+ models for use in China

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:



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

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


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


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

Sustainable software development II : rewrite and star performer

Developers usually like new project, sometimes called green field project, in the sense developers have more freedom to create (think of a white paper). In the same token, from time to time people will start a “full rewrite” project as the old project (code base) is “so messed up” and beyond repair. Is that real? A very high profile “rewrite” failure is the Netscape rewrite (see Joel Spolsky’s post here). And recently yours truly was involved in such “rewrite effort” as well. The result is also similar. I think not just developers, some managers also like the “rewrite” as well, due to various reasons. Some are valid, and some are not. Software (if it’s true software) usually lasts longer than people thought. In 2002, I visited my former workplace, a manufacturing place in Shanghai, and surprised to found they are still running my Foxbase/Foxpro based report generator, the the OS is Windows 3.1. At the time I worked on this (1994/1995), it saved 2 accounts, a few days of work (type calculators), each month. I bet they still used it for sometime after 2002, but I really doubt that will last till today, and the printer (Epison pin based) may not find punched hole printing papers :-)

Star Performer
I thought this problem for a while. I happened to listen to one podcast from “this agile life“, and read this article The surprising danger of being good at your job from yahoo/business insider, both helped me think more about this problem.

I think in software development world, it’s a very common phenomena, like @codinghorror said in this post “two types of progammers“, basically he is saying there 20% of developers are passionate about software development, 80% of them are there to get a pay check. But the star’s power and magic needs to be balanced or controlled, so that the teammates can also thrive and together the team can deliver something truly good.

Another related phenomena, is Lebron James in NBA. A few months ago we witnessed his heroics again. But Cavs did not win eventually. One reason I think is they are one man team. While their opponent Warriors are a real team.

Side note
Last week I received an email from my former boss asking me about a “magic number” I put in the code. I had to admit I messed up :-)