Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Getting Started in Android Dev 2016
Search
Scott Alexander-Bown
November 07, 2016
Technology
0
130
Getting Started in Android Dev 2016
Guest lecture/talk for Comp Sci Bristol University - Nov 2016.
Scott Alexander-Bown
November 07, 2016
Tweet
Share
More Decks by Scott Alexander-Bown
See All by Scott Alexander-Bown
What's New In Android 15 Security
scottyab
0
170
Fundamentals of creating Android mobile apps
scottyab
0
71
What's 'Q' in Android Security
scottyab
0
290
Faster mobile debugging using a HTTP Proxy
scottyab
0
62
I <3 Charles Proxy
scottyab
0
86
What_s_new_from_Google_IO_2018.pdf
scottyab
0
130
Doppl, an intro!
scottyab
0
94
OMG What's new in Security
scottyab
0
69
What's New from Google I/O 2017
scottyab
0
110
Other Decks in Technology
See All in Technology
Rubyist入門: The Way to The Timeless Way of Programming
snoozer05
PRO
7
520
なぜブラウザで帳票を生成したいのか どのようにブラウザで帳票を生成するのか
yagisanreports
0
140
組織の“見えない壁”を越えよ!エンタープライズシフトに必須な3つのPMの「在り方」変革 #pmconf2025
masakazu178
1
320
Lazy Constant - finalフィールドの遅延初期化
skrb
0
240
米軍Platform One / Black Pearlに学ぶ極限環境DevSecOps
jyoshise
2
510
現地速報!Microsoft Ignite 2025 M365 Copilotアップデートレポート
kasada
1
1.4k
Error.prototype.stack の今と未来
progfay
1
180
Capitole du Libre 2025 - Keynote - Cloud du Coeur
ju_hnny5
0
120
改竄して学ぶコンテナサプライチェーンセキュリティ ~コンテナイメージの完全性を目指して~/tampering-container-supplychain-security
mochizuki875
1
360
手を動かしながら学ぶデータモデリング - 論理設計から物理設計まで / Data modeling
soudai
PRO
25
6.1k
その意思決定、まだ続けるんですか? ~痛みを超えて未来を作る、AI時代の撤退とピボットの技術~
applism118
0
1.3k
今、MySQLのバックアップを作り直すとしたら何がどう良いのかを考える旅
yoku0825
2
460
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Why Our Code Smells
bkeepers
PRO
340
57k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.1k
GitHub's CSS Performance
jonrohan
1032
470k
A Tale of Four Properties
chriscoyier
162
23k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
How GitHub (no longer) Works
holman
315
140k
Code Review Best Practice
trishagee
72
19k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Transcript
GETTING STARTED WITH ANDROID DEV 2016 Scott Alexander-Bown @scottyab
WHO THE HECK IS THIS GUY? ➤ Freelance (remote) Android
Developer ➤ https://scottyab.com ➤ Google Developer Expert for Android ➤ Founder/Organiser SWMobile Meetup ➤ http://swmobile.org ➤ Co-Author Android Security Cookbook ➤ Follow on Twitter @scottyab @scottyab
@scottyab
AT A GLANCE ➤Tools / IDE ➤Components ➤Dependancies / 3rd
Party Libs ➤Tips *Reminder LAB - 11am to Midday, Wednesday 9th November 2016 Merchant Venturer's Building 2.11 Linux Computer Lab
What is Android?
https://developer.android.com @scottyab
@scottyab
Android Components @scottyab
ACTIVITY ➤ AKA a Screen ➤ has distinct lifecycle ➤
onCreate() ➤ onStart() ➤ onResume() ➤ onPause() ➤ onStop() ➤ onDestory() https://play.google.com/store/apps/details?id=name.peterscully.learning.activitylifecycle @scottyab
RESOURCES AND LAYOUTS ➤ Layouts • Xml ➤ Values •
Strings • Styles ➤ Drawables
DESIGN XML
INTENTS ➤ Action ➤ Extra ➤ Primitives ➤ Parcelables public
void sendMessage(String message) { Intent intent = new Intent(this, DisplayMessageActivity.class); intent.putExtra(EXTRA_MESSAGE, message); startActivity(intent); } @scottyab
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_display_message); Intent
intent = getIntent(); String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); TextView messageText = (TextView)findViewById(R.id.messageText); messageText.setText(message); }
SERVICES ➤ Background operations ➤ Lifecycle ➤ Service ➤ Bind
➤ IntentService ➤ Work thread ➤ Start with Intent @scottyab
ANDROID MANIFEST.XML @scottyab
LISTS / RECYCLERVIEW ➤ Xml Layout for list <RecyclerView> ➤
Layout for the row ➤ Adapter ➤ Binding ➤ ViewHolder ➤ RecyclerView.setAdapter(…) @scottyab
FRAGMENTS ➤ Reusable UI/Logic component ➤ Own Lifecycle @scottyab
.APK AND DISTRIBUTION ➤ Android apps are packaged as .apk
files ➤ Signed with developer signing key ➤ Upload to the Play Store • $25 one off registration fee • Screen shots • Unique App Id @scottyab
Dependancies and 3rd party libraries
GRADLE ➤ Run from CI and IDE ➤ Easy dependancy
management ➤ Build variants • types • flavours
INCLUDING DEPENDANCIES ➤ build.gradle dependencies { /* * Google Play
services */ compile 'com.google.maps.android:android-maps-utils:0.4.4' compile 'com.google.android.gms:play-services-maps:9.6.1' compile 'com.google.android.gms:play-services-location:9.6.1' @scottyab
INCLUDING DEPENDANCIES (JITPACK) compile 'com.github.scottyab:Calligraphy:v2.1.1_LABEL_FOR' @scottyab
SUPPORT LIBRARY ➤ Backward-compatible versions of framework components. ➤ UI
elements to implement the recommended Android layout patterns. ➤ Support for different form factors. ➤ Miscellaneous utility functions. @scottyab
https://github.com/JakeWharton/butterknife UI: BUTTER KNIFE @scottyab
CONVERT JAVA OBJECTS INTO JSON AND BACK https://github.com/google/gson API: GSON
@scottyab
TYPE-SAFE HTTP CLIENT MAKES APIS EASY SIMPLE ASYNC https://github.com/square/retrofit API:
RETROFIT @scottyab
@scottyab
T ANDROID-ARSENAL.COM
@scottyab
None
USE GIT ➤ GitHub ➤ GitLab.com ➤ BitBucket @scottyab
TIPS ▸ Lock to portrait ▸ Focus on limited devices
▸ Test on demo devices ▸ Target SDK 15+ (or even 21+) @scottyab
AVOID ▸ Child Fragments ▸ Constraint layout ▸ Bleeding edge!
@scottyab
FABRIC / CRASHLYTICS ➤ By Twitter ➤ Crash Reporting ➤
Beta distribution ➤ Analytics ➤ https://get.fabric.io @scottyab
SAMPLE APPS ▸ github.com/google/iosched ▸ github.com/googlesamples/android-topeka ▸ github.com/nickbutcher/plaid ▸ github.com/chrisbanes/philm
▸ github.com/JakeWharton/u2020 ▸ github.com/googlesamples @scottyab
@scottyab
THANKS swmobile.org github/scottyab @scottyab
[email protected]
QUESTIONS? LAB - 11am to
Midday, Wednesday 9th November 2016 Merchant Venturer's Building 2.11 Linux Computer Lab
QUESTIONS? @scottyab