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
27
8.1k
吉田を支える技術
cockscomb
0
2.1k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.3k
ユーザインターフェイスと非同期処理
cockscomb
5
1.7k
GUIアプリケーションの構造と設計
cockscomb
10
9.9k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.3k
あなたの知らない UIKit の世界 — UITableView に UITextView を置きたい
cockscomb
1
7.3k
Other Decks in Programming
See All in Programming
iOSの隠されたAPIを解明し、開発効率を向上させる方法/iOSDC24
noppefoxwolf
2
130
What we keep in mind when migrating from Serverless Framework to AWS CDK and AWS SAM
kasacchiful
1
130
dRuby 入門者によるあなたの身近にあるdRuby 入門
makicamel
4
340
XStateでReactに秩序を与えたい
gizm000
0
520
GoのIteratorに詳しくなってしまう
inatonix
1
190
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
1
1.1k
ESLint Rule により事業, 技術ドメインに沿った制約と誓約を敷衍させるアプローチのすゝめ
shinyaigeek
1
2.9k
rails_girls_is_my_gate_to_join_the_ruby_commuinty
maimux2x
0
170
rbs-inlineを導入してYARDからRBSに移行する
euglena1215
1
230
BasicBasic認証
sadnessojisan
5
3.1k
Swiftコードバトル必勝法
toshi0383
0
150
React + TextAliveでカッコいいLyric Applicatioinを作ろう!!
tosuri13
0
370
Featured
See All Featured
Designing with Data
zakiwarfel
98
5k
The World Runs on Bad Software
bkeepers
PRO
64
11k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Embracing the Ebb and Flow
colly
83
4.4k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
663
120k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
BBQ
matthewcrist
83
9.1k
Music & Morning Musume
bryan
46
6k
The Invisible Customer
myddelton
119
13k
How to Ace a Technical Interview
jacobian
275
23k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
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