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
DroidCon India - Coding With Your Hands Tied
Search
Darshan Pania
November 03, 2019
Technology
0
110
DroidCon India - Coding With Your Hands Tied
Darshan Pania
November 03, 2019
Tweet
Share
More Decks by Darshan Pania
See All by Darshan Pania
Coding With Your Hands Tied
darshanpania
0
94
Other Decks in Technology
See All in Technology
下手な強制、ダメ!絶対! 「ガードレール」を「檻」にさせない"ガバナンス"の取り方とは?
tsukaman
2
420
Terraformで構築する セルフサービス型データプラットフォーム / terraform-self-service-data-platform
pei0804
1
160
オブザーバビリティが広げる AIOps の世界 / The World of AIOps Expanded by Observability
aoto
PRO
0
350
RSCの時代にReactとフレームワークの境界を探る
uhyo
10
3.3k
2025年になってもまだMySQLが好き
yoku0825
8
4.6k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
8.7k
ハードウェアとソフトウェアをつなぐ全てを内製している企業の E2E テストの作り方 / How to create E2E tests for a company that builds everything connecting hardware and software in-house
bitkey
PRO
1
120
会社紹介資料 / Sansan Company Profile
sansan33
PRO
6
380k
Skrub: machine-learning with dataframes
gaelvaroquaux
0
120
人工衛星のファームウェアをRustで書く理由
koba789
13
7.2k
250905 大吉祥寺.pm 2025 前夜祭 「プログラミングに出会って20年、『今』が1番楽しい」
msykd
PRO
1
690
DDD集約とサービスコンテキスト境界との関係性
pandayumi
3
280
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to Ace a Technical Interview
jacobian
279
23k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Site-Speed That Sticks
csswizardry
10
810
How to train your dragon (web standard)
notwaldorf
96
6.2k
Facilitating Awesome Meetings
lara
55
6.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Scaling GitHub
holman
463
140k
Done Done
chrislema
185
16k
Transcript
Coding With Your Hands Tied - A session on Android
Library development
Introduction
About Me Darshan Pania Lead Android SDK Developer CleverTap https:/
/github.com/CleverTap/clev ertap-android-sdk Twitter - @i_m_Pania
Helping marketing, product and growth teams at B2C companies retain
their users for life. We enable this at scale, in real-time and with precision by providing a unique combination of: 1. A unified user data platform 2. Actionable insights and segmentation 3. Timely, personalized omni-channel engagement What does do?
What to expect from this session? • Interactive
What to expect from this session? • Interactive • Informative
What to expect from this session? • Interactive • Informative
• Educative
None
None
Apps vs Libraries App Library What is the difference?
Dependencies used by Apps • Networking ◦ Volley ◦ Retrofit
• Image/GIFs ◦ Glide ◦ Picasso • Video ◦ ExoPlayer • Databases ◦ Room ◦ Realm ◦ greenDAO • Dependency Injection ◦ Dagger ◦ ButterKnife • UI Components ◦ Constraint Layout
This is how an App’s build.gradle file looks like -
Dependencies used by Libraries • Networking ◦ None • Image/GIFs
◦ None • Video ◦ None • Databases ◦ None • Dependency Injection ◦ None • UI Components ◦ None
Dependencies used by CleverTap SDK • Networking ◦ None •
Image/GIFs ◦ Glide • Video ◦ ExoPlayer • Databases ◦ None • Dependency Injection ◦ None • UI Components ◦ None
This is how CleverTap SDK’s build.gradle file looks like -
Solutions for Libraries
How do Libraries handle Networking? • HTTPS Connection • A
custom queueing mechanism
Setting up HTTPS connections
Setting up a queueing mechanism
How do Libraries handle Images/GIFs/Videos? • LRUCache • ExoPlayer is
the best!
Initializing a LRUCache
Adding a Bitmap or GIF byte array data to the
LRUCache
Using ExoPlayer to stream videos
Part I - Prepare the media to be shown
Part II - Play the media
How do Libraries handle Databases? • SQLite
Creating Tables, handling Database initialization and Database upgrade
How do Libraries handle Dependency Injection? • Good old findViewById
A simple XML Layout
Handling UI views in code
How do Libraries handle UI layouts? • Legacy is the
only way for us...
XML Layout for our Inbox Activity
What can we do better?
How to publish Libraries? • Setup Bintray account • Setup
your build.gradle • Package and Publish
Setup a Bintray Account
Bintray is your friend!
Add a New Repository!
Give your repository a name, select “Maven” as a type
Setup your build.gradle
Add your Bintray username and API key to local.properties In
the build.gradle of your library module
implementation ‘com.darshan.logg:logg:1.0’
At the end of your build.gradle file, you need to
add this
None
Package and Publish
Now run two Gradle commands on your Terminal/Android Studio
Add your library to JCenter
None
Q&A
That’s all folks! Darshan Pania, CleverTap @i_m_Pania