We all know that mobile is compact platform where we have to look lots of things while building an application. It could be anything e.g. Memory
Performance
Resolutions
Architecture
Implementation
etc. We never know when and what causes app crash a big ISSUE while playing with the app, It could happen anytime
e.g. App Launch, Load Screen, API Call, Binding Data, Loading Images etc.
And trust me sometime its really hard to find where and what cause an issue in app. I saw many post on forums, tech community and groups which is related to the same issue, where peoples usually asking questions as:
- App Crashing at launching.
- App Crash at Splash Screen loading.
- App Crash while Image showing.
- App Crashing while binding data from api.
How to identify issue and where it causes?
Beside of doing it on your own you can also use Xamarin.Insights as it is free to use for Xamarin users and has got implementations for all platforms. You receive usage reports, crash reports etc. online without the need for the user to send you a log file manually.
The only thing you need to do to receive crash reports is to initialize Xamarin.Insights on startup of your app:
Purpose: Our purpose here to grab an exception's stack trace data that help us to identify what exactly causes the issue whether in
Release Mode
orDebug Mode
. We will be able to understand the issue and the reason that causes it. We will store this data in atext
file that will be store in device storage.Solution: Alternatively you can make your own insight grabber that will give you you app insight and clue if something went wrong while testing the app. Its will be your, you can tweak like you want. let's dive to
try{}
andcatch{}
globally.Create a
Helper Class
file that has a method to generate a Text file for exception data.Time to implement code: Subscribe following events inside your app's
Application
file orSplash Activity
. I'm using Application in this case.Cheers!!
Result Video
Full Article