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
Y U NO CRAFTSMAN
Search
Xavi Rigau
October 09, 2014
Programming
3
150
Y U NO CRAFTSMAN
Presentation we gave at Droidcon Stockholm "Y U NO CRAFTSMAN".
By Paul Blundell and Xavi Rigau
Xavi Rigau
October 09, 2014
Tweet
Share
More Decks by Xavi Rigau
See All by Xavi Rigau
Android UI Testing with Espresso
xrigau
5
1.3k
Other Decks in Programming
See All in Programming
Serverless苦闘史
mosh_inc
0
150
DevTools extensions で 独自の DevTool を開発する | FlutterKaigi 2024
kokiyoshida
0
460
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1k
Amazon Aurora Serverless v2のアプデと、Amazon Aurora PostgreSQL Limitless DatabaseのGAについて
satoshi256kbyte
0
110
WebAssembly Unleashed: Powering Server-Side Applications
chrisft25
0
2.1k
Develop iOS apps with Neovim / vimconf_2024
uhooi
1
340
コンテンツの主権を守るため(?)、高機能画像CDNからAWS自前対応に乗り換えた話
lengthtail
1
120
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Italy
prof18
0
150
Modular Monolith Monorepo ~シンプルさを保ちながらmonorepoのメリットを最大化する~
yuisakamoto
11
4.1k
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1k
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
2.2k
Welcome JSConf.jp 2024
yosuke_furukawa
PRO
0
3.1k
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
27
2.1k
Building an army of robots
kneath
302
44k
Building Adaptive Systems
keathley
38
2.3k
The Language of Interfaces
destraynor
154
24k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Thoughts on Productivity
jonyablonski
67
4.3k
Raft: Consensus for Rubyists
vanstee
136
6.7k
GitHub's CSS Performance
jonrohan
1030
460k
The Pragmatic Product Professional
lauravandoore
32
6.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Automating Front-end Workflow
addyosmani
1366
200k
Transcript
Y U NO CRAFTSMAN Xavi Rigau & Paul Blundell
Who we are @xrigau @blundell_apps
What is craftsmanship? craftsmanship ˈkrɑːf(t)smənʃɪp/ the quality of design and
work shown in something
Coder vs Craftsman “Make a chair”
We’re gonna talk about... - Improving day to day craftsmanship
- Creating a positive working environment - The final few steps to awesomeness - Opinionated Bonus material
Improving day to day craftsmanship
Whiteboard ideation
Brainstorming sessions
Helping non dev team members WTF??
Pair programming
Pairing tennis
Driver & Navigator Mistakes Driver Would make Mistakes Navigator Would
make Actual Mistakes
Best coding practices
Code reviews
Selfies & Gifs https://github.com/thieman/github-selfies
Caring about the CI
Static analysis reports
Testing is caring
CI Game LOL
Using the latest tools
Be “agile” build features the way that makes sense
YAGNI Overengineering You Ain’t Gonna Need It GSD
Pragmatism
Creating a positive working environment
Continuous communication
Morning standups
Daily news
Hack & Tells
Dojos
Zero walls office
2 keyboards 2 mice per desk
Standing desks
Remote working
Remote working
Hal9000/Jukebox music
CI Alarm
Xbox downtime
PUB!
Hire the best (for you)
The final steps to awesomeness
That extra 5%
Optimise & leave the main thread alone
Strict Mode private void initializeStrictMode() { if (BuildConfig.DEBUG) { ThreadPolicy
threadPolicy = new ThreadPolicy.Builder() .detectAll() .penaltyLog() .penaltyDeath() .build(); StrictMode.setThreadPolicy(threadPolicy); VmPolicy vmPolicy = new VmPolicy.Builder() .detectAll() .penaltyLog() .penaltyDeath() .build(); StrictMode.setVmPolicy(vmPolicy); } }
GPU Profiling
Show Overdraw
Polish the app
Animate all the things
User features - Second screen / Chromecast - Widget -
Wear - Daydream - LiveWallpaper
Behind the scenes - Content provider - Sync Adapter -
Deep linking / Web search deep linking
Listen for feedback
Measure the data
Measuring Tools Splunk MINT (a.k.a. Bugsense) Crashlytics
Follow the guidelines
What happens when you don’t follow the guidelines
Ensure your app listing is legit
Ensure your app content is legit
Debug screens
Gradle all the things
Build types buildTypes { debug { versionName "${VERSION_NAME}_${GIT_SHA}" runProguard false
signingConfig signingConfigs.debug buildConfigField "String", "BUGSENSE_KEY", 'BuildConfig.INVALID' buildConfigField "boolean", "AB_TEST", 'false' } qa { runProguard false signingConfig signingConfigs.debug buildConfigField "String", "BUGSENSE_KEY", '"disSecret"' } release { runProguard true signingConfig signingConfigs.release buildConfigField "String", "BUGSENSE_KEY", '"lolNotTellingYou"' } }
Versioning
Proper versioning ext { GIT_SHA = gitSha() CI_BUILD_NUMBER = jenkinsBuildNumber()
VERSION_CODE = 19101 // scheme: MINSDK-VERSION dd-ddd VERSION_NAME = "1.0.1" } def jenkinsBuildNumber() { // Local builds will always trump jenkins return System.getenv().BUILD_NUMBER?.toInteger() ?: 9999 } def gitSha() { return 'git rev-parse --short HEAD'.execute().text.trim() } // ... versionCode "${VERSION_CODE}${CI_BUILD_NUMBER}" as Integer versionName "${VERSION_NAME}_${GIT_SHA}"
Opinionated Bonus
The dark side of AOSP try { mWallpaper = getCurrentWallpaperLocked(context);
} catch (OutOfMemoryError e) { Log.w(TAG, "No memory load current wallpaper", e); } try { BitmapFactory.Options options =new BitmapFactory.Options(); return BitmapFactory.decodeStream(is, null, options); } catch (OutOfMemoryError e) { Log.w(TAG, "Can't decode stream", e); } https://android.googlesource.com in WallpaperManager.java - line 263
Follow the examples - but not too closely
Patterns that work well for us
minSdkVersion 15 For more info: https://developer.android.com/about/dashboards/index.html
Activity lifecycle callbacks public interface ActivityLifecycleCallbacks { void onActivityCreated(Activity activity,
Bundle savedInstanceState); void onActivityStarted(Activity activity); void onActivityResumed(Activity activity); void onActivityPaused(Activity activity); void onActivityStopped(Activity activity); void onActivityDestroyed(Activity activity); void onActivitySaveInstanceState(Activity activity, Bundle outState); } public class MyActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks { … } public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); registerActivityLifecycleCallbacks(new MyActivityLifecycleCallbacks()); } }
Harden! Do not crash out there public class LoggingUncaughtExceptionHandler implements
Thread.UncaughtExceptionHandler { private static final String TAG = "MyApp"; @Override public void uncaughtException(Thread thread, Throwable ex) { Log.wtf(TAG, "Swallowed an uncaught exception.", ex); } } private void swallowExceptionsInRelease() { if (!BuildConfig.DEBUG) { Thread.UncaughtExceptionHandler handler = new LoggingUncaughtExceptionHandler(); Thread.currentThread().setUncaughtExceptionHandler(handler); } }
newInstance all the things! public class WidgetImageLoader { private final
Retriever memoryRetriever; private final Retriever fileRetriever; public static WidgetImageLoader newInstance(Context context) { Retriever memoryRetriever = MemoryRetriever.getInstance(); Retriever fileRetriever = FileRetriever.newInstance(context); return new WidgetImageLoader(memoryRetriever, fileRetriever); } WidgetImageLoader(Retriever memoryRetriever, Retriever fileRetriever) { this.memoryRetriever = memoryRetriever; this.fileRetriever = fileRetriever; } }
Hexagonal architecture cc. Alistair Cockburn
In summary
None
Questions?
We are hiring Liverpool, London, Berlin & New York
[email protected]