INTRODUCTION À LA PLATEFORME ANDROID
|
|
- Godfrey Henderson
- 5 years ago
- Views:
Transcription
1 INTRODUCTION À LA PLATEFORME ANDROID
2 TEXTE PLAN DE COURS Fragment Les popups Listes / RecyclerView / CardView ViewPager NavigationDrawer ActionBar / Toolbar Permissions
3 LES FRAGMENTS ANDROID
4 FRAGMENTS Représente une portion d une interface (activité) Combiner plusieurs Fragments dans une activité Section modulaire d une activité Cycle de vie / input et event indépendant de l activité Un fragment doit toujours faire partie d une activité Quand un activité est en pause, les fragments sont en pauses aussi.
5 FRAGMENTS Introduit depuis Android 3.0 Disponible dans la bibliothèque support v4 Vue plus dynamique & flexible
6 FRAGMENTS
7 CYCLE DE VIE D UN FRAGMENTS FRAGMENT ADDED OnAttach oncreate oncreateview onactivitycreated onstart onresume ondetach ondestroy ondestroyview onstop onpause FRAGMENT IS ACTIVE FRAGMENT IS DESTROYED
8 FRAGMENTS Fait partie d une activité Possède sa propre vue import android.support.v4.app.fragment; public class MyFragment extends Fragment public View oncreateview(layoutinflater inflater, ViewGroup container, Bundle savedinstancestate) { return inflater.inflate(r.layout.activity_main, container, false); } }
9 AJOUTER UNE VUE À UN FRAGMENT View int ViewGroup root, boolean attachtoroot) Le layout à charger Le parent du layout chargé Indique si le layout doit être attaché à son parent (ici false, car le Fragment l attache déjà à son parent)
10 AJOUTER UN FRAGMENT À UNE ACTIVITÉ Directement dans le layout (méthode statique) Spécifier la classe qui gère le fragment (android:name) Identifiant unique Ne peux pas être modifier dynamiquement
11 AJOUTER UN FRAGMENT À UNE ACTIVITÉ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> <fragment android:name="com.example.news.articlelistfragment" android:layout_weight="1" android:layout_width="0dp" android:layout_height="match_parent" /> <fragment android:name="com.example.news.articlereaderfragment" android:layout_weight="2" android:layout_width="0dp" android:layout_height="match_parent" /> </LinearLayout>
12 AJOUTER UN FRAGMENT À UNE ACTIVITÉ Dans le fichier Java (dynamiquement) N importe quel moment (runtime) Ajout / Remplacement / Suppression Une opération sur les fragments = transaction.
13 AJOUTER UN FRAGMENT À UNE ACTIVITÉ FragmentManager fragmentmanager = getfragmentmanager(); FragmentTransaction fragmenttransaction = fragmentmanager.begintransaction(); ExampleFragment fragment = new ExampleFragment(); fragmenttransaction.add(r.id.fragment_container, fragment); fragmenttransaction.commit();
14 GESTION DES FRAGMENTS Gestion des fragments = FragmentManager Récupérer un fragment : findfragmentbyid & frindfragmentbytag Add / Remove / Replace N oubliez pas le commit addtobackstack : Pour ajouter la transaction à la back stack
15 COMMUNIQUER AVEC L ACTIVITÉ Un fragment peux obtenir une instance de l activité à l aide de la méthode getactivity Une activité peux appeler des méthodes du fragment : ExampleFragment fragment = (ExampleFragment) getfragmentmanager().findfragmentbyid(r.id.example_fragment); Vous pouvez créer des callbacks pour notifier une activité d événements qui arrivent dans le fragment
16 LES POPUPS ANDROID
17 TOASTS Toast.makeText(ToastExampleActivity.this, R.string.toast, Toast.LENGTH_SHORT).show(); Contexte La chaîne de caractère Longueur d affichage (LENGTH_SHORT & LENGTH_LONG)
18 ALERTE DIALOG AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setmessage(r.string.alert_dialog_msg).setcancelable(false ).setpositivebutton("yes", new OnClickListener() public void onclick(dialoginterface dialog, int which) { dialog.cancel(); } }).setnegativebutton("cancel", new OnClickListener() public void onclick(dialoginterface dialog, int which) { dialog.cancel(); } }); builder.create().show();
19 SNACK BAR Snackbar.make(viewClicked, "Archived", Snackbar.LENGTH_LONG).setAction("Undo", new View.OnClickListener() public void onclick(view v) { } }).show();
20 SNACK BAR
21 LES LISTES ANDROID
22 LISTVIEW Ensemble d éléments scrollables Gestions des données : Adapter Création d une liste nécessite Layout globale (contenant là ListView) Layout représentant chaque ligne de la liste Un adapter pour gérer les données
23 CRÉATION D UNE LISTVIEW SIMPLE Création d un layout contenant la liste <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin"> <ListView android:id="@+id/list" android:layout_width="match_parent" android:layout_height="wrap_content"/> </RelativeLayout>
24 CRÉATION D UNE LISTVIEW SIMPLE Création de l activité et initialisation de la liste public class MainActivity extends AppCompatActivity { private ListView listview; private String[] values = new String[] {"Donut", "Eclair", "Froyo", "Gingerbread", "Honeycomb", "Ice Cream Sandwich", "Jelly Bean", "Kit Kat", "Lollipop", protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); listview = (ListView) findviewbyid(r.id.list); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.r.layout.simple_list_item_1, android.r.id.text1, values); listview.setadapter(adapter); } }
25
26 ADAPTATEUR PERSONNALISÉ ANDROID
27 LISTVIEW Créer un adapter personnalisé Personnalisation de la liste Personnalisation de l UI Meilleur gestion des données
28 LAYOUT REPRÉSENTANT UNE LIGNE DE LA LISTE <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" xmlns:tools=" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:layout_width="wrap_content" tools:text="item" android:layout_gravity="center_vertical" android:layout_height="match_parent" /> </LinearLayout>
29 ADAPTER PERSONNALISÉ public class MyAdapter extends ArrayAdapter<String> { private String[] data; private Context context; private int res; private LayoutInflater inflater; public MyAdapter(Context context, int resource, String[] objects) { super(context, resource, objects); data = objects; res = resource; this.context = context; inflater = (LayoutInflater) context. getsystemservice(context.layout_inflater_service); public int getcount() { if (data!= null) return data.length; return 0; public View getview(int position, View convertview, ViewGroup parent) { convertview = inflater.inflate(r.layout.include_list_item, null); ((TextView) convertview.findviewbyid(r.id.list_text_item)).settext(data[position]); return convertview; } }
30 ACTIVITÉ public class MainActivity extends AppCompatActivity { private ListView listview; private String[] values = new String[] {"Donut", "Eclair", "Froyo", "Gingerbread", "Honeycomb", "Ice Cream Sandwich", "Jelly Bean", "Kit Kat", "Lollipop", protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); listview = (ListView) findviewbyid(r.id.list); MyAdapter adapter = new MyAdapter(this, R.layout.include_list_item, values); listview.setadapter(adapter); } }
31 LISTVIEW
32 LISTVIEW Plusieurs adapters disponibles ArrayAdapter, CursorAdapter, ListAdapter. widget/adapter.html
33 VIEWHOLDER inflate et findviewbyid couteux Un appel par ligne de la liste Optimiser à l aide des ViewHolder
34 public View getview(int position, View convertview, ViewGroup parent) { ViewHolder holder; if (null == convertview) { convertview = inflater.inflate(r.layout.include_list_item, null); holder = new ViewHolder(); holder.listitemtext = (TextView) convertview.findviewbyid(r.id.list_text_item); convertview.settag(holder); } else { holder = (ViewHolder) convertview.gettag(); } holder.listitemtext.settext(data[position]); return convertview; } static class ViewHolder { TextView listitemtext; }
35 GESTION DU CLIC listview.setonitemclicklistener(new AdapterView.OnItemClickListener() public void onitemclick(adapterview<?> parent, View view, int position, long } }); L adapter La vue La position de l élément cliqué l identifiant de la ligne de l élément cliqué
36 RECYCLERVIEW ANDROID
37 RECYCLERVIEW Une version améliorée et flexible des ListView Maintien un nombre limité de vue
38 RECYCLERVIEW Nécessite Un Layout Manager (LinearLayoutManager, GridLayoutManager ) Un adaptateur Disponible dans Support Library v7 compile 'com.android.support:recyclerview-v7:23.1.0'
39 RECYCLERVIEW <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" activity_horizontal_margin" tools:context=".mainactivity"> <android.support.v7.widget.recyclerview android:layout_width="match_parent" android:layout_height="match_parent"/> </RelativeLayout>
40 RECYCLERVIEW public class MainActivity extends AppCompatActivity { private RecyclerView mrecyclerview; private RecyclerView.Adapter madapter; private RecyclerView.LayoutManager mlayoutmanager; private String[] mydataset = new String[] {"Donut", "Eclair", "Froyo", "Gingerbread", "Honeycomb", "Ice Cream Sandwich", "Jelly Bean", "Kit Kat", "Lollipop", protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mrecyclerview = (RecyclerView) findviewbyid(r.id.my_recycler_view); mrecyclerview.sethasfixedsize(true); mlayoutmanager = new LinearLayoutManager(this); mrecyclerview.setlayoutmanager(mlayoutmanager); // specify an adapter (see also next example) madapter = new MyAdapter(myDataset); mrecyclerview.setadapter(madapter); }
41 RECYCLERVIEW <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" xmlns:tools=" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:layout_width="wrap_content" tools:text="item" android:layout_gravity="center_vertical" android:layout_height="match_parent" /> </LinearLayout>
42 RECYCLERVIEW public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { private String[] mdataset; public static class ViewHolder extends RecyclerView.ViewHolder { public TextView mtextview; public ViewHolder(View v) { super(v); mtextview = (TextView) v.findviewbyid(r.id.list_text_item); } } public MyAdapter(String[] mydataset) { mdataset = mydataset; public MyAdapter.ViewHolder oncreateviewholder(viewgroup parent, int viewtype) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.include_list_item, parent, false); ViewHolder vh = new ViewHolder(v); return vh; public void onbindviewholder(viewholder holder, int position) { holder.mtextview.settext(mdataset[position]); public int getitemcount() { return mdataset.length; } }
43 CARDVIEW ANDROID
44 CARDVIEW Contenu consistant quelques soit la version Material Design Carte avec des bords arrondis Ombre = card_view:cardelevation
45 CARDVIEW <android.support.v7.widget.cardview xmlns:card_view=" android:layout_gravity="center" android:layout_width="200dp" android:layout_height="200dp" card_view:cardcornerradius="4dp"> <TextView android:layout_width="match_parent" android:layout_height="match_parent" /> </android.support.v7.widget.cardview>
46 CARDVIEW
47 FLOATING ACTION BUTTON ANDROID
48 FLOATING ACTION BUTTON Permet d avoir un bouton flottant Effectuer une action important / récurrente Disponible dans la «design support library» compile 'com.android.support:design:23.1.0'
49 FLOATING ACTION BUTTON <android.support.design.widget.floatingactionbutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom end" />
50 FLOATING ACTION BUTTON FloatingActionButton fab = (FloatingActionButton) findviewbyid(r.id.fab); fab.setonclicklistener(new View.OnClickListener() public void onclick(view view) { //Action } });
51
52 ACTIONBAR ANDROID
53 ACTIONBAR Existe depuis Android 3.0 Remplace les menus Accéder facilement à des fonctionnalisées Utiliser celle présente dans la bibliothèque de compatibilité v7 Meilleur gestion des anciennes versions et des différences d implémentation
54 ACTIONBAR Icône de l application Dropdown Menu (Navigation) Actions principales Actions secondaires
55 AJOUTER DES ACTIONS DANS L ACTION BAR <menu xmlns:android=" > <item android:id="@+id/menu_search" android:icon="@drawable/ic_action_search" android:showasaction="ifroom" android:title="@string/menu_search"/> <item android:id="@+id/menu_refresh" android:icon="@drawable/ic_action_refresh" android:showasaction="ifroom" android:title="@string/menu_refresh"/> <item android:id="@+id/menu_help" android:icon="@drawable/ic_action_help" android:showasaction="ifroom" android:title="@string/menu_help"/> <item android:id="@+id/menu_about" android:icon="@drawable/ic_action_about" android:showasaction="never" android:title="@string/menu_about"/> <item android:id="@+id/menu_settings" android:icon="@drawable/ic_action_settings" android:showasaction="never" android:title="@string/menu_settings"/> </menu>
56 ACTIONS Identifiant Icône Titre ShowAsAction : Comportement dans l action bar ifroom / always / never et withtext
57 CHARGER LES ACTIONS & GESTION DU public boolean oncreateoptionsmenu(menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getmenuinflater().inflate(r.menu.menu_main, menu); return true; public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case R.id.menu_about: // Comportement du bouton "A Propos" return true; case R.id.menu_help: // Comportement du bouton "Aide" return true; case R.id.menu_refresh: // Comportement du bouton "Rafraichir" return true; case R.id.menu_search: // Comportement du bouton "Recherche" return true; case R.id.menu_settings: // Comportement du bouton "Paramètres" return true; default: return super.onoptionsitemselected(item); } }
58 NAVIGATION ActionBar actionbar = getsupportactionbar(); actionbar.setdisplayhomeasupenabled(true); Permet de spécifier si l icône de l application doit se comporter comme un bouton «Up» Retour vers la vue mère Déclarer la classe mère dans le manifeste <activity android:name="com.example.myfirstapp.displaymessageactivity" android:label="@string/title_activity_display_message" android:parentactivityname="com.example.myfirstapp.mainactivity" > <!-- Parent activity meta-data to support 4.0 and lower --> <meta-data android:name="android.support.parent_activity" android:value="com.example.myfirstapp.mainactivity" /> </activity>
59 COULEURS DES BARRES DE NAVIGATIONS <?xml version="1.0" encoding="utf-8"?> <resources> <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <!-- Couleur de votre barre d actions --> <item name="android:colorprimary">@color/actionbarcolor</item> <!-- Couleur de la barre de notification --> <item name="android:colorprimarydark">@color/notificationbarcolor </item> <!-- Couleur de la barre de navigation --> <item name="android:navigationbarcolor">@color/navigationbarcolor</ item> </style> </resources>
60 COULEURS DES BARRES DE NAVIGATIONS
61 TOOLBAR ANDROID
62 TOOLBAR Introduit avec Matérial Design Remplace l Action Bar Fait partie de votre Layout Plus personnalisable
63 REMPLACER UNE ACTIONBAR PAR UNE TOOLBAR Modifier le thème de l application <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <item name="windowactionbar">false</item> </style> Déclarer la toolbar dans le layout <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height=«?attr/ actionbarsize" android:elevation="4dp" android:background="?attr/colorprimary" />
64 REMPLACER UNE ACTIONBAR PAR UNE TOOLBAR Setter la Toolbar dans la vue Toolbar toolbar = (Toolbar) findviewbyid(r.id.toolbar); if (null!= toolbar) setsupportactionbar(toolbar); Déclarer la toolbar dans le layout <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/ actionbarsize" android:background="?attr/colorprimary" />
65 TOOLBAR
66 VIEWPAGER ANDROID
67 VIEWPAGER Permet de naviguer entre plusieurs pages Glisser vers la droite (gauche) pour changer la page Chaque page correspond à un fragment
68 VIEWPAGER <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".mainactivity"> <android.support.v7.widget.toolbar android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="?attr/colorprimary" /> <android.support.v4.view.viewpager android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout>
69 protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); Toolbar toolbar = (Toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); // Create the adapter that will return a fragment for each of the three // primary sections of the activity. msectionspageradapter = new SectionsPagerAdapter(getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mviewpager = (ViewPager) findviewbyid(r.id.container); mviewpager.setadapter(msectionspageradapter); }
70 VIEWPAGER <RelativeLayout xmlns:android=" android" android:layout_width="match_parent" android:layout_height="match_parent" <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout>
71 VIEWPAGER public static class PlaceholderFragment extends Fragment { private static final String ARG_SECTION_NUMBER = "section_number"; public static PlaceholderFragment newinstance(int sectionnumber) { PlaceholderFragment fragment = new PlaceholderFragment(); Bundle args = new Bundle(); args.putint(arg_section_number, sectionnumber); fragment.setarguments(args); return fragment; } public PlaceholderFragment() { public View oncreateview(layoutinflater inflater, ViewGroup container, Bundle savedinstancestate) { View rootview = inflater.inflate(r.layout.fragment_main, container, false); TextView textview = (TextView) rootview.findviewbyid(r.id.section_label); textview.settext(getstring(r.string.section_format, getarguments().getint(arg_section_number))); return rootview; } }
72 VIEWPAGER public class SectionsPagerAdapter extends FragmentPagerAdapter { public SectionsPagerAdapter(FragmentManager fm) { super(fm); public Fragment getitem(int position) { return PlaceholderFragment.newInstance(position + 1); public int getcount() { return 3; public CharSequence getpagetitle(int position) { switch (position) { case 0: return "SECTION 1"; case 1: return "SECTION 2"; case 2: return "SECTION 3"; } return null; } }
73 VIEWPAGER
74 NAVIGATION DRAWER ANDROID
75 NAVIGATION DRAWER
76 NAVIGATION DRAWER Disponible dans la bibliothèque de design support Menu de navigation d une application compile 'com.android.support:design:22.2.0'
77 NAVIGATION DRAWER <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android=" android:layout_width="match_parent" android:layout_height=«match_parent"> <!-- The main content view --> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- The navigation drawer > <ListView android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:choicemode="singlechoice" android:dividerheight="0dp" android:background="#fff"/> </android.support.v4.widget.drawerlayout>
78 NAVIGATION DRAWER private String[] mplanettitles; private DrawerLayout mdrawerlayout; private ListView public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mplanettitles = getresources().getstringarray(r.array.planets_array); mdrawerlayout = (DrawerLayout) findviewbyid(r.id.drawer_layout); mdrawerlist = (ListView) findviewbyid(r.id.left_drawer); // Set the adapter for the list view mdrawerlist.setadapter(new ArrayAdapter<String>(this, R.layout.drawer_list_item, mplanettitles)); // Set the list's click listener mdrawerlist.setonitemclicklistener(new DrawerItemClickListener()); } private class DrawerItemClickListener implements ListView.OnItemClickListener public void onitemclick(adapterview parent, View view, int position, long id) { // } }
79 NAVIGATION DRAWER <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android=" apk/res/android" xmlns:tools=" tools:text="item" android:layout_margintop="20dp" android:layout_marginbottom="20dp" android:textsize="20sp" android:layout_gravity="center_vertical" android:layout_height="60dp" android:layout_width="wrap_content" />
80 NAVIGATION DRAWER mdrawertoggle = new ActionBarDrawerToggle(this, mdrawerlayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) { /** Called when a drawer has settled in a completely closed state. */ public void ondrawerclosed(view view) { super.ondrawerclosed(view); } /** Called when a drawer has settled in a completely open state. */ public void ondraweropened(view drawerview) { super.ondraweropened(drawerview); } }; // Set the drawer toggle as the DrawerListener mdrawerlayout.setdrawerlistener(mdrawertoggle);
81 OUVRIR LE DRAWER LORS DU CLIC SUR L protected void onpostcreate(bundle savedinstancestate) { super.onpostcreate(savedinstancestate); // Sync the toggle state after onrestoreinstancestate has occurred. mdrawertoggle.syncstate(); public boolean onoptionsitemselected(menuitem item) { // Pass the event to ActionBarDrawerToggle, if it returns // true, then it has handled the app icon touch event if (mdrawertoggle.onoptionsitemselected(item)) { return true; } // Handle your other action bar items... return super.onoptionsitemselected(item); }
82 ANIMATION BURGER D OUVERTURE <resources> <style name="apptheme" parent="@android:style/theme.material.light"> <item </item> </style> <style name="drawerarrowstyle" parent="widget.appcompat.drawerarrowtoggle"> <item name="spinbars">true</item> <item name="color">#191919</item> </style> </resources>
83 ANIMATION BURGER D OUVERTURE
84 PERMISSIONS ANDROID
85 PERMISSIONS Application est dans un sandbox Besoin d une information en dehors de son scope = permission Android M = Permission au RunTime
86 DÉCLARER UNE PERMISSION <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="com.mti.ipan.cours1.reyclerview" > <uses-permission android:name="android.permission.internet"/> <application android:allowbackup="true" > <activity android:name=".mainactivity" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest>
87 PERMISSIONS Permission déclarée Touche pas à la vie privée d un utilisateur (internet par exemple) = Pas de demande au RunTime Touche à la vie privée d un utilisateur (Contact) = Nécessite une demande au RunTime
88 PERMISSIONS
89 VERIFIER SI UNE PERMISSION EST DONNÉE int permissioncheck = ContextCompat.checkSelfPermission(thisActivity, Manifest.permission.WRITE_CALENDAR); PackageManager.PERMISSION_GRANTED PackageManager.PERMISSION_DENIED
90 EST-CE QUE J AI DÉJÀ DEMANDÉ LA PERMISSION if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS)!= PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_CONTACTS)) { //Cela signifie que la permission à déjà était //demandé et l'utilisateur l'a refusé //Vous pouvez aussi expliquer à l'utilisateur pourquoi //cette permission est nécessaire et la redemander } else { //Sinon demander la permission ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CONTACTS}, MY_PERMISSIONS_REQUEST_READ_CONTACTS); } }
91 L UTILISATEUR ME DONNE T-IL LA public void onrequestpermissionsresult(int requestcode, String permissions[], int[] grantresults) { switch (requestcode) { case MY_PERMISSIONS_REQUEST_READ_CONTACTS: { if (grantresults.length > 0 && grantresults[0] == PackageManager.PERMISSION_GRANTED) { // La permission est garantie } else { // La permission est refusée } return; } }
92 PERMISSIONS Ne demander une permission que si elle est nécessaire Expliquer à l utilisateur, pourquoi votre application nécessite cette permission Ne pas harceler l utilisateur pour qu il vous donne la permission Accepter la decision de l utilisateur
93 TP 2
94 TP2 - ETAPE 1 Créer un NavigationDrawer La vue contient un FrameLayout Au clic sur les items du Navigation, Chargé le fragment avec le titre du menu Le clic sur l icône de la Toolbar ouvre le Drawer
95 TP2 - ETAPE 2 Le clic sur un item du menu, charge un nouveau fragment Ce nouveau fragment contient une RecyclerView de 50 éléments
96 TP2 - ETAPE 3 Le clic sur un item du menu, change la page du ViewPager (chaque ViewPager contient un fragment avec le titre cliqué)
05. RecyclerView and Styles
05. RecyclerView and Styles 08.03.2018 1 Agenda Intents Creating Lists with RecyclerView Creating Cards with CardView Application Bar Menu Styles and Themes 2 Intents 3 What is Intent? An Intent is an
More informationOpen Lecture Mobile Programming. Intro to Material Design
Open Lecture Mobile Programming Intro to Material Design Agenda Introduction to Material Design Applying a Material Theme Toolbar/Action Bar Navigation Drawer RecyclerView CardView Support Design Widgets/Tools
More informationMobile Software Development for Android - I397
1 Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, 2015-2016 EMAIL: AKAVER@ITCOLLEGE.EE WEB: HTTP://ENOS.ITCOLLEGE.EE/~AKAVER/2015-2016/DISTANCE/ANDROID SKYPE: AKAVER Timetable
More informationAction Bar. Action bar: Top navigation bar at each screen The action bar is split into four different functional areas that apply to most apps.
1 Action Bar Action bar: Top navigation bar at each screen The action bar is split into four different functional areas that apply to most apps. 1) App Icon 3) Action Buttons 2)View Control 4) Action Overflows
More informationUI Fragment.
UI Fragment 1 Contents Fragments Overviews Lifecycle of Fragments Creating Fragments Fragment Manager and Transactions Adding Fragment to Activity Fragment-to-Fragment Communication Fragment SubClasses
More informationAndroid CardView Tutorial
Android CardView Tutorial by Kapil - Wednesday, April 13, 2016 http://www.androidtutorialpoint.com/material-design/android-cardview-tutorial/ YouTube Video We have already discussed about RecyclerView
More informationAndroid Navigation Drawer for Sliding Menu / Sidebar
Android Navigation Drawer for Sliding Menu / Sidebar by Kapil - Tuesday, December 15, 2015 http://www.androidtutorialpoint.com/material-design/android-navigation-drawer-for-sliding-menusidebar/ YouTube
More informationFragments. Lecture 11
Fragments Lecture 11 Situational layouts Your app can use different layouts in different situations Different device type (tablet vs. phone vs. watch) Different screen size Different orientation (portrait
More informationProduced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar
Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology
More informationTablets have larger displays than phones do They can support multiple UI panes / user behaviors at the same time
Tablets have larger displays than phones do They can support multiple UI panes / user behaviors at the same time The 1 activity 1 thing the user can do heuristic may not make sense for larger devices Application
More informationAdapter.
1 Adapter An Adapter object acts as a bridge between an AdapterView and the underlying data for that view The Adapter provides access to the data items The Adapter is also responsible for making a View
More informationMultiple devices. Use wrap_content and match_parent Use RelativeLayout/ConstraintLayout Use configuration qualifiers
Multiple devices Multiple devices Use wrap_content and match_parent Use RelativeLayout/ConstraintLayout Use configuration qualifiers Create a new directory in your project's res/ and name it using the
More informationProgrammation Mobile Android Master CCI
Programmation Mobile Android Master CCI Bertrand Estellon Aix-Marseille Université March 23, 2015 Bertrand Estellon (AMU) Android Master CCI March 23, 2015 1 / 266 Navigation entre applications Nous allons
More informationFragment Example Create the following files and test the application on emulator or device.
Fragment Example Create the following files and test the application on emulator or device. File: AndroidManifest.xml
More informationMobile Computing Fragments
Fragments APM@FEUP 1 Fragments (1) Activities are used to define a full screen interface and its functionality That s right for small screen devices (smartphones) In bigger devices we can have more interface
More informationAndroid Development Community. Let s do Material Design
Let s do Material Design Agenda Introduction to Material Design Toolbar Navigation Drawer SwipeRefreshLayout RecyclerView Floating Action Button CardView Toolbar - Lives in package android.support.v7.widget
More informationListView Containers. Resources. Creating a ListView
ListView Containers Resources https://developer.android.com/guide/topics/ui/layout/listview.html https://developer.android.com/reference/android/widget/listview.html Creating a ListView A ListView is a
More informationMAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.
MAD ASSIGNMENT NO 3 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. MainActivity.java File package com.example.tutorialspoint; import android.manifest;
More informationActionBar. import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { }
Android ActionBar import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { Layout, activity.xml
More informationEMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation
EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Managing Screen Orientation ORIENTATIONS Portrait Landscape Reverse portrait Reverse landscape ON REVERSE PORTRAIT Android: all four orientations are
More informationCreating a Custom ListView
Creating a Custom ListView References https://developer.android.com/guide/topics/ui/declaring-layout.html#adapterviews Overview The ListView in the previous tutorial creates a TextView object for each
More informationFragments were added to the Android API in Honeycomb, API 11. The primary classes related to fragments are: android.app.fragment
FRAGMENTS Fragments An activity is a container for views When you have a larger screen device than a phone like a tablet it can look too simple to use phone interface here. Fragments Mini-activities, each
More informationDiving into Android. By Jeroen Tietema. Jeroen Tietema,
Diving into Android By Jeroen Tietema Jeroen Tietema, 2015 1 Requirements 4 Android SDK 1 4 Android Studio (or your IDE / editor of choice) 4 Emulator (Genymotion) or a real device. 1 See https://developer.android.com
More informationAction Bar. (c) 2010 Haim Michael. All Rights Reserv ed.
Action Bar Introduction The Action Bar is a widget that is shown on top of the screen. It includes the application logo on its left side together with items available from the options menu on the right.
More informationEMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs
EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Tip: Switching UIs THE PROBLEM How to switch from one UI to another Each UI is associated with a distinct class that controls it Solution shown: two UIs,
More informationProduced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar
Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology
More informationChapter 8 Positioning with Layouts
Introduction to Android Application Development, Android Essentials, Fifth Edition Chapter 8 Positioning with Layouts Chapter 8 Overview Create user interfaces in Android by defining resource files or
More informationProgramming with Android: Android for Tablets. Dipartimento di Scienze dell Informazione Università di Bologna
Programming with Android: Android for Tablets Luca Bedogni Marco Di Felice Dipartimento di Scienze dell Informazione Università di Bologna Outline Android for Tablets: A Case Study Android for Tablets:
More informationGraphical User Interfaces
Graphical User Interfaces Some suggestions Avoid displaying too many things Well-known anti-patterns Display useful content on your start screen Use action bars to provide consistent navigation Keep your
More informationCSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015
CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015 Comment and Evaluation: This lab introduces us about Android SDK and how to write a program for Android platform. The calculator is pretty easy, everything
More informationgetcount getitem getitemid getview com.taxi Class MainActivity drawerlayout drawerleft drawerright...
Contents com.taxi.ui Class CallDialog... 3 CallDialog... 4 show... 4 build... 5 com.taxi.custom Class CustomActivity... 5 TOUCH... 6 CustomActivity... 6 onoptionsitemselected... 6 onclick... 6 com.taxi.model
More informationAndroid Apps Development for Mobile and Tablet Device (Level I) Lesson 2
Workshop 1. Compare different layout by using Change Layout button (Page 1 5) Relative Layout Linear Layout (Horizontal) Linear Layout (Vertical) Frame Layout 2. Revision on basic programming skill - control
More informationMobila applikationer och trådlösa nät, HI1033, HT2013
Mobila applikationer och trådlösa nät, HI1033, HT2013 Today: - User Interface basics - View components - Event driven applications and callbacks - Menu and Context Menu - ListView and Adapters - Android
More informationM.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126
M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126 Submitted to: Sir Waqas Asghar MAY 23, 2017 SUBMITTED BY: REHAN ASGHAR Intent in Android What are Intent? An Intent is a messaging object you can use to request
More informationEMBEDDED SYSTEMS PROGRAMMING Android Services
EMBEDDED SYSTEMS PROGRAMMING 2016-17 Android Services APP COMPONENTS Activity: a single screen with a user interface Broadcast receiver: responds to system-wide broadcast events. No user interface Service:
More informationUnderstand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml
Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml Android Application Written in Java (it s possible to write native code) Good
More informationMATERIAL DESIGN. Android Elective Course 4th Semester. June 2016 Teacher: Anders Kristian Børjesson. Ovidiu Floca
MATERIAL DESIGN Android Elective Course 4th Semester June 2016 Teacher: Anders Kristian Børjesson Ovidiu Floca 1 CONTENTS 2 Introduction... 2 3 Problem Definition... 2 4 Method... 2 5 Planning... 3 6 Watching
More informationPractical 1.ListView example
Practical 1.ListView example In this example, we show you how to display a list of fruit name via ListView. Android Layout file File : res/layout/list_fruit.xml
More informationEMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State
EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Saving State THE PROBLEM How to save the state (of a UI, for instance) so that it survives even when the application is closed/killed The state should
More informationMobile and Ubiquitous Computing: Android Programming (part 3)
Mobile and Ubiquitous Computing: Android Programming (part 3) Master studies, Winter 2015/2016 Dr Veljko Pejović Veljko.Pejovic@fri.uni-lj.si Based on Programming Handheld Systems, Adam Porter, University
More informationGetting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering
Getting Started Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu http://www.csee.usf.edu/~labrador 1 Goals Setting up your development environment Android Framework
More informationMVC Apps Basic Widget Lifecycle Logging Debugging Dialogs
Overview MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs Lecture: MVC Model View Controller What is an App? Android Activity Lifecycle Android Debugging Fixing Rotations & Landscape Layouts Localization
More informationAccelerating Information Technology Innovation
Accelerating Information Technology Innovation http://aiti.mit.edu India Summer 2012 Review Session Android and Web Working with Views Working with Views Create a new Android project. The app name should
More informationAndroid Application Model I
Android Application Model I CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr. Rajiv Ramnath Reading: Big Nerd Ranch Guide, Chapters 3, 5 (Activities);
More informationAndroid Application Model I. CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr.
Android Application Model I CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr. Rajiv Ramnath 1 Framework Support (e.g. Android) 2 Framework Capabilities
More informationWhen programming in groups of people, it s essential to version the code. One of the most popular versioning tools is git. Some benefits of git are:
ETSN05, Fall 2017, Version 1.0 Software Development of Large Systems Lab 2 preparations Read through this document carefully. In order to pass lab 2, you will need to understand the topics presented in
More informationEMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches
EMBEDDED SYSTEMS PROGRAMMING 2016-17 UI Specification: Approaches UIS: APPROACHES Programmatic approach: UI elements are created inside the application code Declarative approach: UI elements are listed
More informationCreate Parent Activity and pass its information to Child Activity using Intents.
Create Parent Activity and pass its information to Child Activity using Intents. /* MainActivity.java */ package com.example.first; import android.os.bundle; import android.app.activity; import android.view.menu;
More informationListView (link) An ordered collection of selectable choices. key attributes in XML:
CS 193A Lists This document is copyright (C) Marty Stepp and Stanford Computer Science. Licensed under Creative Commons Attribution 2.5 License. All rights reserved. ListView (link) An ordered collection
More informationDeveloping Android Applications Introduction to Software Engineering Fall Updated 1st November 2015
Developing Android Applications Introduction to Software Engineering Fall 2015 Updated 1st November 2015 Android Lab 3 & Midterm Additional Concepts No Class Assignment 2 Class Plan Android : Additional
More informationAgenda. Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen
Gill Cleeren Agenda Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen Lists and navigation Navigating from master to detail Optimizing the application Preparing
More informationLecture 14. Android Application Development
Lecture 14 Android Application Development Notification Instructor Muhammad Owais muhammad.owais@riphah.edu.pk Cell: 03215500223 Notifications Used to notify user for events Three general forms of Notifications
More informationTip Calculator. xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
Tip Calculator activity_main.xml
More informationOur First Android Application
Mobile Application Development Lecture 04 Imran Ihsan Our First Android Application Even though the HelloWorld program is trivial in introduces a wealth of new ideas the framework, activities, manifest,
More informationFragments. Fragments may only be used as part of an ac5vity and cannot be instan5ated as standalone applica5on elements.
Fragments Fragments A fragment is a self- contained, modular sec5on of an applica5on s user interface and corresponding behavior that can be embedded within an ac5vity. Fragments can be assembled to create
More informationEMBEDDED SYSTEMS PROGRAMMING Application Basics
EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Basics APPLICATIONS Application components (e.g., UI elements) are objects instantiated from the platform s frameworks Applications are event driven ( there
More informationAndroid UI Development
Android UI Development Android UI Studio Widget Layout Android UI 1 Building Applications A typical application will include: Activities - MainActivity as your entry point - Possibly other activities (corresponding
More informationProduced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar
Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology
More informationTabel mysql. Kode di PHP. Config.php. Service.php
Tabel mysql Kode di PHP Config.php Service.php Layout Kode di Main Activity package com.example.mini.webandroid; import android.app.progressdialog; import android.os.asynctask; import android.support.v7.app.appcompatactivity;
More informationAndroid Specifics. Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9)
Android Specifics Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9) Android Specifics ArrayAdapter Preferences Widgets Jonathan Diehl, Hendrik Thüs 2 ArrayAdapter Jonathan Diehl, Hendrik Thüs
More informationAndroid Basics. Android UI Architecture. Android UI 1
Android Basics Android UI Architecture Android UI 1 Android Design Constraints Limited resources like memory, processing, battery à Android stops your app when not in use Primarily touch interaction à
More informationAndroid Apps Development for Mobile and Tablet Device (Level I) Lesson 4. Workshop
Workshop 1. Create an Option Menu, and convert it into Action Bar (Page 1 8) Create an simple Option Menu Convert Option Menu into Action Bar Create Event Listener for Menu and Action Bar Add System Icon
More informationStatistics http://www.statista.com/topics/840/smartphones/ http://www.statista.com/topics/876/android/ http://www.statista.com/statistics/271774/share-of-android-platforms-on-mobile-devices-with-android-os/
More informationApplied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB)
Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB) In this exercise, we will create a simple Android application that uses IBM Bluemix Cloudant NoSQL DB. The application
More informationSoftware Practice 3 Before we start Today s lecture Today s Task Team organization
1 Software Practice 3 Before we start Today s lecture Today s Task Team organization Prof. Hwansoo Han T.A. Jeonghwan Park 43 2 Lecture Schedule Spring 2017 (Monday) This schedule can be changed M A R
More informationBuilding User Interface for Android Mobile Applications II
Building User Interface for Android Mobile Applications II Mobile App Development 1 MVC 2 MVC 1 MVC 2 MVC Android redraw View invalidate Controller tap, key pressed update Model MVC MVC in Android View
More informationTutorial: Setup for Android Development
Tutorial: Setup for Android Development Adam C. Champion CSE 5236: Mobile Application Development Spring 2018 Based on material from C. Horstmann [1], J. Bloch [2], C. Collins et al. [4], M.L. Sichitiu
More informationFragments. Lecture 10
Fragments Lecture 10 Situa2onal layouts Your app can use different layouts in different situa2ons Different device type (tablet vs. phone vs. watch) Different screen size Different orienta2on (portrait
More informationMobila applikationer och trådlösa nät, HI1033, HT2012
Mobila applikationer och trådlösa nät, HI1033, HT2012 Today: - User Interface basics - View components - Event driven applications and callbacks - Menu and Context Menu - ListView and Adapters - Android
More informationAPI Guide for Gesture Recognition Engine. Version 2.0
API Guide for Gesture Recognition Engine Version 2.0 Table of Contents Gesture Recognition API... 3 API URI... 3 Communication Protocol... 3 Getting Started... 4 Protobuf... 4 WebSocket Library... 4 Project
More informationPENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)
PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) Network Connection Web Service K Candra Brata andra.course@gmail.com Mobille App Lab 2015-2016 Network Connection http://developer.android.com/training/basics/network-ops/connecting.html
More informationACTIVITY, FRAGMENT, NAVIGATION. Roberto Beraldi
ACTIVITY, FRAGMENT, NAVIGATION Roberto Beraldi Introduction An application is composed of at least one Activity GUI It is a software component that stays behind a GUI (screen) Activity It runs inside the
More informationProduced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar
Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology
More informationWebView Fragments Navigation Drawer
http://www.android.com/ WebView Fragments Navigation Drawer Web Apps You can make your web content available to users in two ways In a traditional web browser In an Android application, by including a
More informationProgramming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna
Programming with Android: Introduction Layouts Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna Views: outline Main difference between a Drawable and
More informationINTRODUCTION TO ANDROID
INTRODUCTION TO ANDROID 1 Niv Voskoboynik Ben-Gurion University Electrical and Computer Engineering Advanced computer lab 2015 2 Contents Introduction Prior learning Download and install Thread Android
More informationQ.1 Explain the dialog and also explain the Demonstrate working dialog in android.
Q.1 Explain the dialog and also explain the Demonstrate working dialog in android. - A dialog is a small window that prompts the user to make a decision or enter additional information. - A dialog does
More informationProgramming with Android: Introduction. Layouts. Luca Bedogni. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna
Programming with Android: Introduction Layouts Luca Bedogni Dipartimento di Informatica: Scienza e Ingegneria Uniersità di Bologna Views: outline Main difference between a Drawable and a View is reaction
More informationSouth Africa Version Control.
South Africa 2013 Lecture 7: User Interface (Navigation)+ Version Control http://aiti.mit.edu South Africa 2013 Today s agenda Recap Navigation Version Control 2 Tutorial Recap Activity 1 Activity 2 Text
More informationAndroid - JSON Parser Tutorial
Android - JSON Parser Tutorial JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML. This chapter explains how to parse the JSON file
More informationExternal Services. CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion
External Services CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion 1 External Services Viewing websites Location- and map-based functionality
More informationCS 4330/5390: Mobile Application Development Exam 1
1 Spring 2017 (Thursday, March 9) Name: CS 4330/5390: Mobile Application Development Exam 1 This test has 8 questions and pages numbered 1 through 7. Reminders This test is closed-notes and closed-book.
More informationAdaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University.
Creating dialogs Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University. Portions of this page are reproduced from work created and
More informationAndroid App Development. Mr. Michaud ICE Programs Georgia Institute of Technology
Android App Development Mr. Michaud ICE Programs Georgia Institute of Technology Android Operating System Created by Android, Inc. Bought by Google in 2005. First Android Device released in 2008 Based
More informationUpon completion of the second part of the lab the students will have:
ETSN05, Fall 2017, Version 2.0 Software Development of Large Systems Lab 2 1. INTRODUCTION The goal of lab 2 is to introduce students to the basics of Android development and help them to create a starting
More informationSD Module-1 Android Dvelopment
SD Module-1 Android Dvelopment Experiment No: 05 1.1 Aim: Download Install and Configure Android Studio on Linux/windows platform. 1.2 Prerequisites: Microsoft Windows 10/8/7/Vista/2003 32 or 64 bit Java
More informationIntents. Your first app assignment
Intents Your first app assignment We will make this. Decidedly lackluster. Java Code Java Code XML XML Preview XML Java Code Java Code XML Buttons that work
More informationAndroid Application Development. By : Shibaji Debnath
Android Application Development By : Shibaji Debnath About Me I have over 10 years experience in IT Industry. I have started my career as Java Software Developer. I worked in various multinational company.
More informationChapter 5 Flashing Neon FrameLayout
5.1 Case Overview This case mainly introduced the usages of FrameLayout; we can use FrameLayout to realize the effect, the superposition of multiple widgets. This example is combined with Timer and Handler
More informationMobile Programming Lecture 7. Dialogs, Menus, and SharedPreferences
Mobile Programming Lecture 7 Dialogs, Menus, and SharedPreferences Agenda Dialogs Menus SharedPreferences Android Application Components 1. Activity 2. Broadcast Receiver 3. Content Provider 4. Service
More informationandroid:layout_margintop="5dp" > <EditText android:layout_width="210dp"
activity_main.xml
More informationELET4133: Embedded Systems. Topic 15 Sensors
ELET4133: Embedded Systems Topic 15 Sensors Agenda What is a sensor? Different types of sensors Detecting sensors Example application of the accelerometer 2 What is a sensor? Piece of hardware that collects
More informationAndroid development. Outline. Android Studio. Setting up Android Studio. 1. Set up Android Studio. Tiberiu Vilcu. 2.
Outline 1. Set up Android Studio Android development Tiberiu Vilcu Prepared for EECS 411 Sugih Jamin 15 September 2017 2. Create sample app 3. Add UI to see how the design interface works 4. Add some code
More informationAn Overview of the Android Programming
ID2212 Network Programming with Java Lecture 14 An Overview of the Android Programming Hooman Peiro Sajjad KTH/ICT/SCS HT 2016 References http://developer.android.com/training/index.html Developing Android
More informationTopics of Discussion
Reference CPET 565 Mobile Computing Systems CPET/ITC 499 Mobile Computing Fragments, ActionBar and Menus Part 3 of 5 Android Programming Concepts, by Trish Cornez and Richard Cornez, pubslihed by Jones
More informationProduced by. Mobile Application Development. Eamonn de Leastar
Mobile Application Development Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie A First
More informationMAD ASSIGNMENT NO 2. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.
MAD ASSIGNMENT NO 2 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. Android Widgets There are given a lot of android widgets with simplified
More informationVLANs. Commutation LAN et Wireless Chapitre 3
VLANs Commutation LAN et Wireless Chapitre 3 ITE I Chapter 6 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 1 Objectifs Expliquer le rôle des VLANs dans un réseau convergent. Expliquer le rôle
More informationAndroid Programs Day 5
Android Programs Day 5 //Android Program to demonstrate the working of Options Menu. 1. Create a New Project. 2. Write the necessary codes in the MainActivity.java to create OptionMenu. 3. Add the oncreateoptionsmenu()
More information