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
テストから始めるAgentic Coding 〜Claude Codeと共に行うTDD〜 / Agentic Coding starts with testing
rkaga
13
4.6k
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
560
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
1k
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
270
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
780
おやつのお供はお決まりですか?@WWDC25 Recap -Japan-\(region).swift
shingangan
0
140
Deep Dive into ~/.claude/projects
hiragram
14
2.6k
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
200
「Cursor/Devin全社導入の理想と現実」のその後
saitoryc
0
830
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
800
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
520
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
580
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
A designer walks into a library…
pauljervisheath
207
24k
Music & Morning Musume
bryan
46
6.6k
Optimizing for Happiness
mojombo
379
70k
BBQ
matthewcrist
89
9.7k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Done Done
chrislema
184
16k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
960
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
How to Ace a Technical Interview
jacobian
278
23k
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? DINO@INFINUM.CO @DINO_BLACKSMITH Visit infinum.co or find us on
social networks: infinum.co infinumco infinumco infinum