42
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 13 1 組み込みJava入門 § Java Embedded – Global Business Unit § 吉田 純子

Java Night Seminar

Embed Size (px)

DESCRIPTION

This presentation explains the Java ME technologies.

Citation preview

Page 1: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 131

組み込みJava入門

§ Java Embedded – Global Business Unit§ 吉田 純子

Page 2: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 132 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16

目次・自己紹介

・組み込みJavaのご紹介

・アプリを作ってみよう

・組み込みJavaのメリット

・まとめ

・Q&A

Page 3: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.3

自己紹介

入社4年目です!

好きなこと  ギター

    スキー プログラミング    デバッグ    OSカーネル

       

Sun Microsystems最後の新入社員です!!!!

Page 4: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 134

私のお仕事- 組み込みJVMの開発って?

ソースプログラム

プラットフォームA

JRE(JVM)

Javaアプリケーション(バイトコード)

JRE(JVM)

プラットフォームB

Javaアプリケーション(バイトコード)

Page 5: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 135

私が感じている、組み込み開発の醍醐味

自分が開発したJVMを乗せたデバイスが市場で販売されているのを見たとき

   新しいAPIの開発に携わることができてその結果新しいビジネスチャンスが生まれたとき

Page 6: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.6

組み込みJAVAのご紹介

Page 7: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 137

組み込みJavaはいろんなところで使われています!

パーソナルデバイス

センサー &マイコン

VoIP 通信

多機能組み込みデバイス

組込み機器向けクラウド

管理モニタリングオペレーション

スマート家電 &消費者家電

インターネットユーザー23億人*

3G契約11億回線**

ネット接続機器2020年

500億台***

*IDC調べ**Mobithink調べ

***エリクソン調べ

メーター車載産業用コントローラ &ネットワーク・アプライアンス

Page 8: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 138

組み込みJavaの種類

プラットフォームフットプリント

デバイスCPU/GPU/I-O

50KB-1MB

1MB-10MB

10MB-100MB

CLDCJ ava Ca rd

CDC

SE Em b e d d e d

Page 9: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9

Java Cardについて

プラットフォームフットプリント

デバイスCPU/GPU/I-O

50KB-1MB

1MB-10MB

10MB-100MB

J ava Ca rd

全世界で70億枚使われている!年間14億枚増加!!

Page 10: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10

CLDCについて

プラットフォームフットプリント

デバイスCPU/GPU/I-O

50KB-1MB

1MB-10MB

10MB-100MB

CLDC

世界で30億台!!

Page 11: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11

CDCについて

プラットフォームフットプリント

デバイスCPU/GPU/I-O

50KB-1MB

1MB-10MB

10MB-100MB

CDC

Java搭載TV 11億台!! Java搭載Blue-Ray機器 1億台!!

Page 12: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.12

Java SE Embeddedについて

プラットフォームフットプリント

デバイスCPU/GPU/I-O

50KB-1MB

1MB-10MB

10MB-100MB SE Em b e d d e d

Page 13: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13

組み込みJavaの種類

プラットフォームフットプリント

デバイスCPU/GPU/I-O

50KB-1MB

1MB-10MB

10MB-100MB

CLDCJ ava Ca rd

CDC

S E Em b e d d e d

これが現在のJava MEとSEの境界です!

Java ME

Page 14: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1314

組み込みJ ava プラットフォーム(2 01 3年)

Sm a ll Em b e d d e d(携帯電話、メーター、

通信モジュール等)

Mid Em b e d d e d(テレビ、STB、 ネットワーク機器、M2M、プリンタ等)

Hig h Em b e d d e d(スマートフォン、

タブレット、医療/工業機器、

組み込みサーバー等)

プラットフォームフットプリント

デバイス CPU/GPU/I-O

50KB-1MB

1MB-10MB

10MB-100MB

J a va ME 8J ava Ca rd

J ava SE 8

Page 15: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1315

始めてみよう!

組み込みJava!!

Page 16: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16

本日のレシピ

CLDCで携帯アプリをつくってみよう♪

必要なもの

● Java SE JDK (Java SE7 update 9)● SDK (NetBeans, Eclipse)● 好奇心!

Page 17: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.17

本日作りたい画面

Page 18: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.18

SDKのダウンロード(NetBeans)

http://ja.netbeans.org/downloads/index.html

Page 19: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19

SDKのダウンロード

Page 20: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.20

SDKのダウンロード

Page 21: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.21

SDKのインストール

Page 22: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.22

既にNetBeansをお使いの方は..Plug inをインストール!

http://www.oracle.com/technetwork/java/javame/javamobile/download/sdk/index.html

Page 23: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.23

SDKインストール終了後...

Page 24: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.24

プロジェクト作成(1)

ファイル → 新規プロジェクト作成

