2010年12月4日土曜日
2010年12月1日水曜日
2010年11月5日金曜日
Meeting Timer Original Now On Sale!!
自分の初回作 ミーティングタイマー Originalをようやくリリースすることができました。
本ソフトは、某ガイアの夜明けで紹介されたミーティングタイマー(会議時間の人件費をリアルタイム
で積算表示し、参加者に進行を促すツール)をベースに作成されています。
特徴的なのは、会議中にメンバが入れ替わっても、リアルタイムで人数が変更できるところにあります。
さらに国際版として1/100通貨への対応、会議時間の残り時間表示なども追加されています。
諸事情があり、あまり派手な宣伝ができないので、こっそりとつかってやってください。
2010年10月26日火曜日
YOUTUBEでの露出効果確認
YOUTUBEの場合、貼付けたサイトからの初アクセスを記録していてくれるため、どのサイトが効果があったのか、よくわかります。最近で行くとMixiの効果がたかかったのが判ります。
mixi全然つかってませんが、日本では良さそうですね。
2010年10月21日木曜日
JSON on the iPhone3 for HTTP POST using Objective-C
HTTP POSTのサンプルがなかなかなかったのですがありました。
http://efreedom.com/Question/1-1275883/Generating-JSON-Payload-POST-HTTP-Request-Objective-C
こちらはJSONを使わないタイプと思われます。このあと受け取ったものからJSON => NSDictionary変換をすればよいと思われます。
http://nagano.monalisa-au.org/?p=246
http://stackoverflow.com/questions/2346893/tutorials-for-using-http-post-and-get-on-the-iphone-in-objective-c
JSON以外
どうもAtomPubという方式もあるようです。
http://iphone.longearth.net/2009/08/16/【iphone】objective-cでatompubを簡単に操作できるライブラリ公開/
TwitterのOAuth認証
http://d.hatena.ne.jp/sugyan/20100422/1271879805
GoogleAPIエンジン
http://ja.w3support.net/index.php?db=so&id=471898
http://efreedom.com/Question/1-1275883/Generating-JSON-Payload-POST-HTTP-Request-Objective-C
こちらはJSONを使わないタイプと思われます。このあと受け取ったものからJSON => NSDictionary変換をすればよいと思われます。
http://nagano.monalisa-au.org/?p=246
http://stackoverflow.com/questions/2346893/tutorials-for-using-http-post-and-get-on-the-iphone-in-objective-c
JSON以外
どうもAtomPubという方式もあるようです。
http://iphone.longearth.net/2009/08/16/【iphone】objective-cでatompubを簡単に操作できるライブラリ公開/
TwitterのOAuth認証
http://d.hatena.ne.jp/sugyan/20100422/1271879805
GoogleAPIエンジン
http://ja.w3support.net/index.php?db=so&id=471898
JSON on the iPhone2
2009年に新しいJSONシリーズになったようです。新しいシリーズでの実装方法(含むサンプル)は、以下にあります。
http://iphonedevelopertips.com/networking/iphone-json-flickr-tutorial-part-1.html
http://iphonedevelopertips.com/networking/iphone-json-flickr-tutorial-part-1.html
2010年10月17日日曜日
JSON on the iPhone
では、iPhoneでJSONをどのように使うのか。
まず、当該サイトがJSONをサポートしているかが問題となる。各サイトのAPI仕様を参照されたい。
次に、当該サイトがJSONをサポートしているとしてiPhoneでのJSONライブラリを組み込む必要がある。
JSONライブラリとしては、JSON Framework、Touch JSONなどの複数が存在するが、ここでは比較的情報の多い、JSON Frameworkでの実装方法を確認したい。
1.JSONライブラリの入手
JSONライブラリは、現時点では以下から入手する。
http://github.com/stig/json-framework/downloads
2.プロジェクトを生成する(作成したいもの、テンプレートは任意)
3.JSONを組み込む
ダウンロードしたファイルのうちClasses配下のファイルを、生成したプロジェクトのClasses配下にJSONフォルダを作成し、コピーする。
*.mファイルには、以下のとおり、JSONヘッダを追記する。
#import "プロジェクト名ViewController.h"
#import "JSON/JSON.h"
@implementation プロジェクト名ViewController
4.データ要求とデリゲートを実装する(以下実装例)
#import
@interface LuckyNumbersViewController : UIViewController {
IBOutlet UILabel *label;
NSMutableData *responseData;
}
- (void)viewDidLoad {
[super viewDidLoad];
responseData = [[NSMutableData data] retain];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.unpossible.com/misc/lucky_numbers.json"]];
[[NSURLConnection alloc] initWithRequest:request delegate:self]; }
// 以下デリゲート
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
[responseData setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[responseData appendData:data];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
label.text = [NSString stringWithFormat:@"Connection failed: %@", [error description]];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
}
// デリゲート終了
- (void)dealloc {
[super dealloc];
}
@end
5.データを利用する(以下実装例)
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
[responseData release];
NSArray *luckyNumbers = [responseString JSONValue];
NSMutableString *text = [NSMutableString stringWithString:@"Lucky numbers:\n"];
for (int i = 0; i < [luckyNumbers count]; i++)
[text appendFormat:@"%@\n", [luckyNumbers objectAtIndex:i]];
label.text = text;
}
6.エラー処理を実装する(以下実装例)
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
[responseData release];
NSError *error;
SBJSON *json = [[SBJSON new] autorelease];
NSArray *luckyNumbers = [json objectWithString:responseString error:&error];
[responseString release];
if (luckyNumbers == nil)
label.text = [NSString stringWithFormat:@"JSON parsing failed: %@", [error localizedDescription]];
else {
NSMutableString *text = [NSMutableString stringWithString:@"Lucky numbers:\n"];
for (int i = 0; i < [luckyNumbers count]; i++)
[text appendFormat:@"%@\n", [luckyNumbers objectAtIndex:i]];
label.text = text;
}
}
詳細は以下を参照ください。
http://mobileorchard.com/tutorial-json-over-http-on-the-iphone/
まず、当該サイトがJSONをサポートしているかが問題となる。各サイトのAPI仕様を参照されたい。
次に、当該サイトがJSONをサポートしているとしてiPhoneでのJSONライブラリを組み込む必要がある。
JSONライブラリとしては、JSON Framework、Touch JSONなどの複数が存在するが、ここでは比較的情報の多い、JSON Frameworkでの実装方法を確認したい。
1.JSONライブラリの入手
JSONライブラリは、現時点では以下から入手する。
http://github.com/stig/json-framework/downloads
2.プロジェクトを生成する(作成したいもの、テンプレートは任意)
3.JSONを組み込む
ダウンロードしたファイルのうちClasses配下のファイルを、生成したプロジェクトのClasses配下にJSONフォルダを作成し、コピーする。
*.mファイルには、以下のとおり、JSONヘッダを追記する。
#import "プロジェクト名ViewController.h"
#import "JSON/JSON.h"
@implementation プロジェクト名ViewController
4.データ要求とデリゲートを実装する(以下実装例)
#import
@interface LuckyNumbersViewController : UIViewController {
IBOutlet UILabel *label;
NSMutableData *responseData;
}
- (void)viewDidLoad {
[super viewDidLoad];
responseData = [[NSMutableData data] retain];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.unpossible.com/misc/lucky_numbers.json"]];
[[NSURLConnection alloc] initWithRequest:request delegate:self]; }
[responseData setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[responseData appendData:data];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
label.text = [NSString stringWithFormat:@"Connection failed: %@", [error description]];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
}
- (void)dealloc {
[super dealloc];
}
@end
5.データを利用する(以下実装例)
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
[responseData release];
NSArray *luckyNumbers = [responseString JSONValue];
NSMutableString *text = [NSMutableString stringWithString:@"Lucky numbers:\n"];
for (int i = 0; i < [luckyNumbers count]; i++)
[text appendFormat:@"%@\n", [luckyNumbers objectAtIndex:i]];
label.text = text;
}
6.エラー処理を実装する(以下実装例)
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
[responseData release];
NSError *error;
SBJSON *json = [[SBJSON new] autorelease];
NSArray *luckyNumbers = [json objectWithString:responseString error:&error];
[responseString release];
if (luckyNumbers == nil)
label.text = [NSString stringWithFormat:@"JSON parsing failed: %@", [error localizedDescription]];
else {
NSMutableString *text = [NSMutableString stringWithString:@"Lucky numbers:\n"];
for (int i = 0; i < [luckyNumbers count]; i++)
[text appendFormat:@"%@\n", [luckyNumbers objectAtIndex:i]];
label.text = text;
}
}
詳細は以下を参照ください。
http://mobileorchard.com/tutorial-json-over-http-on-the-iphone/
登録:
投稿 (Atom)



