SlideShare a Scribd company logo
1 of 28
Download to read offline
eXtreme eXception eXpectation
Crashes suck!
IT´S DANGEROUS TO GO
ALONE! TAKE THIS!
What what, what, what?
It ain’t nuthin’ but a code thang
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler());
public class ExceptionHandler implements Thread.UncaughtExceptionHandler {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
// Do things with the thread and the exception here
Troidolytics.defaultHandler.uncaughtException(thread, ex);
}
}
But what happens when internet
go boo boo?
Cache and Carry
Crash reporters cache the exception reports and send them
the first time your app is opened with internet access.
But da app sux!!!!1!!!!1!!!11!
What if your crash disappoints the user and they
never start the app again?
public class ConnectivityBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
ConnectivityManager cm = (ConnectivityManager)context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if(netInfo != null && netInfo.isConnected()){
// Send the reports here, you should probably start a service
Troidolytics.sendReports(); // #inspired
}
}
}
<receiver android:name="zg.troido.crashme.ConnectivityBroadcastReceiver"
android:enabled="true"
android:exported="true"
android:label="ConnectivityChange">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"
/>
</intent-filter>
</receiver>
It’s not only your app
that’s not responding
compile 'com.github.anrwatchdog:anrwatchdog:1.1.+'
if (!BuildConfig.DEBUG) {
new ANRWatchDog().start();
}
WHY DO WE NEED THIS?
SUPERPOWERS
grouping crashes
os version
device model
ram / cpu
What what, what, what?
Log EVERYTHING
caught exceptions,
custom messages,
variable states
} catch (Exception e) {
Crashlytics.logException(e);
ACRA.getErrorReporter().handleException(e);
}
And if you are special and want
custom logging?
Exporting crashes
WTF is... ACRA?
init
@ReportsCrashes(
formUri = "http://www.backendofyourchoice.com/reportpath",
formKey = "" // This is required for backward compatibility but not used
)
public class AcraApplication extends Application {
...
}
init
public void onCreate() {
super.onCreate();
ACRA.init(this);
}
WTF is Crashlytics?
init
get fabric plugin
include crashlytics
TAKEOUT
know your app
Plan-Do-Check-Adjust
stability matters
Adriano Orioli
Hrvoje Kozak
Troido

More Related Content

Viewers also liked

Infinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum
 
Infinum Android Talks #20 - DiffUtil
Infinum Android Talks #20 - DiffUtilInfinum Android Talks #20 - DiffUtil
Infinum Android Talks #20 - DiffUtilInfinum
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftFlorent Pillet
 
Living with-spec
Living with-specLiving with-spec
Living with-specSimon Belak
 
Living with-spec
Living with-specLiving with-spec
Living with-specSimon Belak
 
Презентация к вебинару Emarsys: "Как вернуть упущенную выручку на всех этапах...
Презентация к вебинару Emarsys: "Как вернуть упущенную выручку на всех этапах...Презентация к вебинару Emarsys: "Как вернуть упущенную выручку на всех этапах...
Презентация к вебинару Emarsys: "Как вернуть упущенную выручку на всех этапах...Emarsys
 
vortrag_countdown_lernwelten_2015_final
vortrag_countdown_lernwelten_2015_finalvortrag_countdown_lernwelten_2015_final
vortrag_countdown_lernwelten_2015_final8327651
 
Doing data science with Clojure
Doing data science with ClojureDoing data science with Clojure
Doing data science with ClojureSimon Belak
 
Java Applet Plugin für Android Browser
Java Applet Plugin für Android BrowserJava Applet Plugin für Android Browser
Java Applet Plugin für Android Browsertroido
 
Predicting the future with goopti
Predicting the future with gooptiPredicting the future with goopti
Predicting the future with gooptiSimon Belak
 
Cross platform mobile development
Cross platform mobile developmentCross platform mobile development
Cross platform mobile developmentPeter Friese
 
GoOpti - NOAH16 London
GoOpti - NOAH16 LondonGoOpti - NOAH16 London
GoOpti - NOAH16 LondonNOAH Advisors
 
Amodo - NOAH16 London
Amodo - NOAH16 LondonAmodo - NOAH16 London
Amodo - NOAH16 LondonNOAH Advisors
 
