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.9k
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.2k
コーポレートサイトを静的化して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
バグを見つけた?それAppleに直してもらおう!
uetyo
0
170
CSC509 Lecture 14
javiergs
PRO
0
140
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
260
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
快速入門可觀測性
blueswen
0
330
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
talk-with-local-llm-with-web-streams-api
kbaba1001
0
180
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
useSyncExternalStoreを使いまくる
ssssota
6
1k
Haze - Real time background blurring
chrisbanes
1
510
Featured
See All Featured
Become a Pro
speakerdeck
PRO
26
5k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Facilitating Awesome Meetings
lara
50
6.1k
Docker and Python
trallard
42
3.1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
A better future with KSS
kneath
238
17k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Gamification - CAS2011
davidbonilla
80
5.1k
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