Android Marshmallow na prática
-
Upload
ramon-ribeiro-rabello -
Category
Mobile
-
view
547 -
download
5
Transcript of Android Marshmallow na prática
Android Marshmallow na prática
Ramon Rabello@ramonrabello
Tá Safo Conf 2015
SobreRamon Ribeiro Rabello
SAIBA MAIS
Educador Corporativo Mobile na
Representante paraense no #io15
GDG Belém Organizer
Innovation Lead na
Instrutor Android na Rede
Membro Tá Safo
Redes Sociais
@ramonrabello
/ramonrabello
+RamonRabello
/ramonrabello
Antes do Marshmallow…
Cupcake (1.5)
Antes do Marshmallow…
Donut (1.6)
Antes do Marshmallow…
Eclair (2.0/2.1)
Antes do Marshmallow…
FroYo (2.2)
Antes do Marshmallow…
Gingerbread (2.3)
Antes do Marshmallow…
Honeycomb (3.0)
Antes do Marshmallow…
Ice Cream Sandwich (4.0)
Antes do Marshmallow…
Jelly Bean (4.1)
Antes do Marshmallow…
KitKat (4.4)
Antes do Marshmallow…
Lollipop (5.0)
Android 6.0 MarshmallowLançado durante o I/O 2015
Várias Novas APIs
API Level 23
Maior interação usando a voz
Melhoria de bateria com Doze
Principais APIsRuntime Permissions
App Links
Data Binding
Voice Interactions
Fingerprint Authentication
Android for Work Features
Direct Share
Doze Mais inteligente
http://goo.gl/U7DaQH
Suporte à Marshmallow
Adicionar suporte à API Level 23 build.gradle
android { … targetSdkVersion 23}
Runtime Permissions
Requisitando permissões em tempo de execução
Permissões em tempo de execução
Requisitando permissões
if (ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED){
}
Orientando o usuárioif (ActivityCompat. shouldShowRequestPermissionRationale(getActivity(), Manifest.permission.CAMERA)) { // exibe uma explicação sobre a permissão }
Confirmando permissão
ActivityCompat. requestPermissions(getActivity(), new String[]{ Manifest.permission.CAMERA}, TAKE_SELFIE);
http://goo.gl/7QZXBX
Data Binding
Vinculando o modelo aos views "automagicamente"
Antes do Data Binding
<RelativeLayout…> <TextView … android:id=“@+id/text_name“/> <TextView … android:id=“@+id/text_surname“/></RelativeLayout>
// onCreate()setContentView(R.layout.activity_main);TextView textName = findViewById(R.id.text_name);TextView textSurname = findViewById(R.id.text_surname);User user = new User(“Ramon","Rabello");textName.setText(user.getName());textSurname.setText(user.getSurname());
activity_main.xml
MainActivity.java
Com o Data Binding<layout> <data> <variable android:name=“org.tasafo.app.model.User” /> </data> … <TextView android:id=“@+id/text_name” android:text=“@{user.name}“ /></layout>
activity_main.xml
MainActivityBinding binding = DataBindingUtils.setContentView(this, R.layout.activity_main);User user = new User(“Ramon”, “Rabello");binding.setUser(user);
MainActivity.javaAdeus findViewById() \o/
#partiu #demo #androidstudio
E agora?
Android Marshmallow APIs http://goo.gl/U7DaQH
Data Binding Guide http://goo.gl/ze88JH
Runtime Permissions http://goo.gl/ze88JH
Android Developers developer.android.com
Dev Bytes https://goo.gl/Cg3qJh
Desenvolvedores Google https://goo.gl/N5XNaz
Acompanhe-nos!
Facebook /tasafo.comunidade
Twitter @tasafo
Google+ http://goo.gl/ze88JH
Blog tasafo.wordpress.com
GitHub /tasafo
Tá Safo Conf 2015 App https://goo.gl/10MxK2
Obrigado!
Facebook /ramon.rabello
Twitter @ramonrabello
Google+ +RamonRabello
About.me /ramonrabello
GitHub /ramonrabello
SlideShare /ramonrabello