Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
1ヶ月でAndroidカメラアプリ開発(3/4)
Search
sakebook
April 04, 2016
Programming
0
990
1ヶ月でAndroidカメラアプリ開発(3/4)
Adobe Creative SDKを使った写真加工アプリの開発のスライドです。全4回。
sakebook
April 04, 2016
Tweet
Share
More Decks by sakebook
See All by sakebook
私とスクラム私とコミュニティ私とOST
sakebook
0
37
目指せKotlin 100%
sakebook
1
2.3k
Make full use of Chrome Custom Tabs
sakebook
3
3.1k
Chrome Custom Tabsを使いこなそう
sakebook
1
2.4k
1ヶ月でAndroidカメラアプリ開発(1/4)
sakebook
1
1.8k
1ヶ月でAndroidカメラアプリ開発(2/4)
sakebook
0
1k
1ヶ月でAndroidカメラアプリ開発(4/4)
sakebook
0
950
Other Decks in Programming
See All in Programming
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
250
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
160
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
350
PagerDuty を軸にした On-Call 構築と運用課題の解決 / PagerDuty Japan Community Meetup 4
horimislime
1
110
Vue.js学習の振り返り
hiro_xre
2
130
qmuntal/stateless のススメ
sgash708
0
120
のびしろを広げる巻き込まれ力:偶然を活かすキャリアの作り方/oso2024
takahashiikki
1
410
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
1.5k
カスタムしながら理解するGraphQL Connection
yanagii
1
1.2k
生成 AI を活用した toitta 切片分類機能の裏側 / Inside toitta's AI-Based Factoid Clustering
pokutuna
0
580
Golang と Erlang
taiyow
8
1.9k
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
170
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
1.9k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
A Modern Web Designer's Workflow
chriscoyier
692
190k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
4 Signs Your Business is Dying
shpigford
180
21k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
664
120k
Building an army of robots
kneath
302
42k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Building Adaptive Systems
keathley
38
2.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
150
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Transcript
̍ϲ݄Ͱ ANDROIDΧϝϥΞϓϦ։ൃ @Trunk ञຊ৳ 2016/3/27
ຊͷྲྀΕ • ՝ͷ֬ೝ • Intent • Χϝϥݺͼग़͠ • ը૾ड͚औΓ •
ΪϟϥϦʔݺͼग़͠ • ΤσΟλʔىಈ • ը૾γΣΞ • (҉తIntentͷ݅ઃఆ)
՝ͷ֬ೝ
՝ • ͕ࣗ࡞Γ͍ͨΞϓϦͷϨΠΞτΛߟ͑ ࣮ͯ͠ΈΔ • ͕ࣗ࡞Γ͍ͨΞϓϦͷ͍͔ͭ͘ͷwidgetͰ ΠϕϯτϋϯυϦϯάΛઃఆ͢Δ
INTENT
INTENT • Activity(Component)ಉ࢜ͷΓͱΓʹ༻͍Δ • ผͷΞϓϦؒͰΓͱΓՄೳ • ༷ʑͳใΛ٧ΊΒΕΔ(੍ݶ͋Γ)
2छྨ͋Δ • ໌ࣔతIntent • ݺͼग़͍ͨ͠૬खΛComponent໊Ͱࢦఆ • ҉తIntent • ݺͼग़͍ͨ͠૬खΛػೳ͔Βࢦఆ
(ಥ)ֶߍʹྫ͑Δͱ • ໌ࣔతIntent • ʮࠤ౻͞Μͪΐͬͱདྷͯʯ • ରҰਓ • ҉తIntent •
ʮॏ͍ӡΔਓͪΐͬͱདྷͯʯ • ୭͕དྷΔ͔Θ͔Βͳ͍ • ෳਓདྷΔ߹͋Δ
Χϝϥݺͼग़͠
ͦͷ·͑ʹ • ΧϝϥONʹ͠ͳ͍ͱμϝ • ࣮ػͰͳ͍ͷͰ͓Εͳ͘
҉తINTENT • ʮΧϝϥ࣋ͬͯΔΞϓϦདྷͯʯ
ʮΧϝϥ࣋ͬͯΔΞϓϦདྷͯʯ • startActivityForResult • onActivityResultͰ ݁ՌΛड͚औΕΔݺͼग़͠ํ
• resultCode • Intent͕ظ௨Γऴ͔ྃͨ͠Ͳ͏͔
• requestCode • IntentΛૹͬͨૹ৴ݩΛผ͢Δࣈ
• data • IntentઌͰͷ݁Ռ͕٧ΊΒΕ͍ͯΔ (Nullable)
ը૾ड͚औΓ
BITMAPେ͖͍ • Bitmapը૾ͳͷͰ༰ྔ͕େ͖͍ • Intentʹ٧ΊΔʹ͍ۤ͠ • URIͰΓͱΓ͢Δ • https://ja.wikipedia.org/wiki/ Uniform_Resource_Identifier
ʮΧϝϥ࣋ͬͯΔΞϓϦདྷͯʯ • ʮͨͩ݁͠ՌfileUriʹೖΕ͍ͯͩ͘͞ʯ • Util.getOutputMediaFileUriͰ ݁ՌͷUriΛ࡞
URIΛੜ • GoogleͷνϡʔτϦΞϧ͔Βഈआ • https://developer.android.com/intl/ja/guide/ topics/media/camera.html#saving-media • આ໌ׂѪ
• fileUriʹͲΜͳ͕ೖ͍ͬͯΔͷ͔֬ೝͯ͠ ΈΑ͏ • ઌ΄ͲͱҟͳΓdatanullͳͷͰҙɻ
ΪϟϥϦʔݺͼग़͠
҉తINTENT • ʮը૾Ұཡ͕ݟ͍ͨʯ
ʮը૾Ұཡ͕ݟ͍ͨʯ • ݟ্ͨʹҰͭબ͍ͨ͠
• data.getData()Ͱ ΪϟϥϦʔ͔Βબͨ͠ը૾ͷUriΛऔಘ • ΧϝϥɾΪϟϥϦʔͲͪΒʹ͓͍ͯΤσΟ λʔىಈͷͨΊʹUriΛ͢
ΤσΟλʔىಈ
໌ࣔతINTENT • SDKͷComponentΛࢦఆ • ʮAviaryͷΤσΟλʔདྷͯʯ
ʮAVIARYͷΤσΟλʔདྷͯʯ • AdobeImageIntent • SDKͷΫϥε • Ճ͍ͨ͠ը૾ͷUriΛ͢
தΛݟΔͱ • AdobeImageIntent.class • AdobeImageEditorActivity.class • ಛఆͷCompomentΛࢦఆ͍ͯ͠Δɻ
• data.getData()ͰՃͨ͠ը૾ͷUriΛऔಘ • औಘͨ͠Uri͔ΒImageViewʹը૾Ληοτ
ը૾γΣΞ
҉తINTENT • ʮը૾ૹΓ͍ͨΜ͚ͩͲ୭͔ʯ
ʮը૾ૹΓ͍ͨΜ͚ͩͲ୭͔ʯ • setAction • ૹΓ͍ͨ • putExtra • ͢σʔλ •
setType • σʔλͷϑΥʔϚοτ
͜ΕͰಉ͡ • Χϝϥݺͼग़͠ʹࣅͯΔ
ڪΒͨ͘͘͞ΜԠ͢Δ • Twitter, Facebook, Instagram, LINE… • ͦͷબࢶ͕ԿΛҙຯ͢Δͷ͔ λΠτϧΛ͚ͭͯϢʔβʹ͔Γ͘͢͢Δ
None
• Intent.createChooserͰλΠτϧΛ͚ͭΒΕΔ • จࣈྻxmlͰఆٛͯ͠ಈతʹऔಘ͢Δɻ • res/values/strings.xml • جຊతʹϕλॻ͖͠ͳ͍
҉తINTENTͷ݅ઃఆ
Ͳ͏ͯ͠൴ΒԠ͢Δͷ͔ • ࣗͨͪͰ࡞ΕΔͷ͔ʁ ࡞Εͳ͍͕ͣͳ͍ɻ • ͔͜͠͠ͷΧϝϥΞϓϦ ԿʹԠ͠ͳ͍ • ҧ͍ʁ
ԠͰ͖Δ͜ͱΛهड़ • AndroidManifest.xmlʹ ͲͷComponent͕ ͳʹʹԠ͢Δͷ͔ఆٛ͢Δɻ
҉తINTENTͷ݅ઃఆ • ݅ઃఆ • Action • Category • Data
ACTION • ͲΜͳ͜ͱΛ͍ͤͨ͞ͷ͔ • Intent.ACTION_VIEW • ݟΔ • Intent.ACTION_SEND •
͢
CATEGORY • ͲΜͳΧςΰϦͷίϯϙʔωϯτʹ Ԡͯ͠Β͏͔ • Intent.CATEGORY_DEFAULT • ҉తIntentʹରԠ͍ͯ͠Δ • Intent.CATEGORY_LAUNCHER
• ϥϯνϟʔʹද͍ࣔͯ͠Δ
DATA • ίϯϙʔωϯτʹ͍ͨ͠Data • putExtra(String extra, Bundle data); • Intent.EXTRA_TEXT
• ACTION_SENDͰ͍ͨ͠Data(จࣈྻ) • Intent.EXTRA_STREAM • ACTION_SENDͰ͍ͨ͠Data(ϑΝΠϧύε)
DATA • setType(String mimeType) • ࣮ϑΝΠϧͤͳ͍ͷͰڭ͑Δඞཁ͕͋Δ • text/plain • ςΩετ
• image/jpeg • ը૾
ࢁ΄Ͳ͋Δ • https://developer.android.com/intl/ja/reference/ android/content/Intent.html
ઃఆྫ(ࣄྫͱͯ͠հ) • trunk://~ or http://~ ͷURLʹରͯ͠ɺ WebIntentActivityͱ͍͏ Component͕Ԡ͢Δ • ࣮ࡍड͚औͬͨޙͷॲཧඞཁ