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

What's new in Android (Development) 2015?

What's new in Android (Development) 2015?

A talk given at Google IO Extended Yangon organised by GDG Yangon.
There are lots of New stuffs in Android. In this talk, I focused on what's new for Android Developers and what I found important for local developers.

Swan Htet Aung

June 21, 2015
Tweet

More Decks by Swan Htet Aung

Other Decks in Programming

Transcript

  1. Swan Htet Aung Software Engineer @ nex Product Manager Lead

    Android Engineer Lead Android Engineer .com
  2. app permissions App links Battery Android Pay Fingerprint AutoBackup Adoptable

    External Storage Devices Improved USB flash drive support Launcher and App drawer Dark Mode Quick Settings Notifications Doze and App Standby (power improvements) Direct Share Hotspot 2.0 Bluetooth Stylus support Text Selection Split keyboard for tablets Multi-window mode
  3. Icon with Bitmap Icon ic = Icon.createWithResource(context, R.drawable.ic_notification); 
 new

    Notification.Builder(context) .setSmallIcon(ic) … … … .build();
  4. App Link <intent-filter android:autoVerify=“true”>
 <action android:name=“android.intent.action.VIEW” />
 <category android:name=“android.intent.category.DEFAULT” />

    <category android:name=“android.intent.category.BROWSABLE” /> <data android:scheme=“http” android:host=“www.letshush.com”/> <data android:scheme=“https” android:host=“www.letshush.com”/> </intent-filter> http://developer.android.com/preview/features/app-linking.html
  5. Our dream (2014) • 5 hours • “OK Buddy” •

    used Pocketsphinx • had to develop custom Dictionary • hard to train • SpeechRecognizer is not good enough (may be I am dumb)
  6. <activity
 android:name="com.swanhtetaung.iotalk.VoiceReceiveActivity"
 android:label="@string/app_name">
 
 <intent-filter>
 <action android:name="com.google.android.gms.actions.SEARCH_ACTION" />
 
 <category

    android:name="android.intent.category.DEFAULT" />
 <category android:name="android.intent.category.VOICE" />
 </intent-filter>
 
 </activity> AndroidManifest.xml
  7. VoiceReceiveActivity.java Intent intent = getIntent(); 
 if (intent == null)

    {
 finish();
 } else {
 if (SearchIntents.ACTION_SEARCH.equals(intent.getAction())) {
 String query = intent.getStringExtra(SearchManager.QUERY);
 tvResult.setText(query);
 }
 }
  8. Voice Interaction • Check out System Actions reference https://developers.google.com/voice-actions/system/#system_actions_reference •

    Not enough? • Submit your Custom Actions https://developers.google.com/voice-actions/custom-actions What’s Next?
  9. activity_data_binding.xml <?xml version="1.0" encoding="utf-8"?>
 <layout xmlns:android="http://schemas.android.com/apk/res/android">
 
 <data>
 
 <variable


    name="movie"
 type="com.swanhtetaung.iotalk.databinding.Movie" />
 </data>
 
 <LinearLayout
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:orientation="vertical">
 
 <TextView
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:text="@{movie.name}" />
 </LinearLayout>
 </layout>
  10. Data Binding • Check out Data Binding Guide http://developer.android.com/tools/data-binding/guide.html •

    Play with Recycler/List views • Play with other Observable Objects What’s Next?
  11. Design Support Library • TextInputLayout • FAB • Snackbar •

    TabLayout • NavigationView • CoordinatorLayout • AppBarLayout • CollapsingToolbarLayout
  12. NavigationView • say Goodbye to Navigation Fragments with ListView •

    becomes part of MENU • place inside DrawerLayout
  13. activity_main.xml <android.support.v4.widget.DrawerLayout
 android:id="@+id/drawer_layout"
 xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 tools:context="com.swanhtetaung.iotalk.MainActivity">
 
 <FrameLayout


    android:id="@+id/container"
 android:layout_width="match_parent"
 android:layout_height="match_parent" />
 
 <fragment
 android:id="@+id/navigation_drawer"
 android:name="com.swanhtetaung.iotalk.drawer.old.NavigationDrawerFragment"
 android:layout_width="@dimen/navigation_drawer_width"
 android:layout_height="match_parent"
 android:layout_gravity="start"
 tools:layout="@layout/fragment_navigation_drawer" />
 
 </android.support.v4.widget.DrawerLayout>

  14. activity_new_drawer.xml <?xml version="1.0" encoding="utf-8"?>
 <android.support.v4.widget.DrawerLayout
 android:id="@+id/drawer_layout"
 xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:app="http://schemas.android.com/apk/res-auto"
 android:layout_width="match_parent"
 android:layout_height="match_parent"


    android:fitsSystemWindows="true">
 
 <FrameLayout
 android:id="@+id/container"
 android:layout_width="match_parent"
 android:layout_height="match_parent" />
 
 <android.support.design.widget.NavigationView
 android:id="@+id/nav_view"
 android:layout_width="wrap_content"
 android:layout_height="match_parent"
 android:layout_gravity="start"
 android:fitsSystemWindows="true"
 app:headerLayout="@layout/nav_header"
 app:menu="@menu/drawer_view" />
 
 </android.support.v4.widget.DrawerLayout>
  15. drawer_view.xml <?xml version="1.0" encoding="utf-8"?>
 <menu xmlns:android="http://schemas.android.com/apk/res/android">
 
 <group android:checkableBehavior="single">
 <item


    android:id="@+id/nav_home"
 android:title="Home" />
 <item
 android:id="@+id/nav_messages"
 android:title="Hot" />
 </group>
 
 <item android:title="Sub items">
 <menu>
 <item
 android:icon="@drawable/ic_media_play"
 android:title="Sub item 1" />
 <item
 android:icon="@drawable/ic_media_pause"
 android:title="Sub item 2" />
 </menu>
 </item>
 </menu>

  16. NewDrawer.java NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(
 new NavigationView.OnNavigationItemSelectedListener() {


    @Override public boolean onNavigationItemSelected(MenuItem menuItem) {
 menuItem.setChecked(true);
 mDrawerLayout.closeDrawers();
 return true;
 }
 });
  17. Design Support Lib • Check out ChrisBanes’ https://github.com/chrisbanes/cheesesquare • Start

    using design support libs in your projects • Support Material Design What’s Next?