presentation of brands
presentation of brandspresentation of brands
presentation of brandsSilence Speed
 
26 Top Crowdfunding Sites (Infographic)
26 Top Crowdfunding Sites (Infographic)26 Top Crowdfunding Sites (Infographic)
26 Top Crowdfunding Sites (Infographic)Wrike
 
How To Assemble a High Converting eBook
How To Assemble a High Converting eBookHow To Assemble a High Converting eBook
How To Assemble a High Converting eBookUberflip
 
Social Proof Tips to Boost Landing Page Conversions
Social Proof Tips to Boost Landing Page ConversionsSocial Proof Tips to Boost Landing Page Conversions
Social Proof Tips to Boost Landing Page ConversionsAngie Schottmuller
 

Viewers also liked (20)

Infinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORM
 
Spec + onyx
Spec + onyxSpec + onyx
Spec + onyx
 
Infinum Android Talks #20 - DiffUtil
Infinum Android Talks #20 - DiffUtilInfinum Android Talks #20 - DiffUtil
Infinum Android Talks #20 - DiffUtil
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwift
 
Living with-spec
Living with-specLiving with-spec
Living with-spec
 
Living with-spec
Living with-specLiving with-spec
Living with-spec
 
Презентация к вебинару Emarsys: "Как вернуть упущенную выручку на всех этапах...
Презентация к вебинару Emarsys: "Как вернуть упущенную выручку на всех этапах...Презентация к вебинару Emarsys: "Как вернуть упущенную выручку на всех этапах...
Презентация к вебинару Emarsys: "Как вернуть упущенную выручку на всех этапах...
 
vortrag_countdown_lernwelten_2015_final
vortrag_countdown_lernwelten_2015_finalvortrag_countdown_lernwelten_2015_final
vortrag_countdown_lernwelten_2015_final
 
The log
The logThe log
The log
 
Doing data science with Clojure
Doing data science with ClojureDoing data science with Clojure
Doing data science with Clojure
 
Java Applet Plugin für Android Browser
Java Applet Plugin für Android BrowserJava Applet Plugin für Android Browser
Java Applet Plugin für Android Browser
 
Predicting the future with goopti
Predicting the future with gooptiPredicting the future with goopti
Predicting the future with goopti
 
Cross platform mobile development
Cross platform mobile developmentCross platform mobile development
Cross platform mobile development
 
GoOpti - NOAH16 London
GoOpti - NOAH16 LondonGoOpti - NOAH16 London
GoOpti - NOAH16 London
 
Amodo - NOAH16 London
Amodo - NOAH16 LondonAmodo - NOAH16 London
Amodo - NOAH16 London
 
presentation of brands
presentation of brandspresentation of brands
presentation of brands
 
26 Top Crowdfunding Sites (Infographic)
26 Top Crowdfunding Sites (Infographic)26 Top Crowdfunding Sites (Infographic)
26 Top Crowdfunding Sites (Infographic)
 
Brand New World
Brand New WorldBrand New World
Brand New World
 
How To Assemble a High Converting eBook
How To Assemble a High Converting eBookHow To Assemble a High Converting eBook
How To Assemble a High Converting eBook
 
Social Proof Tips to Boost Landing Page Conversions
Social Proof Tips to Boost Landing Page ConversionsSocial Proof Tips to Boost Landing Page Conversions
Social Proof Tips to Boost Landing Page Conversions
 

Similar to eXtreme eXception eXpectation; Adriano Orioli, Hrvoje Kozak

Debugging: Or How I Learned To Stop Worrying and Love EXC_BAD_ACCESS
Debugging: Or How I Learned To Stop Worrying and Love EXC_BAD_ACCESSDebugging: Or How I Learned To Stop Worrying and Love EXC_BAD_ACCESS
Debugging: Or How I Learned To Stop Worrying and Love EXC_BAD_ACCESSartgillespie
 
Eclipse Neon Webinar Automated Error Reporting
Eclipse Neon Webinar Automated Error ReportingEclipse Neon Webinar Automated Error Reporting
Eclipse Neon Webinar Automated Error ReportingMarcel Bruch
 
