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
Kickstart your Android development
Search
Dino Kovač
March 24, 2016
Programming
1
76
Kickstart your Android development
Presentation / workshop for App Start Contest
Dino Kovač
March 24, 2016
Tweet
Share
More Decks by Dino Kovač
See All by Dino Kovač
Developing an Android library
reisub
0
130
Continuous integration and deployment on Android (plus some sweets)
reisub
1
570
Continuous integration and deployment on Android
reisub
0
220
Other Decks in Programming
See All in Programming
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
120
童醫院敏捷轉型的實踐經驗
cclai999
0
210
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
170
WebViewの現在地 - SwiftUI時代のWebKit - / The Current State Of WebView
marcy731
0
110
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
600
NPOでのDevinの活用
codeforeveryone
0
650
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
1
330
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
240
ニーリーにおけるプロダクトエンジニア
nealle
0
710
GoのGenericsによるslice操作との付き合い方
syumai
3
710
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
840
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
620
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
940
Visualization
eitanlees
146
16k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Transcript
Kickstart your Android development DINO KOVAČ ANDROID TEAM LEAD
ABOUT INFINUM • independent design and development agency • 90
employees • 15 Android Engineers • hundreds of projects
01 ANDROID STUDIO 2.0
SHORTCUTS • CTRL + SHIFT + A → find action
• SHIFT + F6 → rename • ALT + F7 → find usages • CTRL + SHIFT + O → open file
DEBUGGER
EVALUATE EXPRESSION
PROFILING TOOLS • find bottlenecks in the app • identify
memory leaks
None
None
02 ANDROID EMULATOR 2.0
None
03 DEBUGGING LAYOUTS
DEVELOPER TOOLS ON DEVICE • to enable press build number
7 times (Settings - About phone) • you get a bunch of useful options
None
None
HIERARCHY VIEWER • inspect your view hierarchy at runtime •
profile measure/layout/draw and find bottlenecks • comes with Android SDK
None
04 LIBRARIES
GLIDE • simple image loading library • built-in caching •
animated gifs! • https://github.com/bumptech/glide Glide.with(this).load("http://goo.gl/gEgYUd").into(imageView);
OKHTTP • fast, well-tested and maintained http client • many
features (spdy and http/2 support, websockets, …) • nice API (as opposed to HttpURLConnection) • http://square.github.io/okhttp/
GSON • JSON (de)serialization library from Google • Java objects
<=> JSON string
{ "id": "2GC3t5Un6d1BEF5a6BTYo05jYCfv7OYcLvAJqxwRGPxT8xH1oY9ivM7uBFoY5Cvf", "ttl": 1209600, "userId": "565dc7fe6ebcd2f77e040728" }
public class LoginResponse implements Serializable { @SerializedName("id") private String
accessToken; @SerializedName("userId") private String userId; @SerializedName("ttl") private int timeToLive; public String getAccessToken() { return accessToken; } public String getUserId() { return userId; } public int getTimeToLive() { return timeToLive; } }
RETROFIT • ‘turns your HTTP API into a Java interface’
• http://square.github.io/retrofit/
public interface ApiService { @POST("/api/users/login") Call<LoginResponse> authenticateUser(@Body LoginRequest loginRequest);
@POST("/api/users") Call<RegisterResponse> registerUser(@Body RegisterRequest registerRequest); @GET("/api/users/{userId}/timezones") Call<List<Timezone>> getTimezones(@Path("userId") String userId); @DELETE("/api/users/{userId}/timezones/{timezoneId}") Call<Void> deleteTimezone(@Path("userId") String userId, @Path("timezoneId") String timezoneId); @POST("/api/users/{userId}/timezones") Call<Void> createTimezone(@Path("userId") String userId, @Body Timezone timezone); @GET("/api/users") Call<List<User>> getUsers(); @PUT("/api/users/{userId}") Call<User> updateUser(@Path("userId") String userId, @Body User user); @DELETE("/api/users/{userId}") Call<Void> deleteUser(@Path("userId") String userId); @GET("/api/users/{userId}/roles") Call<List<UserRole>> getUserRoles(@Path("userId") String userId); }
BUTTERKNIFE • reduces boilerplate code to get view references •
generates similar code to what you would write • also does resource binding (strings, drawables, colors, …) • http://jakewharton.github.io/butterknife/
WITHOUT BUTTERKNIFE TextView helloText; TextView secondHelloText; @Override protected void onCreate(Bundle
savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); secondHelloText = (TextView) findViewById(R.id.text_hello2); secondHelloText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO } }); helloText = (TextView) findViewById(R.id.text_hello); // TODO }
WITH BUTTERKNIFE // build.gradle compile 'com.jakewharton:butterknife:7.0.1' // MainActivity.java @Bind(R.id.text_hello2) TextView
secondHelloText; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); // TODO } @OnClick(R.id.text_hello) protected void onHelloClicked() { // TODO }
HUGO • Annotation-triggered method call logging • https://github.com/JakeWharton/hugo @DebugLog public
String getName() { return name; } V/EXAMPLE: ⇢ GETNAME() V/EXAMPLE: ⇠ GETNAME [0MS] = "JAKE WHARTON"
DBFLOW • ORM library with annotation processing • generates code
for interaction with SQLite databases so you don’t have to write it by hand
None
DBINSPECTOR • adds additional launcher icon for viewing db contents
and schema • great for debugging db issues • https://github.com/infinum/android_dbinspector/
None
THREETEN-ABP • backport of the new Date API introduced in
Java 8 (JSR-310) • https://github.com/JakeWharton/ThreeTenABP
LEAK CANARY • automatically detect common classes of memory leaks
• https://github.com/square/leakcanary
MAGIC VIEWS • easily use custom fonts in your app
• https://github.com/ikocijan/MagicViews
05 STAYING UP TO DATE
• Jake Wharton • Reto Meier • Cyril Mottier •
Dan Lew • Chris Banes • Mark Murphy • Mark Allison PEOPLE TO FOLLOW
NEWSLETTERS TO READ • https://androidsweets.ongoodbits.com/ • http://androidweekly.net/
Use the source, Luke!
INFINUM ANDROID TALKS • http://www.meetup.com/Infinum-Android-Talks-Zagreb/ • new libs • practical
tips • a place to ask for advice • next event: 7.4.2016. at 18h CET (Strojarska 22)
REFERENCES • http://developer.android.com/sdk/installing/studio- tips.html • http://stackoverflow.com/questions/294167/what-are- the-most-useful-intellij-idea-keyboard-shortcuts • http://developer.android.com/tools/debugging/ debugging-ui.html
Any questions?
[email protected]
@DINO_BLACKSMITH Visit infinum.co or find us on
social networks: infinum.co infinumco infinumco infinum