Antonio López Marín Estudiante de la Universidad Politécnica de Valencia Software developer en @Meetizer
Descubre Android
@tonilopezmr
The Solution
Calcula Notas
@tonilopezmrhttp://tonilopezmr.github.io/calculanotas/
Android
Jelly Bean
KitKat
Marshmallow
Lollipop
@tonilopezmr
Entorno de desarrollo
http://developer.android.com/intl/es/sdk/index.html
@tonilopezmr
2.0
@tonilopezmr
AndroidEmulator 2.0
Android Studio 2.0 or higher
SDK Tools 25.0.10 or higher
http://developer.android.com/intl/es/tools/devices/emulator.html
@tonilopezmr
Estructura de un proyecto Android Studio
Proyecto- Modulo1 (app)
- src/main/java- Modulo2 (android Wear app)
@tonilopezmr
@tonilopezmr
Gradle es una herramienta para automatizar la construcción de nuestros proyectos, build.gradle
@tonilopezmr
compileSdkVersion 23buildToolsVersion "23.0.3"
http://gradle.org/
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0'}
Gradle
@tonilopezmr
Componentes de una aplicaciónActivity {
ImageViewButtonTextViewFragment}
LinearLayoutRelativeLayoutGridLayoutFrameLayout
@tonilopezmr
Activity Lifecycle
@tonilopezmr
Fragments
@tonilopezmr
@tonilopezmr
@tonilopezmr
public class MainActivity extends AppCompatActivity {
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }}
@tonilopezmr
<LinearLayout 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" android:orientation="vertical">
<TextView
android:id="@+id/text_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Hello GeeksHubs!" />
<FrameLayout android:id="@+id/frame_layout" android:layout_width="match_parent" android:layout_height="match_parent" /></LinearLayout>
@tonilopezmr
public class MainActivity extends AppCompatActivity {
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
textView textView = (TextView) findViewById(R.id.text_view); textView.setText(“Cambiando el texto”); }
}
@tonilopezmr
public class DescriptionFragment extends Fragment {
@Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_description, container, false); TextView desc = (TextView) rootView.findViewById(R.id.text_view); desc.setText(“My description”);
return rootView; }}
@tonilopezmr
public class MainActivity extends AppCompatActivity {
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
...
getSupportFragmentManager().beginTransaction() .replace(R.id.frame_layout, new DescriptionFragment(), "f_name") .commit(); }} @tonilopezmr
@tonilopezmr
Android Llolipop● Material Design● Notificaciones● Batería● Otras mejoras: CPU 64 bits, Vectores
dibujables..@tonilopezmr
Android Marshmallow● Administración de permisos● Google Now on Tap● Android Pay● Direct Share● Soporte oficial para tarjetas SD y USB
@tonilopezmr
Material Design
https://www.google.com/design/spec/material-design/introduction.html@tonilopezmr
Material Design
https://www.google.com/design/spec/material-design/introduction.html@tonilopezmr
Material Design
@tonilopezmr
● Material Theme a partir de 5.0● Design Support Library● Otras librerías: CardView, RecyclerView
compile 'com.android.support:appcompat-v7:23.3.0'compile 'com.android.support:design:23.3.0'
Material Design
https://www.google.com/design/spec/material-design/introduction.html@tonilopezmr
colorPrimaryDark
colorPrimary
colorAccent<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">#234234</item> <item name="colorPrimaryDark">#02342</item> <item name="colorAccent">#23423</item> </style>
https://www.google.com/design/spec/material-design/introduction.html@tonilopezmr
Toast vs SnackBarToast
●Mostrar mensajes o errores
●Un tiempo de duración (largo o corto)
SnackBar
●Mostrar mensajes o errores
●Puedes añadir una acción
●Permanente o con tiempo de duraciónhttps://www.google.com/design/spec/components/snackbars-toasts.html @tonilopezmr
Toast vs SnackBarToast.makeText(context, "Esto es un mensaje", Toast.LENGTH_SHORT).show();
Snackbar .make(context, "Esto es un mensaje más guay",Snackbar.LENGTH_INDEFINITE) .setAction(...) .show();
@tonilopezmr
FloatingButton
app:fabSize = “normal” app:fabSize = “mini”
https://www.google.com/design/spec/components/buttons-floating-action-button.html @tonilopezmr
Toolbar
<android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay">
https://www.google.com/design/spec/layout/structure.html#structure-toolbars
toolbar = (Toolbar) findViewById(R.id.toolbar);setSupportActionBar(toolbar);
@tonilopezmr
CoordinatorLayout● Nuevo layout que coordina sus vistas
hijas entre ellas mediante comportamientos
● Behaviours
@tonilopezmr
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" android:src="@android:drawable/icon" />
<android.support.design.widget.CoordinatorLayout/>
@tonilopezmr
AppBarLayout y CoordinatorLayout
@tonilopezmr@tonilopezmr
@tonilopezmr
<android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="@dimen/detail_header_height" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollFlags="scroll|exitUntilCollapsed" app:expandedTitleMarginStart="48dp" app:expandedTitleMarginEnd="64dp">
<android.support.v7.widget.Toolbar … /> <ImageView
… app:layout_collapseMode="parallax" />
...
</android.support.design.widget.CollapsingToolbarLayout>@tonilopezmr
● scroll
● enterAlways
● enterAlwaysCollapsed
● exitUntilCollapsed
http://www.materialdoc.com/@tonilopezmr
https://github.com/tonilopezmr/android-community
@tonilopezmr
¿Preguntas?
Recommended