Good day! I am writing an application for Android using Xamarin.Android. Since errors can occur in the application, I would like to be aware of what kind of errors, when and how they happened, and so on. I would like at their occurrence to send information about them by email. Say, if you use the log4net library, then this task looks very simple. But unfortunately Xamarin applications do not support the use of this library. Can someone know how to solve this problem at all without writing their bikes for logging? How is this generally implemented in Android applications? Thank you in advance!
- onefor native Android there is a sea of libraries, for example ACRA. Xamarin itself is baptized and unfinished, I speak firsthand, now I support the project on it - Vladyslav Matviienko
- Unfortunately, I cannot switch to native only because of logging. It's easier to write yourself then - Pupkin
|
1 answer
As an option to write yourself using System.Net.Mail.SmtpClient (in the assembly with System.dll). If there is a network immediately send, and if there is no save and send when it appears. Of course, this is not an option, because you have to manually catch errors.
try { //Ваш код } catch (Exception e) { //Метод отправки или сохранения логов } |