Enviar pesquisa
Carregar
初めてのAndroid開発
•
Transferir como PPTX, PDF
•
0 gostou
•
1,832 visualizações
T
tanihiro
Seguir
Vista de apresentação de diapositivos
Denunciar
Compartilhar
Vista de apresentação de diapositivos
Denunciar
Compartilhar
1 de 45
Baixar agora
Recomendados
楽しく学ぼう公開鍵暗号方式
楽しく学ぼう公開鍵暗号方式
oroponya
SCSK クラウドビジネス - ハイブリッドクラウドを実現する PrimeCloud Controller
SCSK クラウドビジネス - ハイブリッドクラウドを実現する PrimeCloud Controller
Yoichi Takizawa
Wasbook読書会4章1,2節
Wasbook読書会4章1,2節
Atsushi Uchida
20111216 情報システム利用技術シンポジウム:講演資料
20111216 情報システム利用技術シンポジウム:講演資料
Atsushi ENTA
Cloudfoundryアップデート情報12月
Cloudfoundryアップデート情報12月
Uemura Yuichi
MacRubyとHotCocoaでMacのアプリを作ってみた
MacRubyとHotCocoaでMacのアプリを作ってみた
Yukimitsu Izawa
楽しいアプリ制作の会 #12 Windows Phone 開発
楽しいアプリ制作の会 #12 Windows Phone 開発
Tomonori Ohba
プロボノプロジェクト成功のポイント
プロボノプロジェクト成功のポイント
Etsuko Nagayama
Recomendados
楽しく学ぼう公開鍵暗号方式
楽しく学ぼう公開鍵暗号方式
oroponya
SCSK クラウドビジネス - ハイブリッドクラウドを実現する PrimeCloud Controller
SCSK クラウドビジネス - ハイブリッドクラウドを実現する PrimeCloud Controller
Yoichi Takizawa
Wasbook読書会4章1,2節
Wasbook読書会4章1,2節
Atsushi Uchida
20111216 情報システム利用技術シンポジウム:講演資料
20111216 情報システム利用技術シンポジウム:講演資料
Atsushi ENTA
Cloudfoundryアップデート情報12月
Cloudfoundryアップデート情報12月
Uemura Yuichi
MacRubyとHotCocoaでMacのアプリを作ってみた
MacRubyとHotCocoaでMacのアプリを作ってみた
Yukimitsu Izawa
楽しいアプリ制作の会 #12 Windows Phone 開発
楽しいアプリ制作の会 #12 Windows Phone 開発
Tomonori Ohba
プロボノプロジェクト成功のポイント
プロボノプロジェクト成功のポイント
Etsuko Nagayama
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Mais conteúdo relacionado
Destaque
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Destaque
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
初めてのAndroid開発
1.
はじめてのAndroid開発
2011/12/08 井谷裕紀
2.
はじめに 今回、環境構築の話はしません。 環境構築はここを見れば大丈夫! http://www.android- group.jp/index.php?%A5%EF%A1%BC%A5%AD%A5 %F3%A5%B0%A5%B0%A5%EB%A1%BC%A5%D7 %2F%A5%CF%A5%F3%A5%BA%A5%AA%A5%F3% A5%BB%A5%C3%A5%B7%A5%E7%A5%F3
3.
みなさん
4.
Androidは好きですか?
5.
愚問でしたね。
6.
そんなAndroid大好きなみなさん
7.
Androidと言えば なにを思い浮かべますか?
8.
愚問でしたね。
9.
機種依存
10.
というわけで まずは機種依存の話から
11.
そのためには、 Androidのディレクトリ構成を 理解する必要があります。
12.
0 ディレクトリ構成
プログラムファイル 自動生成ファイル Google API リソース(xml, 画像, etc.) アプリケーションを定義するファイル
13.
1. 機種依存
14.
1-1 よくある機種依存
解像度、dpi カメラ メール etc. 今回はまったの が、、、、、
15.
1-2-1 端末による解像度・dpiの違い
Androidは端末によって解像度やdpiが違います ※dpi = dot per inchの略。ピクセル解像度。 800x480 960x540 854x480 480x320 etc. 端末ごとの違いをどう吸収するか。 もっとも影響を受けるのはレイアウトで す。
16.
1-2-2 解像度・dpi別のリソースの管理
異なる解像度・dpiを吸収するためのもっともシンプ ルな方法は、それら毎に画像等のリソースを管理す ることです。 Androidには、複数のリソースを用意することで、そ の端末のdpiや解像度に合った適切なリソースを自動 で読み込む仕組みがあります。
17.
1-2-3 具体的な方法
res/drawable-ldpi 100〜140dpi res/drawable-mdpi 140〜180dpi res/drawable-hdpi 190〜250dpi res/drawable-nodpi DPIに依存しない画像 さらに応用すると・・・ res/drawable-320dpi 320dpi res/drawble-hdpi- 190〜250dpi 800x480 解像度:800x480 res/drawble-hdpi- 190〜250dpi 854x480 解像度:854x480 res/drawble-hdpi- 190〜250dpi 960x540 解像度:960x540
18.
あるAndroiderは言いました。
19.
普通に書けば、 機種依存問題なんてまず起こらない。
ただしカメラ以外。
20.
Androidには機種依存を吸収する仕組みが
ちゃんと用意されています。 その使い方さえ押さえておけば、 機種依存でそこまで深刻な問題は起きません。
21.
ただし カメラ以外。
22.
2. Android4種の神器
23.
2-1 Android4種の神器
Activity ユーザー・インタフェース(UI)を持つAndroidのア プリケーション・プログラム Service UIを持たず,連続的に情報を提供し続けるプログラ ム BroadcastReciever 外部のイベントに対して何らかの反応を返す ContentProvider データベースなど,特定の条件下においてデータを 提供する
24.
2-2-1 Activityとは
主にViewのことを指します。 Android上で表示されている画面はActivityです。 Activity
25.
2-2-2 Activityのライフサイクル Activityには、生成から始 まり、破棄で終わるまでの ライフサイクルがありま す。
26.
2-2-3 Activityを作成するには
Activityクラスを継承し、onCreate()メソッドを Overrideします。 public class SampleActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState { super.onCreate(savedInstanceState); // ViewをLayoutを定義しているxmlからセット setContentView(R.layout.main); } }
27.
2-3-1 Serviceとは
主にバックグラウンドで動作し続けるプログラムを 指します。 例) タイマー機能 音楽再生 目覚まし機能 etc.
28.
2-3-2 Serviceのライフサイクル Serviceにもライフサイ クルがあります。
29.
2-3-3 ServiceのBind
Serviceは通常、一度起動するとActivityからは停止す ることしかできません。 Bindという機能を使うと、ActivityからServiceが提供 するメソッドを実行することができます。
30.
2-3-4 Serviceを作成するには
Serviceクラスを継承し、onCreate(), onBind()を Overrideします。 public class SampleService extends Service { public void onCreate() { super.onCreate(); } @Override public IBinder onBind(Intent arg0) { // bind機能は使用しないのでnullを返す return null; } }
31.
2-4-1 BroadcastRecieverとは
外部からのイベントに応じて処理が発生するプログ ラム 電話が着信したときに何らかの処理を実行する 端末を再起動した際に何らかの処理を実行する etc.
32.
2-4-2 BroadcastRecieverを作成するには
BroadcastRecieverクラスを継承し、onRecieve()を Overrideします。 public class PgcwSampleReciever extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { } }
33.
2-5 ContentProviderとは
データを保存する際に使用します。 端末内のアプリ専用エリアに作成され、アクセス権 限を定義すれば他のアプリからも使用可能です。 システムのデータもこれで作成されています。
34.
3. Intent
35.
3-1 Intentとは
プロセスやスレッドを跨いだ処理を簡単に実現する ものです。 Activityを起動 Serviceを起動 etc.
36.
3-2 明示的Intentと暗黙的Intent
明示的Intent 直接起動したいClassを指定して呼び出す Intent intent = new Intent(context, class); 暗黙的Intnent 明示的に起動させるClassを指定せずにIntentのパラメー タに起動するClassをある程度推測できるだけの情報を入 れておくと、該当するClassが呼び出される Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(Uri.parse(“http://kayac.com”)); startActivity(intent);
37.
4. Out of
memory
38.
4-1 メモリとの戦い
Android開発はメモリとの戦いと言っても過言ではあ りません。 必ずと言っていいほど、メモリ問題にぶつかりま す。 そのほとんどの原因が・・・ 画像
39.
4-2 メモリリーク
Androidはメモリを明示的に開放することはできませ ん できないといういい方は正しくないかもしれません。 メソッドは用意されているのですが、あてになりません。 どうするか 来たるべきGCの時に備えて、 とにかく無駄に参照し続けるオブジェクトを持たないことです。
40.
4-3 開発に入る前のポイント
DEと相談しましょう 画像を多用しなくてもリッチに見える工夫 画像のダイエット処理 画像をダイエットさせるだけで、とっても効果あります 参考になるURL http://www.textdrop.net/soft/android-avoiding-memory- leaks/ http://andbrowser.com/development/knowhow/65/eclipse- android-memory-leak-mat/ http://tomokey.blogspot.com/2011/05/android.html
41.
5. サンプルアプリの紹介
42.
感想
43.
とってもよくできています。 とっつきにくさは感じませんでした。 JAVAを対して知らない僕でもそれなりに開発はでき ました!
44.
Android楽しいよ!!
45.
ご静聴ありがとうございました。
Baixar agora