SlideShare uma empresa Scribd logo
1 de 30
AOSP読んでみた Androidの仕組み
しがない受付係
Kaniyama_t2019/5/1
高専カンファレンス in 讃岐
1
ご注意
このスライド・発表の内容は間違っている可能性があります.
不備にお気付きの際は、webmaster@kaniyama.netへ御連絡ください
2
Kaniyama_t
進捗が生めない高専生
@Kaniyama_404
@Kaniyama-t
kaniyama.net
2019/5/1
事故哨戒
GWにラズパイで工作しようとした(`TωT´)ゞ
高専カンファレンス in 讃岐
3
Kaniyama_t
進捗が生めない高専生
@Kaniyama_404
@Kaniyama-t
kaniyama.net
2019/5/1
事故哨戒
なんかめっちゃRTされて嬉しい(`・ω・´)ゞ
高専カンファレンス in 讃岐
4
Kaniyama_t
進捗が生めない高専生
@Kaniyama_404
@Kaniyama-t
kaniyama.net
2019/5/1
事故哨戒
最近ブログサイトをGCEに移設しました(`・ω・´)ゞ
高専カンファレンス in 讃岐
URL:https://kaniyama.net/
5
2019/5/1
A
O
S
P
とは
高専カンファレンス in 讃岐
Android
Open
Source
Project
とは
スマホ上の
ソフトウェア
Androidとは
高専カンファレンス in 讃岐 6AOSPとは
スマホやタブレット(Android端末)のOS
GPS
画面
オーディオ端子
カメラ
スマホのセンサ application
規格ごとの差
が大きく、
アプリ開発が
困難
Android
画面表示関数
GPS取得関数
カメラ取得関数
画面表示
GPSを取得
カメラ取得
ハードとソフトのクッションを作る
Android Open Source Projectとは
高専カンファレンス in 讃岐 7AOSPとは
GPS
画面
オーディオ端子
カメラ
スマホのセンサ application
規格ごとの差
が大きく、
アプリ開発が
困難
Android
画面表示関数
GPS取得関数
カメラ取得関数
画面表示
GPSを取得
カメラ取得
・Androidに関係するソフトウェア全て
Android Open Source Projectとは
高専カンファレンス in 讃岐 8AOSPとは
GPS
画面
オーディオ端子
カメラ
スマホのセンサ application
規格ごとの差
が大きく、
アプリ開発が
困難
Android
画面表示関数
GPS取得関数
カメラ取得関数
画面表示
GPSを取得
カメラ取得
OSやスマホ本体のハードの特性を学べる
おもしろそう d(^ω°) (小並感)
9
2019/5/1
高専カンファレンス in 讃岐
AOSPを覗いてみる
Androidのカーネルコードを読んでみる
Androidをビルドしてみる
本題
10
2019/5/1
AOSPを覗いてみる
高専カンファレンス in 讃岐
高専カンファレンス in 讃岐 11AOSPを覗いてみる
URL:
https://source.android.com/
AOSPの公式サイト(英語)を覗いてみる
スマホの構造
高専カンファレンス in 讃岐 12AOSPを覗いてみる
Linux Kernel
HAL
Native
Library
Android
Runtime
Android
Framework
Application
Device (Physical)
Android Framework
Native Library・Android Runtime
Linux Kernel・HAL
スマホの構造
高専カンファレンス in 讃岐 13AOSPを覗いてみる
Linux Kernel
HAL
Native
Library
Android
Runtime
Android
Framework
Application Linux Kernel・HAT
Device (Physical)
GPS
画面
オーディオ端子
カメラ
スマホのセンサ
規格ごとの差
が大きく、
アプリ開発が
困難
Android
画面表示関数
GPS取得関数
カメラ取得関数
各ベンダーの提供する
ハードウェアを、
統一した窓口にする
システム
演算やメモリ制御
などの概念
スマホの構造
高専カンファレンス in 讃岐 14AOSPを覗いてみる
Linux Kernel
HAL
Native
Library
Android
Runtime
Android
Framework
Application Native Library
Device (Physical)
描画システム
SQLITE・SSL
C言語 標準ライブラリ
OpenGL,FreeType(フォント描画),
WebKit (HTML描画)
OpenGL,FreeType(フォント描画),
WebKit (HTML描画)
libc
スマホの構造
高専カンファレンス in 讃岐 15AOSPを覗いてみる
Linux Kernel
HAL
Native
Library
Android
Runtime
Android
Framework
Application Android Runtime
Device (Physical)
仮想マシン
Dalvik VM
各言語の標準ライブラリ
Java, Kotlin 等...
画像引用元:Androidの仕組み
を知る
(https://tech.nikkeibp.co.jp/it/
article/COLUMN/20091208/34
1738/)
スマホの構造
高専カンファレンス in 讃岐 16AOSPを覗いてみる
Linux Kernel
HAL
Native
Library
Android
Runtime
Android
Framework
Application Android Framework
Device (Physical)
APIの提供
View, Activity/Fragment
各種Manager etc...
Listener処理
OnClickListenerとかListener全般,
Observer等
applicationAndroid
画面表示関数
GPS取得関数
カメラ取得関数
画面表示
GPSを取得
カメラ取得
スマホの構造
高専カンファレンス in 讃岐 17AOSPを覗いてみる
Linux Kernel
HAL
Native
Library
Android
Runtime
Android
Framework
Application
Device (Physical)
フレームワーク
実行環境
Linux カーネル
18
2019/5/1
Androidのカーネル
コードを読んでみる
高専カンファレンス in 讃岐
高専カンファレンス in 讃岐 19Androidのカーネルコードを読んでみる
さっそくカーネルコードを読むぞ
!?
AOSP公式HPからはソースコードを
読めない...
コードを読む方法
高専カンファレンス in 讃岐 20Androidのカーネルコードを読んでみる
提供元 備考
本家 ソースのダウンロードはDeveloperサイトへ
Github 本家のミラーサイト
OESF OpenGrokなのでソースコードの検索に便利
GrepCode ソースコードの検索に使えます。ここはframeworksだけのようです。
Linaro Frameworkは本家と同じかと思うけど純正ではないはず
Android SDK Search
Chromeエクステンションですが、AndroidDeveloperサイトからのクラスの
ソースコード参照 (本家) が容易になります。
引用元:Androidのオープンソース(AOSP)を見る | Qiita
(https://qiita.com/okey01/items/89e575fc8e8ebab0e2bc)
コードを読む方法
高専カンファレンス in 讃岐 21Androidのカーネルコードを読んでみる
公式のツール
“repo”を使う方法
公式のGithubレポジトリ
を使用する方法
非公式のツールを
使用する方法
1.curl https://storage.googlea(略) > ~/bin/repo
2.repo init -u https://android.googlesource.(略)
3.repo sync
1.そのまんまGitHubに載ってます
2.gitコマンドで落とします
Webサイトからソースコードを検索することも可能で
す^^
OFFICIAL
EASY
USEFULL
Easybuild Difficultprepare
Difficultbuild Easyprepare
-build Difficultprepare
ビルドする為
この方法を
選択する
注意
初期同期操作が完了するまでに1時間以上かかります
高専カンファレンス in 讃岐 23Androidのカーネルコードを読んでみる
みんなは十分に時間と容量を用意して作業しましょう!
Androidいと凄し
…
Conoha VPS 1GBプラン
> 使用容量 21.11GB
> 同期時間 30 min.(作業時間込み)
Let’s Reed it!
高専カンファレンス in 讃岐 24Androidのカーネルコードを読んでみる
/ /bluetooth/bluedroid/Bluetooth.c
1
0
個人的に着目したところ
高専カンファレンス in 讃岐 25
Frameworkはjava
で
CI環境作りたい…d(=°ω°=)
全てが疎結合化されてます!
ブートローダー,ハード面はCで
26
2019/5/1
Androidをビルドする
高専カンファレンス in 讃岐
どうやってビルドするのか?
高専カンファレンス in 讃岐 27Androidのカーネルコードを読んでみる
$ make
How_to_build_android_OS
こ れ だ け
えっ...私のビルド...楽すぎ...
高専カンファレンス in 讃岐 28
オープンとはこういうことだ:
mkdir android ;
cd android ;
repo init -u git://android.git(略)manifest.git ;
repo sync ; make ※一部改変して意訳しています
ただし,依存環境に癖あり
高専カンファレンス in 讃岐 29
必要要件
・gnu-makeが3.8.1であること (3.8.2以降後方互換性が消えた為)
・jdk1.6.0が導入済みであること (1.7以上は不可)
・masterブランチはビルドできない
・repo init時にバージョン指定を行わ
ないとビルドできない
30
2019/5/1
結論
まだびるどできてない
高専カンファレンス in 讃岐
31
2019/5/1
結論
たのしかったー!
高専カンファレンス in 讃岐

Mais conteúdo relacionado

Último

ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学ssusere0a682
 
ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学ssusere0a682
 
TokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentationTokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentationYukiTerazawa
 
The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024koheioishi1
 
UniProject Workshop Make a Discord Bot with JavaScript
UniProject Workshop Make a Discord Bot with JavaScriptUniProject Workshop Make a Discord Bot with JavaScript
UniProject Workshop Make a Discord Bot with JavaScriptyuitoakatsukijp
 
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2Tokyo Institute of Technology
 
生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料
生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料
生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料Takayuki Itoh
 

Último (7)

ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
 
ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学
 
TokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentationTokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentation
 
The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024
 
UniProject Workshop Make a Discord Bot with JavaScript
UniProject Workshop Make a Discord Bot with JavaScriptUniProject Workshop Make a Discord Bot with JavaScript
UniProject Workshop Make a Discord Bot with JavaScript
 
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
 
生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料
生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料
生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料
 

Destaque

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd 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 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 IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...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
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

Destaque (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How 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 InsightsSocial 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 2024Trends 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 summary5 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 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 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 IntentGoogle'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 How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe 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...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

AOSP読んでみた ~Androidの仕組み~