Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOSアプリエンジニアのためのAndroidアプリ開発

cockscomb
December 03, 2015

 iOSアプリエンジニアのためのAndroidアプリ開発

Presented at Cocoa勉強会関西64 #cocoa_kansai

cockscomb

December 03, 2015
Tweet

More Decks by cockscomb

Other Decks in Programming

Transcript

  1. ϓϥοτϑΥʔϜ Mac (OS X) iPhone/iPad (iOS) Car Play Apple Watch

    (watchOS) Apple TV (tvOS) Phone/Tablet Android Wear Android TV Android Auto iOS Android
  2. όʔδϣχϯά 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
  3. 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
  4. 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
  5. 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
  6. ϥΠϑαΠΫϧ UIViewController init viewDidLoad viewWillAppear viewDidAppear viewWillDisappear viewDidDisappear deinit Activity

    onCreate onStart onRestoreInstanceState onResume onPause onSaveInstanceState onStop onDestroy iOS Android
  7. 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
  8. ༷ʑͳϏϡʔ UIView View UILabel/UITextView TextView UITextField/UITextView EditText UIImageView ImageView UIButton

    Button/ImageButton UIScrollView ScrollView UITableView/UICollectionView RecyclerView UIWebView/WKWebView WebView iOS Android
  9. 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
  10. 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
  11. ը໘ີ౓ • xxxhdpi — 4.0 • xxhdpi — 3.0 •

    xhdpi — 2.0 • hdpi — 1.5 • mdpi — 1.0 • ldpi — 0.75 Android
  12. Drawable • BitmapDrawable • RoundedBitmapDrawable • NinePatchDrawable • ShapeDrawable •

    VectorDrawable • AnimatedVectorDrawable • ColorDrawable • GradientDrawable • LayerDrawable • RippleDrawable • LevelListDrawable • StateListDrawable • AnimationDrawable • ClipDrawable • InsetDrawable • RotateDrawable • ScaleDrawable • PictureDrawable Android
  13. ετϨʔδ File System Core Data SQLite Keychain Internal Storage External

    Storage SQLite AccountManager Key Store iOS Android