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
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
110
CSC305 Lecture 26
javiergs
PRO
0
140
Jakarta EE meets AI
ivargrimstad
0
260
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
820
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
470
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
500
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
2
100
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
140
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
Featured
See All Featured
The Invisible Side of Design
smashingmag
298
50k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Writing Fast Ruby
sferik
628
61k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Practical Orchestrator
shlominoach
186
10k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
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