Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies...
Transcript of Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies...
![Page 1: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/1.jpg)
Getting started with AndroidPart 2
Presented by: Cassiano Monteiro
1/12/18
![Page 2: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/2.jpg)
Contents§ Managing library dependencies
§ More UI components
§ Screen transitions
§ Internet requests
§ Permissions
PAGE 2
![Page 3: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/3.jpg)
TextInputLayout
PAGE 3
* https://developer.android.com/reference/android/support/design/widget/TextInputLayout.html
* https://developer.android.com/studio/build/gradle-tips.html
Add to gradle:dependencies {
implementation 'com.android.support:design:26.1.0'}
![Page 4: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/4.jpg)
Screen transition
PAGE 4
* https://developer.android.com/reference/android/content/Intent.html
Extra(key-value data)
![Page 5: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/5.jpg)
GitHub Reader app§ Get user repositories from GitHub’s REST API
§ GET /users/:username/repos
{
"id": 1296269,
"name": "Hello-World",
"description": "This your first repo!",
"language": null
}
PAGE 5
* https://developer.github.com/v3/repos/#list-user-repositories
![Page 6: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/6.jpg)
Dealing with REST server§ HTTP Client Library:
Retrofit§ Request URLs
§ Header/query parameters
§ Request responses
§ JSON <-> POJO Library: GSON§ Map JSON ids to object
properties
PAGE 6
* http://square.github.io/retrofit/
* https://github.com/google/gson
* https://github.com/codepath/android_guides/wiki/Consuming-APIs-with-Retrofit
![Page 7: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/7.jpg)
Permissions
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
PAGE 7
* https://developer.android.com/guide/topics/permissions/index.html
* https://developer.android.com/guide/topics/permissions/normal-permissions.html
![Page 8: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/8.jpg)
Main/UI Thread
PAGE 8
* https://youtu.be/FWwMA-sdOgk
* https://developer.android.com/guide/components/processes-and-threads.html
![Page 9: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/9.jpg)
ANR: Application not responding
PAGE 9
![Page 10: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/10.jpg)
RecyclerView
PAGE 10
RecyclerView
* https://youtu.be/2lcoB5-PCCw
![Page 11: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/11.jpg)
RecyclerView
PAGE 11
* https://developer.android.com/training/material/lists-cards.html
RecyclerView
(ViewHolders)
![Page 12: Getting started with Android Part 2 · 2018-01-14 · Contents §Managing library dependencies §More UI components §Screen transitions §Internet requests §Permissions PAGE 2](https://reader033.fdocuments.us/reader033/viewer/2022060503/5f1d023fbcdf535e963af6d7/html5/thumbnails/12.jpg)
Useful links§ Libraries
§ https://github.com/codepath/android_guides/wiki/Must-Have-Libraries
§ https://developer.android.com/topic/libraries/index.html
§ https://github.com/codepath/android_guides/wiki/Home/6c236e883cc70912ccdd859173050fc147d409f1
§ Automated testing
§ Training: https://developer.android.com/training/testing/index.html
§ Mock library: http://site.mockito.org
§ RxJava (functional programming, good for async and concurrency)
§ https://github.com/ReactiveX/RxAndroid
§ Firebase (database, cloud storage, backend functions, authentication, crash reports)
§ https://firebase.google.com
PAGE 12