3. 自己紹介 1992年~1997年 某ゲーム会社 プログラマ SFC,GB,PS1,N64のゲーム開発経験 1998年~現在 日本工学院八王子専門学校 @mozmoz1972 専任講師 プログラミング教育を中心に担当 twitterもfacebookも実名です。よかったらフォローしてください。
1. 分からない。いくら説明を読んでも分からない。 ● 1.1. 未だに分からない Java 的オブジェクト指向 今日び Java 的オブジェクト指向の説明なんて星の数ほどあるような気がしますが、それでもなお「これで分かった!」という説明に辿りつけない不運な人がいるようですね。まぁこんだけ色々な説明が溢れていたら逆にどれを読めば良いのかワケ分からなくなってしまうのかもしれません。じっくり読んでも理解できなかったのであれば、きっとその説明と読者の相性が悪かったんでしょう。… というわけで、僕も Java 的オブジェクト指向が全っっっっ然これっぽっちも分からないという人に向けて説明する記事を書こうと思います。そうでない人には無価値な記事ですのでブラウザの「戻る」をクリックしましょう。 ● 1.2. 「オブジェクト指向」という名の南の島がある オブジェクト指向にはいくつもの専門用語があって、学習
Javaの例外処理で知らないと損する7つのテクニック:【改訂版】Eclipseではじめるプログラミング(24)(1/3 ページ) これからプログラミングを学習したい方、Javaは難しそうでとっつきづらいという方のためのJavaプログラミング超入門連載です。最新のEclipseとJava 6を使い大幅に情報量を増やした、連載「Eclipseではじめるプログラミング」の改訂版となります(この回と前回のみ、別連載「EclipseでJavaに強くなる」の改訂版です。今回は第4回Javaの例外のテクニックを知る」の改訂版です) 前回の「プログラマの宿命! 例外とエラー処理を理解する」では、Javaにおける例外の用途と基本的なコードの書き方、例外が発生するさまざまなケースについて理解しました。 今回は、独自に例外を定義する方法や、ちょっとした例外のテクニックを紹介します。 【1】Eclipseで独自の
はじめに Android プログラマのみなさん、こんにちは。 今日も元気に Out Of Memory してますか? ということで、この記事では日々 OOM に悩まされる Memory 的な意味で富豪的な Android プログラマの為に、Eclipse Memory Analyzer Tool、通称 MAT の基本的な使い方を紹介します。 尚、この記事は [twitter:@youten] さんが企画された裏 Android Advent Calendar 12/20 の記事ですが、内容的には比較的オモテなものになっています。 対象読者 Andoid アプリ作ってる/はじめたけど、まだ MAT を使ったことがない方 MAT を使ってみようした事はあるものの、画面から難しそうな雰囲気を察知し、起動10秒後にはそっとタブを閉じてしまった経験がある方 DDMS の基本的な使い方を理解している方
Androidアプリのテストに関する課題 Android端末の普及は世界規模で増加の一途をたどっています。2011年秋冬モデルが発表され、発売予定のものを含むと日本で発売中のAndroidの携帯端末は100機種に迫ろうとしています。読者の皆さんの周囲を見渡しても、電車や街角でAndroidを採用したスマートフォンなど携帯端末を使用する人をよく見かけるのではないでしょうか。 そして、スマートフォンに留まらずタブレットやミュージックプレイヤー、電子ブックリーダー、POSレジ、テレビなど、さまざまなデバイスがAndroidを搭載し始めています。Androidの採用が増えるにつれ、Androidアプリの種類が増えるので、アプリの開発案件も増えることになります。実際、本稿を読んでいる開発者の方の中にも、すでにAndroidアプリの開発に取り組んでいる方も多いのではないでしょうか。 筆者も普段の業務の
基金訓練の講師をやめました。基金訓練、今は求職者支援制度に名前が変わったみたいですけど、そこの講師をやめたというか、会社ごとやめて転職しました。 何の講師をやっていたかというと、今をときめく(?)Androidの講師です。 転職先にも少しなれてきて、今までのことを振り返って書き留めてみたのですが、せっかくなので発表することにしました。もともと僕だけが読むメモのつもりで書いたので、読みやすい文書ではないですがご容赦のほど。 Androidの講師になるまでAndroidの講師になるまでは、Javaのサーバーサイドのエンジニアをやっていました。 お客様のところに常駐し、システムの一部ではあるけど、自社メンバーだけで上流行程から担当し、僕はそのチームリーダーでした。 でも、このご時世なので、仕事がどんどんなくなっていきます。 プロパーの方でも仕事がないような状況で、それでも僕らのチームは半年ほどは
kazinaが作ってるWebサービスやソフトについての情報、プログラミングのメモなどをたまに。あとはAGAT18Kなどカメラやシルバーアクセ作りについて、映画についてなどなど駄文です。 時間のかかる処理、例えばネットから何かをダウンロードするアプリを作る場合、「通信中」「ダウンロード中」などのダイアログを表示し、キャンセル可能な状態にした上で、別スレッドを起動して実際の通信処理を行うということがよくあります。 Androidなら、メインのActivityから時間のかかる処理を行うThreadを生成し、そのrun()の最後に、メインのActivityへ終了を通知、Activityはダイアログを閉じる、といった流れになるかと思いますが、androidでこのまま実装してしまうと「Only the original thread that create a view hierarchy can t
JavaにはNullPointerExceptionなどのcatchしなくてもclass load validationを素通りできる例外があります。 バグの多くはそういった例外を考慮しないことのようです。 なので、今回はそういった例外の「IndexOutOfBoundsException」を発生させます。 ボタンをタップすると例外が発生します。 oobBtn.setOnClickListener(new View.OnClickListener(){ public void onClick(View v) { int index = 5; String[] strs = new String[index]; String str = strs[index];//ここでIndexOutOfBoundsException }});
Androidアプリでキャッチされなかった例外を処理する方法が下記のサイトに詳しく紹介されています。 throw Life - Androidアプリのバグ報告システムを考える 冬通りに消え行く制服ガールは、夢物語にリアルを求めない。 - Android でアプリケーションが強制終了したとき、エラーレポートを送るようにする 上記のリンクを参考に、例外のスタックトレースをメールで送信できるようにしてみます。 ボタンを押すと例外が発生し、アプリは強制終了します。 catchしなかった例外を補足するためにThread.UncaughtExceptionHandleを実装したCsUncaughtExceptionHandlerを作成します。 uncaughtException()メソッドで例外のスタックトレースをファイルに書き込みます。 SendBugReport()メソッドでファイルを読み込んでメ
一般的な検索システムの構成は以下のようになっている。 この内、インデクサの中は「HTML文章の解析」→「テキストの分析」→「画像の分析」→「検索用データ生成」となっている。 今回は「HTML文章の解析」を行う。 そもそもHTML文章とは? ウェブページを記述するためのマークアップ言語(=HTML)で記述された文章で、基本的な構造は <html> <head> <title>タイトル</title> </head> <body> <a href="URI">あいうえお</a> </body> </html> のように階層構造になっている。 どのようにプログラムを読み込むか 2つのアプローチ DOM(Document Object Model) XMLを読み込む別のAPIであるSAXと異なり、XMLデータをツリー構造として扱う事ができる。ただし、通常の場合対象のXML文書を全て読み込んでからの
HelloWorldやっても面白くねーんだよ!! 皆さんこんにちは。 Google App Engine (GAE)でJavaがサポートされ、 PythonはスルーしたけどJavaならやりたい!でもJava未経験! GAE/Jに手を出してみたけど、結局hello, world!のサンプルアプリを公開したまま 放置した状態になっていませんか? 僕はそうです! Java使えたら楽しいだろうなー Java覚えて仕事の案件こなしたいなー Java使えたらオブジェクト指向がもっとわかるだろうなー リア充へのあこがれ と、常々思っていつつも、Javaの最初の面倒臭さの前にいつもやる気喪失するんですよね。 HelloWorldひとつやるのにpublic static void main()書くなんて面倒臭すぎです コンパイルなんて面倒でやってられません eclipseの使い方憶えるのが面倒だし ecli
アクティビティ間の連携は、必ず使うことになるので。 明示的 起動したいアクティビティをパッケージ名とクラス名で直接指定する。 Intent intent = new Intent(helloworld.this,XXXXX.class); intent.setAction(Intent.ACTION_VIEW); startActivity(intent); コマンドラインから $ am start -n パッケージ名/.アクティビティクラス(com.suddenAngerSystem/.BroadCastIntentの様な) 暗黙的 起動したいアクティビティをインテントフィルタの属性とパラメータURIで指定する。 コマンドラインから $ am start -a アクション名(android.intent.action.EDIT等) -d content://xxxxx(file:/xxや
2010/09/06追記:id:gaeさんよりXMLのファイル名はキャメルケースにできない、という指摘を頂きました。XMLのファイル名は未検証のまま書いてしまっていたのでそれに関する記述を削除させて頂きました。 Androidの開発にもだいぶ慣れてきて、スムーズに開発できるようになってはいるのですが、冷静に自分の実装プロセスを分析するとまだまだ非効率だなあと感じる点が多々あったりします。効率化のためにADTを改造するかな、とも思ったのですが、それ以前に既存のEclipse+ADTの機能を活用して効率化できる部分がまだあるのではないかと考えて調査してみました。 その中で、これは使えそうかな、というEclipse+ADTでのAndroid開発効率化の小技をいくつか紹介します。 GotoFileプラグイン Androidで開発をしているとファイルを行ったり来たりすることが非常に多くなります。La
Flash Builder 4.5(アップデート版)購入を受けて、この際Eclipse上で触りそうな開発環境は全部ひとまとめにしてしまおう!って事で着手。導入した開発環境としてはこんな感じです。 環境 バージョン 用途 Eclipse Pleiades All in One 日本語ディストリビューション Eclipse 3.6.2 Helios SR2 Windows 32bit ベース Java作業全般 Flash Builder Flash Builder 4.5 Standard (Flash Builder 4 Standardからのアップグレード) Flexアプリ作成 AIRアプリ作成 Androidアプリ作成(AIR) Android Android SDK r11 & Android Development Tools Androidアプリ作成(Java) Groovy Gr
スマートフォンアプリ用の開発環境「Titanium Mobile」について学びましょう。Titanium(タイタニウムと読みます)は、米Appceleratorが提供する開発環境です。その大きな特徴はスマートフォンのアプリケーションやパソコンで動くアプリケーションをJavaScriptのみで開発でき、一つのコードでマルチプラットフォームに対応できる点です。 このTitaniumには、iPhoneやiPad、Android端末のアプリケーションを開発できるTitanium Mobileと、WindowsやMac OS X、Linuxといったパソコン用のアプリケーションを開発できる「Titanium Desktop」があります。ここではスマートフォンのアプリ開発の手助けになるTitanium Mobileを取り上げます*1。 スマートフォンアプリの開発には、iPhoneアプリならObjecti
この記事で、アルゴリズムの勉強はアルゴリズムカタログを覚えることじゃないよということを書きました。 プログラムの理論とはなにか アルゴリズムの勉強というのは、スポーツで言えば腕立て伏せや走り込みみたいな基礎体力を養うようなもので、「ソートなんか実際に自分で書くことないだろう」とかいうのは「サッカーは腕つかわないのに腕立ていらないだろう」とか「野球で1kmも走ることなんかないのに長距離の走り込みいらないだろう」とか言うようなものです。 Twitterでアルゴリズムの勉強とはなにかと尋ねられて、「アルゴリズムの基本的なパターンを知って、それらの性質の分析のしかたをしって、いろいろなアルゴリズムでどのように応用されているか知って、自分が組むアルゴリズムの性質を判断できるようになることだと思います。 」と答えたのですが、じゃあ実際どういう本で勉強すればいいか、ぼくの知ってる本からまとめてみました。
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く