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

Android M

Android M

Charla sobre novedades de Android M impartida en Cylicon Valley

Javier Gamarra

June 27, 2015
Tweet

More Decks by Javier Gamarra

Other Decks in Programming

Transcript

  1. Design Support Library • Snackbar -> fixing toasts and “manual”

    snackbars Snackbar.make(view, "Your message", LENGTH_SHORT) .setAction(getString(R.string.text_undo), this) .show();
  2. Design Support Library • FAB -> replaces “manual” libraries <android.support.design.widget.FloatingActionButton

    android:id="@+id/fab_normal" app:fabSize="normal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_plus" />
  3. Design Support Library • TabLayout -> tabs made easy <android.support.design.widget.TabLayout

    android:id="@+id/sliding_tabs" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabMode="fixed" app:tabGravity="fill" />
  4. Design Support Library • CoordinatorLayout & AppBarLayout -> automatic transitions

    and integration with toolbar (or FAB…) • Scroll actions like enterAlways • Parallax effect
  5. Design Support Library • Vector drawables (this is cool) ->

    better shapes • Only on M • But easy to animate!
  6. Design Support Library • And new support library version… ◦

    colorPrimary <3 • And new play-services… • And support annotations ◦ (Null, resources, threading, permissions…)
  7. App permissions Now you have to be aware of the

    permissions (and the chain of permissions!) • You define the permissions in the manifest (as always) • But there are NORMAL permissions and SPECIAL.
  8. App permissions Permission is requested on first use for SPECIAL

    permissions. • You have to check explicitly • You have to deal with revoking a permission ◦ Or the user deciding against granting it
  9. App permissions Only for M targeted builds! <uses-permission-sdk-m> Build.VERSION Context.checkSelfPermission(permission_name)

    Activity.requestPermissions(String[], int) public void onRequestPermissionsResult(...)
  10. App links • Host a JSON, including your fingerprint •

    And request the verification from your manifest Reference
  11. Data binding <layout> <data> <variable name="movie" type="com.nhpatt.androidm.model.Movie" /> </data> <LinearLayout

    ...> <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@{movie.title}" /> </LinearLayout> </layout>
  12. Data binding • Expression language! Like JSTL, JSF: concatenation, math

    expressions, comparisons, casts, method calls… Except this, new and super.
  13. Data binding “Live” data binding with Observable Objects: • inherit

    from BaseObservable • @Bindable in getter • notifyPropertyChanged in setter Or being a instance of ObservableField or ObservableArrayMap...
  14. Data binding Lots of more stuff: • Converters • Custom

    getters/setters • Dynamic binding • ... Reference
  15. Backup & restore • Google Drive • Every 24 hours

    • Opt out • Don’t do it with the registrationId
  16. Backup & restore Reference with the manifest and specify what

    to save: android:fullBackupContent="@xml/mybackupscheme" <?xml version="1.0" encoding="utf-8"?> <full-backup-content> <exclude domain="database" path="device_info.db"/> </full-backup-content>
  17. And more things... • Cloud test lab • Doze (testeable!)

    • Now on tap • API device unlock • Developer page • Lots.