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
30
Fundamentals of creating Android mobile apps
scottyab
0
39
What's 'Q' in Android Security
scottyab
0
180
Faster mobile debugging using a HTTP Proxy
scottyab
0
29
I <3 Charles Proxy
scottyab
0
42
What_s_new_from_Google_IO_2018.pdf
scottyab
0
60
Doppl, an intro!
scottyab
0
54
OMG What's new in Security
scottyab
0
57
What's New from Google I/O 2017
scottyab
0
91
Other Decks in Technology
See All in Technology
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
6
670
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
750
フルカイテン株式会社 採用資料
fullkaiten
0
40k
The Rise of LLMOps
asei
6
1.3k
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
170
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.6k
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
120
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Why Our Code Smells
bkeepers
PRO
334
57k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Typedesign – Prime Four
hannesfritz
40
2.4k
Designing for humans not robots
tammielis
250
25k
GraphQLとの向き合い方2022年版
quramy
43
13k
Designing for Performance
lara
604
68k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
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