开发者

Emailing without letting the user know

开发者 https://www.devze.com 2023-03-12 23:13 出处:网络
I have a program in C# for Windows Phone. It does some really CPU-heavy stuff with IsolatedStorage and cameras and images.

I have a program in C# for Windows Phone. It does some really CPU-heavy stuff with IsolatedStorage and cameras and images.

Occasionally, my app crashes. It happens about 1 in 50 times, and each time it does, I end up making some minor modification to the code. I mostly always prevent the app from exiting with try-catch.

But after ~3 months of working on the a开发者_如何学JAVApp, I think it's ready to be released to the public. However, I still want to be notified about crashes so I know how to fix them.

How could I send an email to myself without forcing the user to press Send?

As far as I can tell, users don't really want to report the errors, and as such are likely to press Cancel if they see such a dialog.

EDIT: This crash would only contain the words "Crash at line " and the line number(s) that caused the crash.

EDIT II: Oops, meant a crash every 500-1000 times. Thanks @Andrei.

EDIT III: Using all my data, it seems that this app has only crashed five times out of the 18000+ times I've debugged it. That gives my app a one-in-36000 chance of crashing if the user uses my app for 3 months on an average usage estimate of 20 launches per day, which, in my extremely biased opinion, quite good for an app that makes heavy use of sounds, images, and sensors.


Transmitting info without the user's knowledge is evil. Use reverse psychology:

Emailing without letting the user know


  1. Fixing crashes by using try-catch is not really fixing them. Treat the cause, not the symptom.
  2. Sending emails without the user's consent in wrong and, since it may contain personal information, might be also illegal. Since it also might cost the user to send data it also makes it commercially less viable as it increases cost for the user without bringing him real benefits.
  3. Sending the crash report to a website instead of an email address looks more professional.
  4. If you don't want the user to have to click to send each crash report you might try to ask the user when he installs the application whether he wants to submit the crash info.

A google search for "silverlight upload file" provided this link. May it help you well.


Can you just upload the crash info with a POST request to a website? It's probably easier to do that and then let the website send an email than it is to send (random) emails in the user's name...


Unless Silverlight for WP7 supports the SmtpClient, there won't be a way to send mail outside of the email app.

There are a few work arounds however:

  1. Create a web service to capture the data, that your wp7 can attempt to make a request to,
  2. Just use the Email function and hope users hit send (you'd be surprised)
  3. Use a service like Flurry that has OnError event logging, and put that in your unhandled exception handler.
  4. Use an email web service proxy to send the email to you.


Well, there is the WPAppManifest.xml in this file you can specify what the user needs to accept.
Here is the EMail thing: http://www.ginktage.com/2011/04/how-to-send-email-in-windows-phone-7-using-c/ I think this would solve your problem.
This is i think the right thing for you: http://www.preemptive.com/products/runtime-intelligence/compare-editions For WP7 Developer its free. You can track the application usage from the users. You'll see how many people how long your application are using, and i think also if it crashs...


As others have said, you luckily can't send emails as the user without him knowing - but you can just use a web service.

To improve this, I create the MD5 hash of the stacktrace and first check if the crash happened before and only if it hasn't happened before, I send the crash report.

But I stopped asking the users as well. They just won't do it then. I simply remove all personal data first.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号