Blogs

iOS 4.3 airplay 新增功能

以前 iOS 4.2 只可以 stream ipod 和 youtube 入面的video,用途實在不大。今之 iOS 4.3 增加了 api 讓 developer 加 video airplay 功能。但另一方面,原來 Photos 入面已經加了很多 airplay 功能,不單可以看用iphone 拍下的video,還可以觀看相片。

Tags:

Convert between NSData and NSDictionary

We can simplu use NSKeyedArchiver to serialize NSDictionary. To convert NSDictionary to NSData:


NSMutableData *data = [[NSMutableData alloc] init];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
[archiver encodeObject:yourDictionary forKey:@"Some Key Value"];
[archiver finishEncoding];
[archiver release];
/** data is ready now, and can use it **/
[data release];

To deserialize a NSData:

NSData *data = [[NSMutableData alloc] initWithContentsOfFile:[self dataFilePath]];

低價 iPhone 筆測試

測試了兩枝平價 iPhone 筆,希望對大家有用。

Streaming video on android

Playing streaming MP4 video from a URL is a piece of cake in iPhone, but not the case in android. Firstly you have to create your own activity to play video using MediaPlayer class. It is not difficult because there is sample code in the APIDemo projects in the SDK. However, after success to play it on my Nexus One with OS 2.2, I found that it won't play on my G1 with OS 1.6, with error "sorry,this video is not valid for streaming to this Device.."

Energizer XP8000

這個 Energizer XP8000 尿袋是之前朋友幫我在美國團購網站 http://www.woot.com 買的,買的原因只有一個,平。只需要 USD$45,再空郵到港約 HKD$500。這個尿袋聲稱有 8000mAH @ 3.7V,特別之處是除了 USB output,也有另外兩個接頭提供 12V 和 19V,可以幫 netbook 或 netbook 充電。
BATTERY1.JPG

包裝有很多的東東,USB 輸出是給電話或其他 5V 的設備。綠色的接頭是 12V 給 netbook,藍色的是 19V 給 notebook。我試過我的 netbook,notebook 也可以充電沒有問題。但跟機的接頭就沒有一個可以用於 Thinkpad,雖然它可以提供免費接頭,但我也要付郵費啊。
BATTERY2.JPG BATTERY3.JPG

Find My iPhone 設定,使用,及安全

Apple 今天發佈了 iOS 4.2,比較意外是今天起,iOS 4.2 的用家可以不需要申請 USD99 年費的 MobileMe 而使用 Find My iPhone 功能。Find My iPhone 是一個服務,當你不見了你的 iPhone, iPod Touch 或 iPad,你可以知道它的現在位置,或遙遠把機器上鎖或刪除所有資料。根據 Apple 說明應該只有新 iPhone 4,iPod Touch 和 iPad 才可以免費使用,但我試過在 3GS 上也可以免費使用,大家不防一試。



設定

用家先要在你要追蹤的 iPhone 設定免費 Mobile Me account
step1.png step2.png step3.png

Emoji keyboard on iPad is available on iOS 4.2.1

Emoji keyboard on iPad is back on the new iOS 4.2.1. Simply use the old spell number trick. Please check http://bit.ly/freeemoji for the detail instruction.

emoji_keyboard_4_2_1.PNG

Macbook Air 2010 11" 相片集

遲來的 Macbook Air 開箱文:

IMG_5526.JPG

Manually set the locale of an application in iPhone

The following code will change the locale of the application to Chinese. However, you must set it in the beginning of the app, and it will take effect in next launch of the app.


[[NSUserDefaults standardUserDefaults] setObject: [NSArray arrayWithObject:@"zh"] forKey:@"AppleLanguages"];

Manually set the locale of the application in Android

Android provides a flexible support of localization that system will load different resources according the locale of the current system configuration. However, sometimes we want to manually change the locale of our application especially for our Hong Kong market that people may want to have Chinese locale application in a English system configuration.

To do this, we can set the configuration of the application using the following code:

Header:

import android.content.res.Resources;
import java.util.Locale;

Syndicate content