Page 25: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.25

プロジェクト作成(2)

変更箇所

カテゴリ : Java MEプロジェクト: モバイルアプリケーション

Page 26: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.26

プロジェクト作成(3)

変更箇所

プロジェクト名プロジェクトの場所(保存先)

Page 27: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27

プロジェクト作成(4)

Page 28: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28

CLDCのソースコード(1)

startApp()       アプリ起動時に呼ばれる。

変数やオブジェクトなどの初期化を行う。

Page 29: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29

CLDCのソースコード(2)

pauseApp()       アプリ休止状態に入った時に呼ばれる。

アプリがアクティブ状態の時のみこのメソッドが呼ばれる。

Page 30: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.30

CLDCのソースコード(3)

destroyApp()       アプリ終了時に呼ばれる。 全てのリソースを開放する。 必ずしも全てのリソースを開放しなくて 良い場合はunconditionalをfalseに指定

Page 31: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.31

CLDCでHelloWorld! (1)import javax.microedition.midlet.*;import javax.microedition.lcdui.*;

public class Midlet extends MIDlet {

private Display display; private Form mainForm; public void startApp() { display = Display.getDisplay(this); mainForm = new Form("Title"); mainForm.append("Hello World!"); display.setCurrent(mainForm); } public void pauseApp() { } public void destroyApp(boolean unconditional) { }}

システムのディスプレイや入力装置、フォント、ユーザーインターフェース作成

などが含まれるパッケージ。アプリ作成で必ず必要!

Page 32: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.32

CLDCでHelloWorld! (2)import javax.microedition.midlet.*;import javax.microedition.lcdui.*;

public class Midlet extends MIDlet {

private Display display; private Form mainForm; public void startApp() { display = Display.getDisplay(this); mainForm = new Form("Java Night Seminar"); mainForm.append("Hello World!"); display.setCurrent(mainForm); } public void pauseApp() { } public void destroyApp(boolean unconditional) { }}

ディスプレイ作成1つの アプリ に対して1つの Display オブジェクトが存在

Page 33: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.33

CLDCでHelloWorld! (3)import javax.microedition.midlet.*;import javax.microedition.lcdui.*;

public class Midlet extends MIDlet {

private Display display; private Form mainForm; public void startApp() { display = Display.getDisplay(this); mainForm = new Form("Java Night Seminar"); mainForm.append("Hello World!"); display.setCurrent(mainForm); } public void pauseApp() { } public void destroyApp(boolean unconditional) { }}

Formオブジェクトを作成しその中に”HelloWorld”を入れる。

Displayオブジェクトがformを表示するよう指定

Form クラス任意のアイテム(イメージ、編集可能なテキストフィールド、編集可能な日付フィールド、選択グループなど)を載せるためのスクリーン。

Page 34: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.34

CLDCでHelloWorld! (4)

実行してみよう!!!実行ボタン

Page 35: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.35

CLDCでHelloWorld! (4)

Page 36: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.36

CLDCのパッケージ

java.langjava.iojava.util

標準パッケージ

javax.microedition.midletjavax.microedition.lcdui

アプリ作成に必ず必要なパッケージ

その他CLDC特有のパッケージ

● javax.microedition.location → GPS● javax.bluetooth → Bluetooth● javax.microedition.media → 音楽プレーヤー、音声録音など● javax.microedition.amms.control.camera → カメラ機能● javax.microedition.pim → アドレス帳

Page 37: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.37

組み込みJavaのメリット

Page 38: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1338

組み込みにJavaを採用するメリット

1 組み込みからサーバー側(EE)まで、同じプログラミング言語で実装できる

2 開発環境の移行にも対応

3 デバイスが開発中でも、先にアプリ開発を進められる

旧OS

旧ハードウェア

アプリ

ハードウェア

新OS

アプリ

¥

n 新しいOS向けにアプリ書き直し

新しいOSに載せ替える場合

旧OS

旧ハードウェア

Java VM

Javaアプリ

新OS

ハードウェア

Java VM

Javaアプリ

Javaを使用した場合

OSが変わってもアプリの書き直し不要

汎用PCならJava VM費用は無料!

Page 39: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1339

組み込みにJavaを採用するメリット

1. 組み込みからサーバー側(EE)まで、同じプログラミング言語で実装できる

2. 開発環境の移行にも対応

3. デバイスが開発中でも、先にアプリ開発を進めることができる

まだ開発中... アプリ開発は進められる!

Page 40: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1340

まとめ

● 組み込みJavaはそんなに怖くない

● JavaSEのプログラムが書ければ、組み込みJavaも大丈夫!!!

● 組み込みJavaのお陰で、彼女が出来ました(東京都・26歳・男性)

Page 41: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1341 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16

Q&A

Page 42: Java Night Seminar

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1342