RAD Studioで始めるマルチデバイス・クロスプラットフォーム開発ワークショップKaz Aiso
RAD Studioは、Windows、Mac、iOS、Androidの4つのプラットフォーム向けのネイティブアプリケーションを効率的に構築できるビジュアル開発ツールです。統合開発環境のRAD Studioを用いることで、C++またはDelphiといった開発言語を使用し、複数デバイス向けの高性能アプリケーションを、一つのソースコードと、一つの基本UI設計ですばやく開発することができます。 このセミナーでは、マルチデバイス/モバイル開発のポイントを抑えながら、RAD Studioを用いてどのように実際の開発作業を行うのかを、演習を通して学ぶことができます。
RAD Studioで始めるマルチデバイス・クロスプラットフォーム開発ワークショップKaz Aiso
RAD Studioは、Windows、Mac、iOS、Androidの4つのプラットフォーム向けのネイティブアプリケーションを効率的に構築できるビジュアル開発ツールです。統合開発環境のRAD Studioを用いることで、C++またはDelphiといった開発言語を使用し、複数デバイス向けの高性能アプリケーションを、一つのソースコードと、一つの基本UI設計ですばやく開発することができます。 このセミナーでは、マルチデバイス/モバイル開発のポイントを抑えながら、RAD Studioを用いてどのように実際の開発作業を行うのかを、演習を通して学ぶことができます。
You can learn what can LabVIEW NXG Web Module do in this training slide. You can easily develop web application using Web Module.
LabVIEW NXG Web Moduleについて学習します。LabVIEW NXG Web Moduleを使用することで、スタイリッシュなウェブアプリケーションを簡単に開発することができます。
OESF Education Consortium is an organization promotes global Android engineer education. This presentation shows what OESF Education Consortium is, and how you can become our partner.
OESF Authorized Training Course official textbook
Course: Android Application Development Advanced
FULL VERSION
Language: English
Contributed by
Created by: TOPGATE Inc.
Edited by: ISB Vietnam Co.,Ltd.
[Attention!]
This textbook is licensed under the Creative Commons License BY-NC-SA 4.0. It is prohibited to use this material for commercial use otherwise you are OESF member or OESF education consortium member.
OESF Authorized Training Course official textbook
Course: Android Application Development Basic
FULL VERSION
Language: English
Contributed by
Created by: UL Systems Inc.
Edited by: Leading Edge Co.,Ltd.
Translated by: ISB Vietnam Co.,Ltd.
[Attention!]
This textbook is licensed under the Creative Commons License BY-NC-SA 4.0. It is prohibited to use this material for commercial use otherwise you are OESF member or OESF education consortium member.
Android Application WebAPI Development TrainingOESF Education
OESF Authorized Training Course official textbook
Course: Android Application WebAPI Development Training
FULL VERSION
Language: English
Contributed by
Created by: Leading Edge Co.,Ltd.
Translated by: ISB Vietnam Co.,Ltd.
[Attention!]
This textbook is licensed under the Creative Commons License BY-NC-SA 4.0. It is prohibited to use this material for commercial use otherwise you are OESF member or OESF education consortium member.
2. トレーニングの目的
Android で WebAPI を利用し、アプリケーション開発に必要な知識
を身につける。
WebAPI にアクセスをする方法
非同期による表示方法
レスポンスデータの解析方法
JSON
XML
サービスを使う
演習を通して、上記事項が必要な理由を体験する
演習で習得した一連の技術を全て使った動画ダウンローダアプリケーシ
ョンを作成する
This material is licensed under the Creative
Commons License BY-NC-SA 4.0.
ⅰ-2
3. トレーニングスケジュール
1日目
1章 トレーニング概要
2章 WebAPI開発知識
3章 チュートリアル
4章 ListViewの応用
5章 非同期処理
2日目
6章
7章
8章
9章
10章
Webサービスに接続する
JSON,XMLの解析
サービス
動画ダウンローダを作る
トレーニングのまとめ
This material is licensed under the Creative
Commons License BY-NC-SA 4.0.
ⅰ-3
4. 受講に必要なスキル
本セミナーを受講するにあたり、以下のスキルが必須となる。
Java 言語の経験があること
演習では、実際に Java でプログラミングを行う。
基本的な Java の言語仕様について理解していれば問題ない。
Eclipse を使用した経験があること
演習では、Eclipse を使用してプログラミングを実施する。
基本的な Eclipse の使用方法について理解していれば問題ない。
OESF公認Androidアプリケーション開発入門コースを受講済 ないし 同
等のスキルを有する。
Androidアプリケーションの基礎的なスキルを有する
複数画面からなる簡単なアプリケーション作成ができる
This material is licensed under the Creative
Commons License BY-NC-SA 4.0.
ⅰ-4
18. 動画サーバ構築手順(2)
Google App Engine SDK for Pythonのインストール
1. GoogleAppEngine-1.6.1msiを起動する
2. 「I accept the terms in License Agreement」にチェックをいれ 「Next」
をクリック
This material is licensed under the Creative
Commons License BY-NC-SA 4.0.
ⅰ - 18
27. WebAPI とは ?
Web Application Programing Interface
Web 上にあるアプリケーションプログラムインタフェースのこと
基本的にはリクエストにパラメータを付与して、JSON・XML データの
やりとりを行う
代表的な物として、Yahoo API、 Google API、 Youtube API などがあ
る
Get/Post で送信
JSON・XML で送
信
This material is licensed under the Creative
Commons License BY-NC-SA 4.0.
ⅰ - 27
32. レスポンデータの解析(XML:DOM
)
DOM(ツリー構造型)
DOM ツリーとしてヒープに持つ。
パース時に XML の内容をすべてメモリ上に保持し、パース後にどの要
素にもいつでもアクセスできる。
すべてをメモリ上に保持するために、多くのメモリを消費するので、
Android が稼働するモバイル機器では問題がある。
XML 文書が小さい場合は DOM を使用すれば簡単に実装できる。
おそ~い
DO
M
消費メモリが多い
This material is licensed under the Creative
Commons License BY-NC-SA 4.0.
ⅰ - 32
64. ListViewのサンプルアプリケーシ
ョン 1 (2)
プロジェクトの概要
項目
設定値
Project name
ListSample
Build Target
※トレーニングで指定したバージョン
Application name
ListSample
Package name
jp.oesf.listsample
Create Activity
ListSampleActivity
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 64
65. ListViewのサンプルアプリケーシ
ョン 1 (3)
手順
1. レイアウトファイルを修正する
ListViewを定義した画面デザインのレイアウトファイルを作成
ファイル名:activity_list_sample.xml
2. 行用のレイアウトファイルを作成する
ListView内で使用する、行デザインのレイアウトファイルを作成する
ファイル名:list_row.xml
3. 一覧表示のActivityを作成する
継承元をListActvitiyに変更する
ListActivityとAdapterを使用してデータをリストとして表示する
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 65
66. ListViewのサンプルアプリケーシ
ョン 1 (4)
1. レイアウトファイルを修正する
ListViewを定義した画面デザインのレイアウトファイルを作成
ファイル名:activity_list_sample.xml
View
Property
LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
ListView
android:id="@android:id/list" ※
android:layout_width="match_parent"
android:layout_height="wrap_content"
※ListActivityを使用する場合は必ずこのidにする
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 66
67. ListViewのサンプルアプリケーシ
ョン 1 (5)
2. 行用のレイアウトファイルを作成する
ListView内で使用する、行デザインのレイアウトファイルを作成する
ファイル名:list_row.xml
View
Property
TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
※list_row.xmlではTextViewしか使用しません
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 67
68. ListViewのサンプルアプリケーシ
ョン 1 (6)
3. 一覧表示のActivityを作成する
ListSampleActivityクラスの継承元をListActvitiyに変更する
ListActivityとAdapterを使用してデータをリストとして表示する
ArrayAdapterをセットする
public class ListSampleActivity extends ListActivity {
・・・
public static final String[] ITEMS = { "柴犬", "北海道犬", "甲斐犬", "紀州犬", "土佐犬",
①
"四国犬", "秋田犬", "縄文犬", "琉球犬", "川上犬", "薩摩犬", "美濃柴", "山陰柴", "まめしば" };
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list_sample);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
R.layout.list_row, ITEMS);
setListAdapter(adapter);
・・・
}
・・・
②
③
}
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 68
99. Handlerの使い方(2)
悪い例 2
HandlerインスタンスをUIスレッド以外で生成している
class BadThread2 extends Thread{
@Override
public void run() {
// ・・・時間のかかる処理 ・・・
//Threadで使用するのでfinal指定をする
final TextView tv = (TextView)findViewById(R.id.textView1);
//Handlerの定義
Handler handler = new Handler();
//Handler#postメソッドを呼び出すとrunメソッドの処理がUIスレッド上で実行される
handler.post(new Runnable() {
@Override
public void run() {
tv.setText("Hello Thread");
}
});
}
}
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 99
100. Handlerの使い方(3)
良い例
HandlerインスタンスをUIスレッドで定義し、postメソッド内でUIを操作して
いる
public class HandlerSample extends Activity {
// Handlerの定義
Handler mHandler = new Handler();
public void onClickThreadStart(View v) {
new GoodThread().start();
}
class GoodThread extends Thread {
@Override
public void run() {
// Threadで使用するのでfinalで指定する
final TextView tv = (TextView) findViewById(R.id.textView1);
// Handler#postメソッドを呼び出すとrunメソッドの処理がUIスレッドで実行される
mHandler.post(new Runnable() {
@Override
public void run() {
tv.setText("Hello Thread");
}
});
}
}
}
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 100
115. AsyncTaskのサンプル(2)
サンプルプログラム
public class AsyncSample extends Activity {
private TextView text;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//タイトルバーにインジケータを表示させる
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRES
S); ・・・①
setContentView(R.layout.activity_async_sample);
this.text = (TextView)findViewById(R.id.textView1);
this.text.setText("" + 0);
//AsyncTaskを実行する
new MyAsyncTask().execute("args as
doInBackground");
・・・②
}
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 115
116. AsyncTaskのサンプル(3)
サンプルプログラム
class MyAsyncTask extends AsyncTask<String, Integer, Boolean>{
@Override
protected void onPreExecute()
{
・・・④
//onPreExecuteではHandlerを使わずにUIを変更できる
//インジケータを表示する
setProgressBarIndeterminateVisibility(true);
}
@Override
protected Boolean doInBackground(String... params) {
Log.v("MyAsyncTask", "param:" + params[0]);
for( int i = 0; i <= 10; i++){
try {
//進捗状況の更新通知
publishProgress(i);
・・・⑥ −1
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();under the Creative Commons License BY-NC-SA 4.0.
This material is licensed
・・・③
・・・⑤
ⅰ - 116
117. AsyncTaskのサンプル(4)
サンプルプログラム
@Override
protected void onPostExecute(Boolean result) {
・・・⑧-1
//onPostExecuteではHandlerを使わずにUIを変更できる
if( result ){
text.setText("完了");
}else{
text.setText("失敗");
}
//インジケータを非表示する
setProgressBarIndeterminateVisibility(false);
・・・⑧-2
}
@Override
protected void onProgressUpdate(Integer... values) { ・・・⑥−2
//onProgressUpdateではHandlerを使わずにUIを変更できる
text.setText("" + values[0]);
}
}
}
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 117
135. AsyncTaskの中断(4)
3. Button押下時の処理にAsyncTask#cancel処理を実装
public class AsyncSample extends Activity {
……… 省略 ………
public void onClickCancelButton(View view){
task.cancel(true);
}
}
4. AsyncTaskのサブクラス内にAsyncTask#onCancelledメソッド内に中止
した時の処理を実装
onCancelledメソッドの実装
doInBackgroundでキャンセル判定処理の追加
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 135
136. AsyncTaskの中断(5)
public class AsyncSample extends Activity {
private TextView text;
……… 省略 ………
class MyAsyncTask extends AsyncTask<String, Integer, Boolean>{
……… 省略 ………
@Override
protected Boolean doInBackground(String... params) {
Log.v("MyAsncTask", "params:" + params[0]);
for (int i = 0; i < 10; i++) {
try {
if(isCancelled()){
break;
}
Log.v("MyAsyncTask", "i:" + i);
……… 省略 ………
}
@Override
protected void onCancelled() {
// インジケータを非表示にする
setProgressBarIndeterminateVisibility(false);
// TextViewに中止を設定
text.setText("中止");
}
}
This material is licensed under the Creative Commons License BY-NC-SA 4.0.
ⅰ - 136