Time Card
Thanks Giving 4連休の宿題のひとつは、 NFC を使って Android アプリをつくってみる、にしていた。
何かしはじめると時間の経つのが刹那のごとくで、それは脱線して YouTube にある無限 Watch it later リストにトラップされたり、風呂でえんえんと Kindle / iPad でコンテンツを消費している時間にもあてはまる。
はたして1日を有意義につかえてるんだろうか… かんたんに自分がやっていることを記録できたらいいんじゃないか。そういえば、4年前に Twitter の tweets を iCal で表示させる ていうのを試みたんだけど、いちいちキーボードを叩いて (マイクに話しかけて) tweet するというのはめんどうで、めんどうなことは続かない。
そのへんにある NFC タグ (Suica, PiTaPa, Clipper, …) を使って、それぞれに何をやっているか、というコンテキストを割り当てる。 Android でタグにタッチするとそのコンテキストがはじまり、もう一度タッチするか別のタグにタッチするとコンテキストが変わる、というのをやってみたらどうかと考えた。ばしっと Android なケータイを Suica に叩きつけるだけだ。めんどうさは少なくなるはず。
で、つくってみた。
左は、それぞれのコンテキストに費やした時間がどれくらいか、時系列に並べている様子。右は、新しい NFC タグをコンテキストに当てはめる画面。
やってみると、なかなか手軽に記録がとれていい。画面をタッチする必要すらないのだ (ただし Android デバイスはスリープから解除されていないといけない)。小さな画面をちまちま触るところから、3歩くらい進化している感じを受ける。
やっかいになるのは、コンテキストごとの NFC タグを持ち歩かないといけないということ。とはいえこれは些細だろう。都市部のひとなら財布に NFC なカードを2-3枚は常に入れているだろうし…
Feasibility study としてのプロトタイピングはできた。あとやるとしたら、その日いちにちの、それぞれに費やした時間を合計して Pie Chart で表示する、とか。自分のやる気の傾向を棒グラフで表示する、とか。もっとビジュアライズしたい。
コードは Github:mootoh/TimeCard に。
はじめてまじめに Android アプリの開発をやってみた。仕事でも Android (と iOS ) のコードを書いてはいるのだけれど、それは中間層づくりなので、アプリをつくるなかで分かることがいちいちある。
- UI づくりの作法がまるで iOS のと違うのでいちいち調べる必要があって、手が遅かった。 Adapter とか LayoutParams とか
- Interface Builder はすばらしくできていたんだなぁ
- いわんや UIKit をや
- Eclipse は機械に仕事させてる感があってとてもよい。 Eclipse があるなら Java も悪くない、というかがぜん生産性高い (C++ 比)
つくりたいものがあって、その UI を iOS と Android の両方でつくろうとしたら、やり方がまるで違ってわりとストレスになる。両方を同じテイストで、ひとりの人がつくるには、さっと取り出せないといけない知識が膨大で、なかなか大変だ。そりゃ Titanium などが流行るわけだよ。
開発者としてみたときの Android の美点は、 Intent の仕組みおよび Service (バックグラウンド処理) と、その気になればなんでもできそう (な気にさせられる) ところだろう。ダメなところをスルーしつつ、良いところの恩恵を素直に享受したい。
しかしこればかりやっていたために、他にやろうと思っていた他の宿題はこなせなかったな… Node.js さんともっと仲良くしたい。
iPhone 4 -> Nexus S
Since the iPhone 4 I had been using for a year got broken on both front and rear glasses, I started using Nexus S (OS 2.3.6) for my main mobile phone. Outlined an impression of 5days trials.
Pros
In a word: convenient.
- Asynchronous. Just after pressing a button to send a tweet, I can safely switch to see Facebook. I do not have to wait for single task to be completed.
- Intent. We can choose the destination of what we take with a Camera app. Openness to the future, for the developers, facsinating.
- Widget. My home screen has Google quick bar, Remember the milk tasks, and Calendar. I don’t want to see the badge count saying just how many tasks I have today, or what day today is. To glance at everything at once is useful to catch the whole context.
- Map app has bicycle direction navigation.
- Car navigation speaks.
- Developer friendly. we can launch an app by adb command from command line.
- Submitting an app is painless and fast since there is no review.
- Gentle in shape. iPhone 4 is solid, and Nexus S is rounded.
So so
Call quality is as good as iPhone 4.
Cons
- Font. I love Hiragino on iOS. I know it could be better if I rooted though.
- Japanese Input method. Simeji is well crafted, but it requires two or three more taps to switch IM than iOS does.
- Address Book. Sync between Address Book in Mac and Contact List in GMail is just a nightmare.
- Misses Omni Focus. I’m back to the days using Remember the Milk after 2 years.
- Official Twitter app does not support the pic.twitter.com photo sharing.
- Edge network is so very slow. I installed the micro AT&T SIM for iPhone 4 to the mini SIM slot of Nexus S. After several trials, it worked well. However, it can just connect to the Edge network, not 3G.
- No built-in timer app.
- No good instapaper app
- I’m always screwed up in editing UI layout on Eclipse.
Overall, I’m satisfied with its functional aspect. I would lean to purchasing Galaxy Nexus over iPhone 4S, especially if they provided SIM free one.


