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
Ethereum_.pdf
nekomatu
0
460
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
580
Jakarta EE meets AI
ivargrimstad
0
140
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
C++でシェーダを書く
fadis
6
4.1k
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
Outline View in SwiftUI
1024jp
1
330
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
320
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Visualization
eitanlees
145
15k
A designer walks into a library…
pauljervisheath
203
24k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Building Adaptive Systems
keathley
38
2.3k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Rails Girls Zürich Keynote
gr2m
94
13k
Code Review Best Practice
trishagee
64
17k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Raft: Consensus for Rubyists
vanstee
136
6.6k
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