Java ME - 07 - Generic Connection Framework, HTTP and Sockets
Java ME - 07 - Generic Connection Framework, HTTP and SocketsJava ME - 07 - Generic Connection Framework, HTTP and Sockets
Java ME - 07 - Generic Connection Framework, HTTP and SocketsAndreas Jakl
 
Md07 exceptions&assertion
Md07 exceptions&assertionMd07 exceptions&assertion
Md07 exceptions&assertionRakesh Madugula
 
Discussing Errors in Unity3D's Open-Source Components
Discussing Errors in Unity3D's Open-Source ComponentsDiscussing Errors in Unity3D's Open-Source Components
Discussing Errors in Unity3D's Open-Source ComponentsPVS-Studio
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javagopalrajput11
 
Reactive programming with RxAndroid
Reactive programming with RxAndroidReactive programming with RxAndroid
Reactive programming with RxAndroidSavvycom Savvycom
 
Exception handling
Exception handlingException handling
Exception handlingRaja Sekhar
 
MODULE5_EXCEPTION HANDLING.docx
MODULE5_EXCEPTION HANDLING.docxMODULE5_EXCEPTION HANDLING.docx
MODULE5_EXCEPTION HANDLING.docxVeerannaKotagi1
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-ivRubaNagarajan
 
Class notes(week 8) on exception handling
Class notes(week 8) on exception handlingClass notes(week 8) on exception handling
Class notes(week 8) on exception handlingKuntal Bhowmick
 
Exceptions in java
Exceptions in javaExceptions in java
Exceptions in javaManav Prasad
 

Similar to eXtreme eXception eXpectation; Adriano Orioli, Hrvoje Kozak (20)

Android Apps the Right Way
Android Apps the Right WayAndroid Apps the Right Way
Android Apps the Right Way
 
Debugging: Or How I Learned To Stop Worrying and Love EXC_BAD_ACCESS
Debugging: Or How I Learned To Stop Worrying and Love EXC_BAD_ACCESSDebugging: Or How I Learned To Stop Worrying and Love EXC_BAD_ACCESS
Debugging: Or How I Learned To Stop Worrying and Love EXC_BAD_ACCESS
 
Eclipse Neon Webinar Automated Error Reporting
Eclipse Neon Webinar Automated Error ReportingEclipse Neon Webinar Automated Error Reporting
Eclipse Neon Webinar Automated Error Reporting
 
JUNit Presentation
JUNit PresentationJUNit Presentation
JUNit Presentation
 
Java ME - 07 - Generic Connection Framework, HTTP and Sockets
Java ME - 07 - Generic Connection Framework, HTTP and SocketsJava ME - 07 - Generic Connection Framework, HTTP and Sockets
Java ME - 07 - Generic Connection Framework, HTTP and Sockets
 
Md07 exceptions&assertion
Md07 exceptions&assertionMd07 exceptions&assertion
Md07 exceptions&assertion
 
Discussing Errors in Unity3D's Open-Source Components
Discussing Errors in Unity3D's Open-Source ComponentsDiscussing Errors in Unity3D's Open-Source Components
Discussing Errors in Unity3D's Open-Source Components
 
Exceptions
ExceptionsExceptions
Exceptions
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Z blue exception
Z blue   exceptionZ blue   exception
Z blue exception
 
Reactive programming with RxAndroid
Reactive programming with RxAndroidReactive programming with RxAndroid
Reactive programming with RxAndroid
 
Rxandroid
RxandroidRxandroid
Rxandroid
 
RxAndroid
RxAndroidRxAndroid
RxAndroid
 
Exception Handling
Exception HandlingException Handling
Exception Handling
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling
Exception handlingException handling
Exception handling
 
MODULE5_EXCEPTION HANDLING.docx
MODULE5_EXCEPTION HANDLING.docxMODULE5_EXCEPTION HANDLING.docx
MODULE5_EXCEPTION HANDLING.docx
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-iv
 
Class notes(week 8) on exception handling
Class notes(week 8) on exception handlingClass notes(week 8) on exception handling
Class notes(week 8) on exception handling
 
Exceptions in java
Exceptions in javaExceptions in java
Exceptions in java
 

eXtreme eXception eXpectation; Adriano Orioli, Hrvoje Kozak