From an idea to Google Play
// Bad practice
try{
// do something risky
} catch (NarrowException1 e){
} catch (NarrowException2 e){
}
// Good practice
try{
// do something risky
} catch (NarrowException1 e){
} catch (NarrowException2 e){
} catch (Exception e){
}
try{
// do something risky
} catch (NarrowException1 e){
} catch (NarrowException2 e){
} catch (Exception e){
// call error API
// for remote logging
// on server
error( e.getMessage() );
}
// Start tracking
tracker.start("UA-MY_CODE-XX", this);
// Register an activity view.
tracker.trackPageView("/map_activity");
// send views to server
tracker.dispatch();
// Create adview
AdView adView = new AdView(this, AD_TYPE,
MY_BANNER_UNIT_ID);
// Create an ad request
AdRequest request = new AdRequest();
// Load ad in the UI.
adView.loadAd(request);
// Associate the form
@ReportsCrashes(formKey =
"tWTBQaGdDI4V1YDgzWHVqQWc6MQc2ZVZRb")
// Initialize ACRA
ACRA.init( this );