-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
899 lines (832 loc) · 37.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Android hands-on</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/serif.css">
<link rel="stylesheet" href="css/main.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match(/print-pdf/gi) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName('head')[0].appendChild(link);
</script>
</head>
<body>
<div class="reveal">
<section class="slides">
<section>
<h2>Android hands-on</h2>
<h4><i class="icon-android"></i>advanced learning</h4>
<img data-src="images/android.gif">
<p>
<small>By <a href="https://github.com/resourcepool" target="_blank">Resourcepool</a></small>
</p>
</section>
<section>
<h1>Table of content</h1>
<ol>
<li class="fragment"><a href="#/introduction"> Introduction</a></li>
<li class="fragment"><a href="#/environment"> Environment</a></li>
<li class="fragment"><a href="#/architecture"> Architecture</a></li>
<li class="fragment"><a href="#/layouts"> Layouts</a></li>
<li class="fragment"><a href="#/views"> Views and Activities</a></li>
<li class="fragment"><a href="#/thread"> Thread and web services</a></li>
<li class="fragment"><a href="#/lists"> Lists</a></li>
<li class="fragment"><a href="#/libs"> Useful libs</a></li>
<li class="fragment"><a href="#/cross"> Cross Platforms</a></li>
<li class="fragment"><a href="#/ux"> User Experience</a></li>
<li class="fragment"><a href="project.html" target="_blank">Project</a></li>
</ol>
</section>
<section>
<section id="introduction">
<h1>Introduction</h1>
</section>
<section>
<h3>Any ideas of the numbers?</h3>
<div class="fragment">
<img data-src="images/devices.png" height="250px">
<img data-src="images/os_market_share.png" height="250px">
<a class="ref"
href="http://www.zdnet.fr/actualites/chiffres-cles-les-os-pour-smartphones-39790245.htm"
target="_blank">june 2016</a>
</div>
</section>
<section>
<h3>Let's talk about money!</h3>
<div class="fragment">
<img data-src="images/apps.png" height="250px"><br/>
<img data-src="images/downloads-by-Store-in-2017.png" height="300px">
<img data-src="images/consumer-spend-by-store-2017.png" height="300px">
</div>
</section>
<section>
<h3>How much was whatsapp sold for ?</h3>
<div class="fragment">
<h4>22 billion $</h4>
<img data-src="images/price1.png" height="300px">
<img data-src="images/price2.png" height="300px">
</div>
</section>
<section>
<h3>Lesson objectives</h3>
<img data-src="images/proj1.png" height="400px">
<img data-src="images/proj2.png" height="400px"><br/>
<a href="https://github.com/resourcepool/training-chat-rest" target="_blank">All the doc you need</a>
</section>
</section>
<section>
<section id="environment">
<h1>Environment</h1>
</section>
<section>
<h3>What are the major challenges faced by android application developers?</h3>
</section>
<section>
<h3>Screens</h3>
<div class="fragment">
<img data-src="images/densitysize.png" height="250px">
<a class="ref" href="https://developer.android.com/about/dashboards/index.html" target="_blank">
September 12, 2018, developer.android.com</a>
</div>
</section>
<section>
<h3>Versions</h3>
<div class="fragment">
<img data-src="images/versions.png" height="250px">
<img data-src="images/android-8-oreo_m.gif" height="250px">
<a class="ref" href="https://developer.android.com/about/dashboards/index.html" target="_blank">Data
collected during a 7-day period ending on September 12, 2018. </a>
<img data-src="images/android_versions.png" height="250px">
</div>
</section>
<section>
<img data-src="images/version2018.png" height="600px">
<a class="ref" href="https://developer.android.com/about/dashboards/index.html" target="_blank">September
12, 2018, developer.android.com</a>
</section>
<section>
<h3>Network and energy</h3>
<div class="fragment">
<img data-src="images/no_data.gif" height="250px">
<img data-src="images/no_battery.gif" height="250px">
</div>
</section>
<section>
<h3>How does it work?</h3>
<img class="fragment" data-src="images/android_linux.png" height="400px">
</section>
<section>
<h3>JVM vs DALVIK</h3>
<img class="fragment" data-src="images/jvm_dvm.png" height="500px">
</section>
<section>
<h3>Build Process</h3>
<div class="fragment">
<!--https://developer.android.com/studio/build/index.html-->
<img data-src="images/build-process.png" height="500px">
<a class="ref" href="https://developer.android.com/studio/build/index.html" target="_blank">Build process, developer.android.com</a>
</div>
</section>
<section>
<h3>ART</h3>
<img data-src="images/android-opt.jpg" height="500px">
</section>
</section>
<section>
<section id="architecture">
<h1>Architecture</h1>
</section>
<section>
<h3>Go Android, build my app!</h3>
<ol>
<li>Android Studio:
<a href="http://developer.android.com/tools/sdk" target="_blank">http://developer.android.com/tools/sdk</a>
</li>
<li>Official documentation:
<a href="http://developer.android.com" target="_blank">http://developer.android.com</a>
</li>
</ol>
<img data-src="images/newProject.png" width="450px">
<img data-src="images/newProjectSdk.png" width="450px">
</section>
<section>
<h3>Project structure</h3>
<img data-src="images/archi.png" height="600px">
</section>
<section>
<h3>The manifest</h3>
<script src="https://gist.github.com/Aallam/bbb54bef33e97cdeeca095ea053034c5.js"></script>
</section>
</section>
<section>
<section id="layouts">
<h1>Layouts</h1>
</section>
<section>
<h3>WYSIWYG</h3>
<img data-src="images/WYSIWYG.png" height="600px">
</section>
<section>
<h3>Hierarchy</h3>
<img data-src="images/viewgroup.png" height="300px">
<ul>
<li class="fragment"><b>View</b>: Button, TextView, ImageView, ...</li>
<li class="fragment"><b>ViewGroup</b>: LinearLayout, RelativeLayout, ConstraintLayout, ...</li>
</ul>
</section>
<section>
<h3>Linear layout</h3>
<p class="small" style="text-align: center;">A layout that organizes its children into a single horizontal or vertical row</p>
<img data-src="images/dg_layout_diagram_and_hierarchy.png" height="500px">
</section>
<section>
<h3>Relative layout</h3>
<p class="small" style="text-align: center;">Enables you to specify the location of child objects relative to each other or to the parent</p>
<img data-src="images/relativelayout1.png" height="500px">
<img data-src="images/relativelayout2.png" height="500px">
</section>
<section>
<h3>LinearLayout vs RelativeLayout</h3>
<img data-src="images/relative.png" height="380px">
<img data-src="images/linear_preview.png" height="380px">
<img data-src="images/linear.png" height="380px">
</section>
<section>
<h3>XML ToolBox</h3>
<ul>
<li class="fragment">Margin</li>
<li class="fragment">Padding</li>
<li class="fragment">layout_below / layout_above</li>
<li class="fragment">layout_toEndOf / layout_toStartOf</li>
<li class="fragment">layout_centerHorizontal / layout_centerVertical
<li class="fragment">layout_centerInParent</li>
</ul>
</section>
<section data-background="#BBDEFB" data-background-transition="zoom">
<h3>Lets play</h3>
<p class="small">The goal of this exercise is to build the login page. The first step is to create the
view.
View are generated with layouts, try to use them to reach the following screen. The view contains
two edit text, a header and a validation button.
</p>
<h4>Toolbox:</h4>
<div style="float:left; width: 500px; display: inline-block;">
<p class="small">
<b>TextView</b> to display a simple text<br/>
<b>EditText</b> allows the user to write a text<br/>
<b>ScrollView</b> to scroll the contents<br/>
<b>Button</b> guess what, a button<br/>
</p>
<p class="small">
The best way to start with layout is to add background color to layouts, it will help you
with margin, padding... To do so use :
</p>
<p class="small">
<br/>
android:background="#ttrrggbb"
<br/>
<br/>
tt : from 00 to FF for transparency<br/>
</p>
</div>
<img style="float:left;" data-src="images/help_exo1.png" height="400px">
</section>
<section data-background="#BBDEFB">
<h3>Bonus: ConstraintLayout</h3>
<p class="small" style="text-align: center;">Try recreate the previous exercise, but this time using <b>ConstraintLayout</b></p>
<img data-src="images/constraintlayout_vs_relativelayout.png" height="325px">
<img data-src="images/constraint_example.png" height="325px">
</section>
</section>
<section>
<section id="views">
<h1>Views and activities</h1>
</section>
<section>
<h3>Start an Activity</h3>
<img data-src="images/activity1.png" height="300px">
<script src="https://gist.github.com/nicolasfavier/9dceffe8291e03f5694ec29dbebbf119.js"></script>
</section>
<section data-transition="fade">
<h3>Backstack</h3>
<img data-src="images/backstack1.png" height="500px">
</section>
<section data-transition="fade">
<h3>Backstack</h3>
<img data-src="images/backstack2.png" height="500px">
</section>
<section>
<h3>Life cycle</h3>
<img data-src="images/lifecycle.png" height="500px">
</section>
<section data-background="#BBDEFB" data-background-transition="zoom">
<h3>Activity life cycle</h3>
<p class="small">
The objective of this exercise is to understand the states of the activity. We are going to use
Android API to log those events.
</p>
<pre data-trim data-noescape>
<code>
Log.i(TAG, "onCreate!");
</code></pre>
<p class="small">
A common practice is to add a TAG to the class for all logs.
</p>
<pre data-trim data-noescape>
<code>
public class ParlezVousActivity extends Activity {
private final String TAG = ParlezVousActivity.class.getSimpleName();
</code></pre>
<p class="small">
Override the following methods and add some explicit logs :
onCreate, onDestroy, onPause, onResume, onSaveInstanceState, onRestoreInstanceState
<br/>
What happens when:
You start the application,
You receive a call,
You change your phone orientation (Ctrl+F11 for the emulator),
You close the app ?
</p>
</section>
<section data-background="#BBDEFB" data-background-transition="zoom">
<h3>User interactions</h3>
<p class="small">
It's now time to listen and handle the view from the activity. We are going to add some behavior in
our login page.
In the onCreate method of the activity, recover the objects of the view you want to manipulate.
Use the findViewById() method:</p>
<pre data-trim data-noescape>
<code>
private EditText usernameField;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
usernameField = (EditText) findViewById(R.id.username_field);
</code></pre>
<p class="small">
Add a listener on the buttons, it can either be in or outside of the class.
Implement the "Clear" button and the "Send" button, when the send button is clicked show a toast.
<pre data-trim data-noescape>
<code>
Toast.makeText(this, "Toast !", Toast.LENGTH_SHORT).show();
</code></pre>
</p>
</section>
<section data-background="#BBDEFB" data-background-transition="zoom">
<h3>Bonus</h3>
<p class="small">
Add some validation on the fly or at the button click. Check that the fields aren't empty and the
password is at least 3 characters.
To display the error, use a classic TextView and chagne its visibility.
</p>
<pre data-trim data-noescape>
<code>
setVisibility(View.VISIBLE);
</code></pre>
<br/>
<p class="small">
If you still have time you can start to use <a href="#/butterknife">Butter Knife</a>, a cool way to
load
view and catch user interactions.
</p>
</section>
</section>
<section>
<section id="thread">
<h1>Thread and web services</h1>
</section>
<section>
<h3>UI-Thread</h3>
Only one thread can modify the view. It's the Ui thread (Main thread).
This thread is also responsible for all client interaction with the app.<br/>
What happens if you do heavy jobs in this thread ?
<img class="fragment" data-src="images/lag.gif" height="300px">
</section>
<section>
<h3>Asynctask</h3>
<img data-src="images/AsyncTask.png" height="500px">
</section>
<section>
<h3>How does it work?</h3>
<script src="https://gist.github.com/nicolasfavier/ae899c29908585baa7738c68fc4221ee.js"></script>
Start the async task :
<script src="https://gist.github.com/nicolasfavier/1ddd5f67b116490124898285146fe3c9.js"></script>
<br/>
</section>
<section>
<h3>AsyncTask params</h3>
The three kind of params used by the asyncTask are:
<ul>
<li><b>Params</b>,the type send at the execution.</li>
<li><b>Progress</b>, the type send to the progress.</li>
<li><b>Result</b>, the type send at the end of the asynctask.</li>
</ul>
<br/>
<li>Params are not always used. If so you can change it by Void.</li>
<br/>
<br/>
<script src="https://gist.github.com/nicolasfavier/57cd8252c03f07b38cdfdd8bd8f8164a.js"></script>
</section>
<section>
<h3>Network call</h3>
<script src="https://gist.github.com/tommybuonomo/d899993a9e6c88984a72023c329cb6b6.js"></script>
</section>
<section data-background="#BBDEFB" data-background-transition="zoom">
<h3>Login on the server</h3>
<p class="small">
The objective of the exercise is to send our previous form to a REST web service.<br/>
First thing first, we need to add the internet permission.
Do you remember where ?
<span class="fragment">AndroidManifest.xml</span>
</p>
<pre data-trim data-noescape class="fragment">
<code>
<uses-permission android:name="android.permission.INTERNET" />
</code></pre>
<p class="small fragment">
Create the LoginTask that extends android.os.AsyncTask.<br/>
In the onPreExecute method, display a loading wheel.<br/>
In the onPostExecute method, hide the loading wheel.<br/>
In the doInBackground method, execute your network call<br/>
Use the following url:
<br/><br/><a href="https://training.loicortola.com/chat-rest/1.0/connect/nico/nico" target="_blank">https://training.loicortola.com/chat-rest/1.0/connect/nico/nico</a><br/><br/>
The HTTP method to use is: GET<br/><br/>
Status <span style="color: #4CAF50;">200-OK</span> JSON response {"status":200,"message":"Login
successful"} if everything went well.<br/><br/>
Status <span style="color: #F44336;">401-UNAUTHORIZED</span> JSON response
{"status":401,"message":"...","elements":"..."} if login or/and password provided are not correct
</p>
</section>
</section>
<section>
<section id="lists">
<h1>Lists</h1>
</section>
<section>
<h3>Lists</h3>
<p class="fragment">How would you build a list ?</p>
<p class="fragment">What happens if you have more than 4000 elements ?</p>
<p class="fragment">So how is it done ?</p>
<img class="fragment" data-src="images/RecyclerView.png">
</section>
<section>
<h3>ListView</h3>
ListView is a view group that displays a scrollable list of items. The list items are automatically
inserted to the list using an Adapter that pulls content from a source such as an array and converts
each item result into a view that's placed into the list.
<script src="https://gist.github.com/nicolasfavier/c1e70b55e78a0235192d9a58754d7eee.js"></script>
</section>
<section>
<h3>Single element</h3>
Now that we have a container we need to add elements in it,
so we create a new xml for the view of a single element.<br/>
Create an xml : element_message.xml with two TextView, one for the message, and an other one for the
author.
</section>
<section>
<h3>Base adapter</h3>
<script src="https://gist.github.com/nicolasfavier/f1bef26b7fbfd76b1594f47971620574.js"></script>
</section>
<section>
<h3>Lets merge it</h3>
<script src="https://gist.github.com/nicolasfavier/e12e4a35c371161f2c1c8c6758e41e1d.js"></script>
</section>
<section>
<h3>LitView vs RecyclerView</h3>
<img data-src="images/fight.gif">
</section>
<section>
<h3>The RecyclerView since Lollipop</h3>
<ul>
<li>View holders</li>
<li>Layout Manager</li>
<li>Item Animator</li>
<li>Item Decoration</li>
</ul>
</section>
<section>
<h3>The RecyclerView</h3>
<script src="https://gist.github.com/nicolasfavier/f700a5418337e2cce68501fa31dba7dd.js"></script>
<script src="https://gist.github.com/nicolasfavier/f65d2d4f32d5c132ced4fb86d20d0520.js"></script>
</section>
<section>
<h3>The adapter</h3>
<script src="https://gist.github.com/nicolasfavier/944e7a60f062dc7adc452c8d8514bdc5.js"></script>
</section>
<section data-background="#BBDEFB" data-background-transition="zoom">
<h3>Retrieve messages</h3>
</section>
<section data-background="#BBDEFB">
<h3>Infinite scroll</h3>
<img src="images/buz.jpg" height="300px">
<img src="images/infinitescroll.png" height="300px">
<script src="https://gist.github.com/nicolasfavier/17f6b8ae4e3bdf9505d63e1eb56303c5.js"></script>
</section>
</section>
<section>
<section id="libs">
<h1>Give me more</h1>
<img data-src="images/moreandroid.jpg" height="300px">
</section>
<section>
<h1>Les images</h1>
</section>
<section>
<h3>
<a href="http://square.github.io/picasso/" target="_blank">Picasso</a>
<a href="https://github.com/bumptech/glide" target="_blank">Glide</a></h3>
<pre data-trim data-noescape>
<code>
repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven Central
}
dependencies {
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:19.1.0'
}
</code></pre>
<pre data-trim data-noescape>
<code>
Glide.with(this).load("http://goo.gl/gEgYUd").into(imageView);
</code></pre>
</section>
<section id="butterknife">
<h1>ButterKnife</h1>
<img data-src="images/butterknife.png" height="200px">
<h4>
Go check the lib: <a href="http://jakewharton.github.io/butterknife/" target="_blank">Butter
Knife</a>
</h4>
</section>
<section>
<h3>The problem :</h3>
<ul>
<li>findViewByID() over and over again</li>
<li>1000 of listeners for onClick, onTextChanged...</li>
<li>The size of the onCreate() method</li>
</ul>
</section>
<section>
<h3>Comparison</h3>
<div class="container">
<div class="column">
<script src="https://gist.github.com/nicolasfavier/03a337d208831a1f9944bb1832b75dc0.js"></script>
</div>
<div class="column">
<script src="https://gist.github.com/nicolasfavier/16bb9f0f7f1d07ec2901eed92b241302.js"></script>
</div>
</div>
</section>
<section>
<h1>Retrofit</h1>
<img data-src="images/retrofit.jpg" height="200px">
<h4>
Go check the lib:<a href="http://square.github.io/retrofit/" target="_blank"> Retrofit</a>
</h4>
</section>
<section>
<h3>The problem :</h3>
<ul>
<li>AsyncTask</li>
<li>Mapping the http response</li>
<li>Handling errors</li>
</ul>
</section>
<section>
<h3>Comparison</h3>
<div class="container">
<div class="column">
<script src="https://gist.github.com/nicolasfavier/a6a6f01d0991a8ca39e6c98c6d519886.js"></script>
</div>
<div class="column">
<script src="https://gist.github.com/nicolasfavier/bdf2e6264a6227a1fc963b79223b5bdb.js"></script>
</div>
</div>
</section>
<section>
<h1>RxAndroid</h1>
<h4>
Go check the lib:<a href="https://github.com/ReactiveX/RxAndroid" target="_blank"> Rx Android</a>
</h4>
</section>
<section>
<h3>Pros</h3>
<ul>
<li>Handling threads in an elegant way</li>
<li>Work on loops</li>
<li>Handling errors</li>
</ul>
<br/>
<br/>
<h3>Cons</h3>
<ul>
<li>Harder to read</li>
<li>Harder to debug</li>
<li>Other way of thinking</li>
</ul>
</section>
<section>
<h1>Dagger</h1>
<img data-src="images/dagger.png" height="200px">
<h4>
Go check the lib:<a href="http://square.github.io/dagger/" target="_blank"> Dagger</a>
</h4>
</section>
<section>
<h3>Pros</h3>
<ul>
<li>Simple access to shared instances</li>
<li>Easier unit and integration testing</li>
<li>Scoped instances</li>
</ul>
<br/>
<br/>
<h3>Cons</h3>
<ul>
<li>Hard to setup</li>
<li>Injection errors are a pain to debug</li>
</ul>
</section>
<section>
<h1>EventBus</h1>
<img data-src="images/eventbus.png" height="200px">
<h4>
Go check the lib:<a href="https://github.com/greenrobot/EventBus" target="_blank"> EventBus</a>
</h4>
</section>
<section>
<h3>Pros</h3>
<ul>
<li>Simplifies the communication between components</li>
<li>Decouples event senders and receivers</li>
<li>Avoids complex dependencies and life cycle issues</li>
<li>A simple way to handle threads</li>
</ul>
<br/>
<br/>
<h3>Cons</h3>
<ul>
<li>Spaghetti Code</li>
<li>Can't follow the event while debugging</li>
</ul>
</section>
<section>
<h3>Comparison</h3>
<div class="container">
<script src="https://gist.github.com/nicolasfavier/ecc2fe12f10c0877c7a9883e7b12ed6a.js"></script>
</div>
</section>
<section>
<h1>Android Jetpack</h1>
<img data-src="images/jetpack.png" height="400px">
<h4>
<a href="https://developer.android.com/jetpack/" target="_blank">developer.android.com/jetpack</a>
</h4>
</section>
<section>
<h3>Pros</h3>
<ul>
<li>Build high quality, robust apps</li>
<li>Eliminate boilerplate code</li>
<li>Accelerate development</li>
</ul>
<br/>
<br/>
<h3>Cons</h3>
<ul>
<li>May be hard for beginners</li>
<li>Many components to master</li>
</ul>
<br/>
</section>
<section>
<h2>Other useful tools</h2>
<ul>
<li><a href="https://docs.fabric.io/android/fabric/overview.html" target="_blank">Fabric</a></li>
<li><a href="http://facebook.github.io/stetho/" target="_blank">Stetho</a></li>
<li><a href="https://github.com/square/leakcanary" target="_blank">Leakcanary</a></li>
<li><a href="https://www.google.com/intl/fr_fr/analytics/" target="_blank">Analytics</a></li>
<li><a href="https://developer.android.com/studio/build/shrink-code.html"
target="_blank">ProGuard</a></li>
<li><a href="http://robolectric.org/" target="_blank">Robolectric</a></li>
</ul>
</section>
</section>
<section>
<section>
<h1>Patterns</h1>
</section>
<section>
<h1>Model View Presenter</h1>
</section>
<section>
<h3>MVP</h3>
<img data-src="images/mvp.png" height="500px">
</section>
<section>
<h3>Pros</h3>
<ul>
<li>Testable / Easy to get reviewed</li>
<li>Maintainable</li>
<li>Information Hiding</li>
<li>Split the Activity / Fragment</li>
</ul>
<br/>
<br/>
<h3>Cons</h3>
<ul>
<li>Redundant, especially when the app size is small</li>
<li>Requires time before starting coding (but I bet, the architecture step is the must step for all
development)
</li>
</ul>
</section>
<section>
<h3>Show me the code</h3>
<span class="fragment"><script
src="https://gist.github.com/nicolasfavier/dce4c1dc3594250cbda2f672cb2d661e.js"></script></span>
</section>
<section>
<h3>The Activity</h3>
<span class="fragment"><script
src="https://gist.github.com/nicolasfavier/e37be548b7a0b8c7e8b2fc8f9c1282e9.js"></script></span>
</section>
<section>
<h3>The presenter</h3>
<script src="https://gist.github.com/nicolasfavier/4f06340dd978c4d07864f00d104bc256.js"></script>
</section>
</section>
<section>
<section id="cross">
<h1>Cross platforms</h1>
</section>
<section>
<h3>Phonegap / Cordova</h3>
<p>
PhoneGap is a distribution of Apache Cordova. You can think of Apache Cordova as the engine that
powers PhoneGap.
</p>
<img data-src="images/phonegap_cordova.jpg" height="200px">
<p>It provides mobile apps with HTML, CSS & JS, target multiple platforms with one code base, Free and
open
source</p>
</section>
<section>
<h3>Titanium</h3>
<p>
Titanium is not an attempt at “write once, run everywhere”.
<br/>
There is a core of mobile development APIs which can be normalized across platforms. These areas
should be targeted for code reuse.
<br/>
There are platform-specific APIs, UI conventions, and features which developers should incorporate
when developing for that platform.
</p>
<img data-src="images/titanium.png" height="200px">
</section>
<section>
<h3>Xamarin</h3>
<p>
Build native apps for multiple platforms on a shared C# codebase and add native code.
</p>
<img data-src="images/xamarin.png" height="200px">
</section>
<section>
<h3>Pros</h3>
<ul>
<li><b>Speed:</b> faster to develop, “write once, run everywhere” (unless, the application requires
a lot of
customization for each platform)
</li>
<li><b>Simplicity:</b> Updates to your cross-platform app would, naturally, be instantly synced
across all platforms and
devices.
</li>
</ul>
<br/>
<h3>Cons</h3>
<ul>
<li><b>Platform limitations:</b> Each platform has its own unique style and affords certain
flexibilities missing in others.
</li>
<li><b>Integration challenges:</b> Data bases, shared prefs, notifications...
</li>
<li><b>User Experience</b>
</li>
</ul>
</section>
<section>
<h3>Sum up</h3>
<img data-src="images/cross_comp.png" height="500px">
</section>
</section>
<section>
<section id="ux">
<h1>User experience</h1>
</section>
<section>
<h3>iOs versus android</h3>
<img data-src="images/android7.png" height="500px">
<img data-src="images/ios10.png" height="500px">
</section>
<section>
<h3>Deux façons de voir les choses...</h3>
<img data-src="images/facebook-android.png" height="500px">
<img data-src="images/facebook-iphone.jpeg" height="500px">
</section>
<section>
<h3>... mais de plus en plus proche !</h3>
<div class="fragment">
<img data-src="images/spotify-android.png" height="500px">
<span class="fragment"> <img data-src="images/facebook-iphone.jpeg" height="500px">
</span>
</div>
</section>
<section>
<h3>Check those links :</h3>
<ul>
<li><a href="https://developer.android.com/training/best-ux.html" target="_blank">https://developer.android.com/training/best-ux.html</a>
</li>
<li><a href="https://developer.android.com/design/index.html" target="_blank">https://developer.android.com/design/index.html</a>
</li>
<li><a href="https://material.google.com/" target="_blank">https://material.google.com/</a></li>
<li><a href="https://google.com/design" target="_blanck">https://google.com/design</a></li>
</ul>
</section>
</section>
<section>
<section>
<h1><a href="project.html" target="_blank">The project</a></h1>
<a href="project.html" target="_blank">Follow me !</a>
</section>
</section>
</section>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
Reveal.initialize({
history: true,
dependencies: [
{src: 'plugin/markdown/marked.js'},
{src: 'plugin/markdown/markdown.js'},
{src: 'plugin/notes/notes.js', async: true},
{
src: 'plugin/highlight/highlight.js', async: true, callback: function () {
hljs.initHighlightingOnLoad();
}
}
]
});
</script>
</body>
</html>