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
iOSアプリエンジニアのためのAndroidアプリ開発
Search
cockscomb
December 03, 2015
Programming
7
1.8k
iOSアプリエンジニアのためのAndroidアプリ開発
Presented at Cocoa勉強会関西64 #cocoa_kansai
cockscomb
December 03, 2015
Tweet
Share
More Decks by cockscomb
See All by cockscomb
jq at the Shortcuts
cockscomb
1
1.7k
GraphQL放談
cockscomb
4
1.9k
GraphQL Highway
cockscomb
28
8.2k
吉田を支える技術
cockscomb
0
2.1k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.3k
ユーザインターフェイスと非同期処理
cockscomb
5
1.8k
GUIアプリケーションの構造と設計
cockscomb
10
10k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.4k
あなたの知らない UIKit の世界 — UITableView に UITextView を置きたい
cockscomb
1
7.3k
Other Decks in Programming
See All in Programming
役立つログに取り組もう
irof
28
9.6k
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
イベント駆動で成長して委員会
happymana
1
330
距離関数を極める! / SESSIONS 2024
gam0022
0
290
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
930
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Featured
See All Featured
Writing Fast Ruby
sferik
627
61k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
420
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Gamification - CAS2011
davidbonilla
80
5k
Building an army of robots
kneath
302
43k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Designing for humans not robots
tammielis
250
25k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Practical Orchestrator
shlominoach
186
10k
Transcript
iOSΞϓϦΤϯδχΞͷͨΊͷ AndroidΞϓϦ։ൃ
cockscomb
Hiroki Kato
None
iOSΞϓϦΤϯδχΞͷͨΊͷ AndroidΞϓϦ։ൃ
iOS Android
։ൃڥ Xcode iOS Simulator App Store Android Studio Emulator Google
Play OSS iOS Android
ϓϥοτϑΥʔϜ Mac (OS X) iPhone/iPad (iOS) Car Play Apple Watch
(watchOS) Apple TV (tvOS) Phone/Tablet Android Wear Android TV Android Auto iOS Android
։ൃݴޠ Swift Objective-C Java (Kotlin) iOS Android
Ϗϧυ xcodebuild ґଘཧ CocoaPods Carthage gradle iOS Android
gradle • Ϗϧυπʔϧ • build.gradleϑΝΠϧ • Android Studio͕αϙʔτ • ίϚϯυϥΠϯ͔Βར༻Ͱ͖Δ
Android
όʔδϣχϯά iOS 9 iOS 8 Earlier 6.0 (Marshmallow) 5.1 (Lollipop)
5.0 (Lollipop) 4.4 (Kitkat) 4.3 (Jelly Bean) 4.2 (Jelly Bean) 4.1 (Jelly Bean) 4.0 (Ice Cream Sandwich) Android
API Level Version Version Code API Level 6.0 MARSHMALLOW 23
5.1 LOLLIPOP_MR1 22 5.0 LOLLIPOP 21 4.4W KITKAT_WATCH 20 4.4 KITKAT 19 4.3 JELLY_BEAN_MR2 18 4.2 JELLY_BEAN_MR1 17 4.1 JELLY_BEAN 16 4.0.3, 4.0.4 ICE_CREAM_SANDWICH_MR1 15 4.0, 4.0.1, 4.0.2 ICE_CREAM_SANDWICH 14 Android
Fragmentation Earlier 9% iOS 8 24% iOS 9 67% Earlier
4.0% Ice Cream Sandwich 3.3% Jelly Bean 29.0% Kitkat 37.8% Lollipop 25.6% Marshmallow 0.3% iOS Android
Fragmentation • Support Library • ࠷৽ػೳͷόοΫϙʔτ • Google Play Services
• OSͱಠཱͨ͠API Android
ΞϓϦͷೖޱ UIApplicationMain Storyboard AndroidManifest.xml iOS Android
AndroidManifest <manifest package="info.cockscomb.myapplication" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"
android:label="@string/app_name" android:theme="@style/AppTheme.NoActionBar"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest> Android
ը໘ͷߏ୯Ґ UIViewController Activity Fragment iOS Android
Activity/Fragment • Activity • ը໘ʹͻͱ͚ͭͩ • Fragment • ActivityʹแͰ͖Δ Android
ϥΠϑαΠΫϧ UIViewController init viewDidLoad viewWillAppear viewDidAppear viewWillDisappear viewDidDisappear deinit Activity
onCreate onStart onRestoreInstanceState onResume onPause onSaveInstanceState onStop onDestroy iOS Android
Activityͷ࠶ੜ • Activity࠶ੜ͞ΕΔ • ը໘ͷճసͳͲͷมԽʹىҼ • ঢ়ଶΛࣦΘͳ͍Α͏ʹ࡞Δ • onSaveInstanceState •
Parcelable Android
ը໘ભҠ showViewController UIStoryboardSegue Intent FragmentTransaction iOS Android
Intent • ৽͍͠ActivityΛελʔτͰ͖Δ • γϦΞϥΠζՄೳͳύϥϝʔλ • ଞͷΞϓϦͷActivityελʔτ • ҉తͳIntent Android
Intent Intent intent = new Intent(this, MainActivity.class); intent.putExtra("extra_name_key", "cockscomb"); startActivity(intent);
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://example.com")); startActivity(intent); Android
Ϗϡʔ UIView View ViewGroup iOS Android
View/ViewGroup • View • ViewGroup • ViewΛแͰ͖Δ • แͨ͠ViewΛϨΠΞτ͢Δ Android
༷ʑͳϏϡʔ UIView View UILabel/UITextView TextView UITextField/UITextView EditText UIImageView ImageView UIButton
Button/ImageButton UIScrollView ScrollView UITableView/UICollectionView RecyclerView UIWebView/WKWebView WebView iOS Android
ϨΠΞτϑΝΠϧ Storyboard Nib (Xib) Layout XML iOS Android
Layout XML <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <EditText android:id="@+id/user_name" android:layout_width="match_parent"
android:layout_height="wrap_content" android:inputType="text"/> <EditText android:id="@+id/password" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPassword"/> <Button android:id="@+id/login_button" android:text="@string/action_sign_in" android:layout_width="match_parent" android:layout_height="wrap_content"/> </LinearLayout> Android
Ϗϡʔͱͷଓ Target Action @IBAction @IBOutlet android:id OnClickListener Data Binding iOS
Android
Data Binding Library <layout xmlns:android="http://schemas.android.com/apk/res/android"> <data> <variable name="user" type="com.example.User"/> </data>
<LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@{user.firstName}"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@{user.lastName}"/> </LinearLayout> </layout> Android
ϨΠΞτͷํ๏ Auto Layout Resizing Mask ViewGroup iOS Android
ViewGroup • FrameLayout • LinearLayout • RelativeLayout • GridLayout Android
αΠζຖͷ࠷దԽ Size Class Display Scale User Interface Idiom ໋໊نଇ ը໘ີ
ີඇґଘϐΫηϧ iOS Android
Ϧιʔεͷ໋໊نଇ • res/layout/login.xml • σϑΥϧτ • res/layout-sw800dp/login.xml • ը໘෯͕800dpҎ্ •
R.layout.login Android
ը໘ີ • xxxhdpi — 4.0 • xxhdpi — 3.0 •
xhdpi — 2.0 • hdpi — 1.5 • mdpi — 1.0 • ldpi — 0.75 Android
୯Ґ • dp (ີඇґଘϐΫηϧ) • 160dpi • sp (εέʔϧඇґଘϐΫηϧ) •
ઃఆ͞ΕͨςΩεταΠζʹൺྫ Android
༷ʑͳϦιʔε Asset Catalog Strings etc. Drawable R.drawable.ic_hamburger Values R.color.darkTextColor R.string.login
etc. iOS Android
Ϧιʔε • XMLPNG • छྨຖͷσΟϨΫτϦʹஔ͘ • ϨΠΞτ/ը૾/৭/αΠζ/Ξχϝʔ γϣϯ/ελΠϧ/จࣈྻ/ϝχϡʔ • R.xxx.yyy
Android
Drawable • BitmapDrawable • RoundedBitmapDrawable • NinePatchDrawable • ShapeDrawable •
VectorDrawable • AnimatedVectorDrawable • ColorDrawable • GradientDrawable • LayerDrawable • RippleDrawable • LevelListDrawable • StateListDrawable • AnimationDrawable • ClipDrawable • InsetDrawable • RotateDrawable • ScaleDrawable • PictureDrawable Android
ϑΝΠϧΞΫηε NSFileManager Context iOS Android
Context • ΞϓϦͱ֎෦ڥΛܨ͙ • Ϧιʔεͷऔಘ/ϑΝΠϧΞΫηε • Application/Activity/Service Android
Service • ը໘ͱಠཱͨ͠ॲཧ • όοΫάϥϯυͰಈ࡞Ͱ͖Δ • IntentService Android
ετϨʔδ File System Core Data SQLite Keychain Internal Storage External
Storage SQLite AccountManager Key Store iOS Android
ݖݶ PHPhotoLibrary .requestAuthorization(_:) ύʔϛογϣϯ iOS Android
ύʔϛογϣϯ • <uses-permission android:name="android.permission.INTERNET" /> • Runtime Permissions Android
ڞ༗ URL Scheme Open In Document Provider Extension Intent File
System Content Provider iOS Android
ςετ XCTest Unit Testing UI Testing Testing Support Library AndroidJUnitRunner
Espresso UI Automator iOS Android
iOS Android