投稿

AndroidでShoutCastサーバーにアクセスしてみた

思った以上に簡単だったのでメモメモ。。。 MediaPlayer mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setDataSource(url); mediaPlayer.prepareAsync(); mediaPlayer.setOnPreparedListener(new OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mediaPlayer.start(); } });

Xcode 4.2にしてみた

イメージ
【環境】 MacOSX 10.7.2 Xcode 4.0.1 【インストール手順】 1.App Storeを起動 2.Xcodeで検索 3.インストールボタンを押す 4.Lanunchpad→XcodeInstallを押す 以下の画面が表示されるので、『Update』を押す。 インストール完了すると、Xcodeが起動されるので、Xcode→『About Xcode』でバージョンを確認する。 以上でインストール完了。

CentOS のファイアーウォールの停止方法

ファイアーウォールのステータス確認 /etc/init.d/iptables status ファイアーウォールの停止 /etc/init.d/iptables stop ファイアーウォールの開始 /etc/init.d/iptables start

CentOS 5.5のnasマウント方法

sambaのパッケージをインストール。 yum -install samba-client マウントするディレクトリの作成(任意) mkdir /mnt/nas 作成したディレクトリにマウントする。 mount -t cifs -o user=(ユーザー名),password=(パスワード) //(IPアドレス等)/share /mnt/nas

Implementation of the USB 2.0 Controller not foundの対処法

VirtualBox 4.0.8 にバージョンアップ。 仮想マシン起動時に以下の様なメッセージが表示された。 Implementation of the USB 2.0 Controller not found どうやらVirtualBox 4.0.8 Oracle VM VirtualBox Extension Packがインストールされていなかったためらしい。 ここから(http://www.virtualbox.org/wiki/Downloads)をダウンロード&インストールで解決しました。

UIAvtionSheetのキャンセルボタンが効かない?

ツールバーがあるとActionSheetのキャンセルボタンの下半分がきかない。 変更前 UIActionSheet *actionSheet = [[UIActionSheet alloc] init]; actionSheet.title = @"タイトル"; [actionSheet addButtonWithTitle:@"決定"]; [actionSheet addButtonWithTitle:@"キャンセル"]; actionSheet.cancelButtonIndex = 1; actionSheet.destructiveButtonIndex = 0; actionSheet.delegate = self; [actionSheet showInView:self.view]; 変更後 UIActionSheet *actionSheet = [[UIActionSheet alloc] init]; actionSheet.title = @"タイトル"; [actionSheet addButtonWithTitle:@"決定"]; [actionSheet addButtonWithTitle:@"キャンセル"]; actionSheet.cancelButtonIndex = 1; actionSheet.destructiveButtonIndex = 0; actionSheet.delegate = self; [sheet showInView:self.view.window];

UIAlertViewをカスタマイズするには

イメージ
UIAlertViewのカスタマイズにつまずいたのでメモ。 通常UIAlertViewを表示したい場合、以下のようなコードを作成する...と思う。 UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"タイトル" message:@"メッセージ" delegate:self cancelButtonTitle:@"キャンセル" otherButtonTitles:@"決定", nil] autorelease]; [alert show]; サイズを変更したかったので、showメソッドの前でframeを変更する。 が、考慮されない模様。 UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"タイトル" message:@"メッセージ" delegate:self cancelButtonTitle:@"キャンセル" otherButtonTitles:@"決定", nil] autorelease]; alert.frame = CGRectMake(0,0,150,150);//サイズ変更が考慮されない [alert show]; どうやら[alert show]した後でないとカスタマイズできない。 なので、以下のようにUIAlertViewDelegateの- (void)willPresentAlertView:(UIAlertView *)alertViewの中でalertViewのサイズを変更する。 -(void)willPresentAlertView:(UIAlertView *)alertView{ CGRect alertFrame = CGRectMake(0,0,320,360); alertView.frame = alertFrame; } 当然ながらサイズを変更するとボタンの位置も変更したくなるので、以下のコードで無理...