[android-developers] Re: Capturing exceptions on user's phones?

2009-04-27 Thread Glen Humphrey

Oops not finished.

I made these changes in the Thread run method.

  // Get android default exceptions handler
  Thread.UncaughtExceptionHandler orgHandler =
Thread.getDefaultUncaughtExceptionHandler();
  // Register default exceptions handler
 Thread.setDefaultUncaughtExceptionHandler(
 new DefaultExceptionHandler(orgHandler));

On Apr 27, 2:45 pm, Glen Humphrey  wrote:
> I made some changes to your exception handler so that the user will
> see the standard force close dialog on unhandled exceptions.  What I
> am doing is getting the default android handler and passing it to the
> your default handler so that it can call the android handler after it
> is done.  This is not the solution I would
> like to have, but I think it is better than having no error dialog.
>
> In DefaultExceptionHandler.java I made these changes:
>
>         private Thread.UncaughtExceptionHandler mOrgHandler;
>
>         DefaultExceptionHandler(Thread.UncaughtExceptionHandler orgHandler) {
>                 mOrgHandler = orgHandler;
>         }
>
> // commented this out as the android handler seems to do this.
>                 //t.getThreadGroup().destroy();
>
> //added this at the end of the uncaughtException method
>                 // call the original uncaught exception handler
>                 mOrgHandler.uncaughtException(t, e);
>
> On Mar 17, 2:44 pm, Mads Kristiansen 
> wrote:
>
> > Well, I am using a workaround currently, which means that the application
> > will restart. On application restart a dialog will then notify the user that
> > a problem has occurred.
> > The problem here is that I cannot get a context in the default exception
> > handler (where I dump the stack trace) and thus I am not able to display a
> > dialog. Does anybody know if I can "steal" a system context from somewhere?
> > I couldn't find anything helpful in the documentation about this.
>
> > I'll see if I can come up with something better.
>
> > Best regards, Mads Kristiansen
>
> > On Tue, Mar 17, 2009 at 9:55 PM, cnordvik  wrote:
>
> > > > 1) When an exception occurs, the application will just drop back to the
> > > home
> > > > screen and the user won't actually know that an exception has occured.
>
> > > Any luck on sorting this out? A dialog that informs the user of the
> > > error and a "report this problem" button that opens the email app
> > > would be really nice :-)
>
> > > -Christer
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Capturing exceptions on user's phones?

2009-04-27 Thread Glen Humphrey

I made some changes to your exception handler so that the user will
see the standard force close dialog on unhandled exceptions.  What I
am doing is getting the default android handler and passing it to the
your default handler so that it can call the android handler after it
is done.  This is not the solution I would
like to have, but I think it is better than having no error dialog.

In DefaultExceptionHandler.java I made these changes:

private Thread.UncaughtExceptionHandler mOrgHandler;

DefaultExceptionHandler(Thread.UncaughtExceptionHandler orgHandler) {
mOrgHandler = orgHandler;
}

// commented this out as the android handler seems to do this.
//t.getThreadGroup().destroy();

//added this at the end of the uncaughtException method
// call the original uncaught exception handler
mOrgHandler.uncaughtException(t, e);


On Mar 17, 2:44 pm, Mads Kristiansen 
wrote:
> Well, I am using a workaround currently, which means that the application
> will restart. On application restart a dialog will then notify the user that
> a problem has occurred.
> The problem here is that I cannot get a context in the default exception
> handler (where I dump the stack trace) and thus I am not able to display a
> dialog. Does anybody know if I can "steal" a system context from somewhere?
> I couldn't find anything helpful in the documentation about this.
>
> I'll see if I can come up with something better.
>
> Best regards, Mads Kristiansen
>
> On Tue, Mar 17, 2009 at 9:55 PM, cnordvik  wrote:
>
> > > 1) When an exception occurs, the application will just drop back to the
> > home
> > > screen and the user won't actually know that an exception has occured.
>
> > Any luck on sorting this out? A dialog that informs the user of the
> > error and a "report this problem" button that opens the email app
> > would be really nice :-)
>
> > -Christer
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Capturing exceptions on user's phones?

2009-03-17 Thread Mads Kristiansen
Well, I am using a workaround currently, which means that the application
will restart. On application restart a dialog will then notify the user that
a problem has occurred.
The problem here is that I cannot get a context in the default exception
handler (where I dump the stack trace) and thus I am not able to display a
dialog. Does anybody know if I can "steal" a system context from somewhere?
I couldn't find anything helpful in the documentation about this.

I'll see if I can come up with something better.

Best regards, Mads Kristiansen

On Tue, Mar 17, 2009 at 9:55 PM, cnordvik  wrote:

>
> > 1) When an exception occurs, the application will just drop back to the
> home
> > screen and the user won't actually know that an exception has occured.
>
> Any luck on sorting this out? A dialog that informs the user of the
> error and a "report this problem" button that opens the email app
> would be really nice :-)
>
> -Christer
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Capturing exceptions on user's phones?

2009-03-17 Thread cnordvik

> 1) When an exception occurs, the application will just drop back to the home
> screen and the user won't actually know that an exception has occured.

Any luck on sorting this out? A dialog that informs the user of the
error and a "report this problem" button that opens the email app
would be really nice :-)

-Christer
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Capturing exceptions on user's phones?

2009-03-09 Thread Mads Kristiansen
Okay, I have started out with a very simple and not at all streamlined
implementation. Some documentation and a binary can be found here:
http://code.google.com/p/android-remote-stacktrace/

I'll be updating it, as I go along, but if you have anything you want to
add, please let me know.

The idea is that you should just be able to drop in the "trace.jar"
available at the link above file into your Android project, call
"ExceptionHandler.register(this)" in your activity and stack traces will
then be posted to either the default server at http://trace.nullwire.com or
to a server of your choice (see the page above). The latter requires the
installation of a simple PHP script on your server. You can also just have a
look at the source and copy paste the parts you need - if you have any
suggestions or feedback, please let me know..

I'll maintain http://trace.nullwire.com and maybe implement a simple admin
interface if anyone is interested - how about a RSS feed with the exceptions
or maybe even a direct twitter message on exceptions ;) .. But let's see -
if there is a demand, I'll create something simple to view ones own
exceptions..

There are a couple of issues that I would like to solve with this first
version:
1) When an exception occurs, the application will just drop back to the home
screen and the user won't actually know that an exception has occured.
2) The application will have to be restarted again before the stack traces
are posted. I've been using a service for the applications I have done so
far, so traces were posted, when the service restarted (i.e. almost
immediately).

Maybe someone has a solution to the two issues above, but in any case, I'll
be using this implementation myself and I'll have to figure out something
eventually.

Please let me know about your experiences and any problems you might have.

Best regards, Mads Kristiansen


On Thu, Mar 5, 2009 at 1:19 PM, admin.androidsl...@googlemail.com <
admin.androidsl...@googlemail.com> wrote:

>
> That would be really great if you could post something Mads.
>
> Alex
>
>
>
> On Mar 5, 11:50 am, Mads Kristiansen 
> wrote:
> > Yes, you are right. It could probably be helpful to others and I'd be
> happy
> > to share - I'll see if I can create a component somehow over the weekend.
> I
> > don't have the code with me right now, but I'll be back ;)
> >
> > Basically I just have a default exception handler, which will catch all
> > unhandled exceptions. I'll then batch them up and at a later time, I'll
> then
> > submit the available traces to my server (and then of course also delete
> > them on the phone, when they have been submitted).
> >
> > / Mads
> >
> > On Thu, Mar 5, 2009 at 12:40 PM, admin.androidsl...@googlemail.com <
> >
> > admin.androidsl...@googlemail.com> wrote:
> >
> > > Mads,
> >
> > > Thats exactly what we all need.
> >
> > > How do you get unhandled exceptions or do you put try...catch in all
> > > your code blocks?
> >
> > > Do you submit stack traces individually or batch them up?
> >
> > > Any chance of sharing some of the code?
> >
> > > We really need a generic component for this - it will be a huge boost
> > > for quality of the apps!
> >
> > > Alex
> >
> > > On Mar 5, 11:30 am, Mads Kristiansen 
> > > wrote:
> > > > I do this in my beta applications and it is incredibly valuable.
> >
> > > > I am not aware of any existing implementations, so I built it myself.
> > > I'll
> > > > store the stacktraces on the phone and upload them to a webserver,
> where
> > > I
> > > > have a PHP script which will store the stack trace to a plain text
> file
> > > and
> > > > also send me an email with the details.
> >
> > > > Some of the stack traces I collected would probably have taken me
> days to
> > > > reproduce myself.
> >
> > > > / Mads
> >
> > > > On Thu, Mar 5, 2009 at 11:44 AM, admin.androidsl...@googlemail.com <
> >
> > > > admin.androidsl...@googlemail.com> wrote:
> >
> > > > > We all know what its like - everything works perfect on the dev's
> > > > > phone, but once you roll something out, user's complain about the
> > > > > dreaded force close!!
> >
> > > > > Sometimes its just on one or two phones, but wouldn't it be good if
> we
> > > > > could get some kind of stack trace to see whats really going on?
> >
> > > > > Obviously we can't speak to our users in person or play with their
> > > > > phones, so we need some way of getting error diagnostics off their
> > > > > phone and onto the dev's computer.
> >
> > > > > I was thinking along the lines of apps having a generic exception
> > > > > handler which could store the stack trace and then maybe upload to
> a
> > > > > web server so that the dev can take a look - anyone achieved
> something
> > > > > like this?
> >
> > > > > Maybe the SDK should (or already does?) support something like this
> -
> > > > > I think it will benefit developers and users enormously!!
> >
> > > > > Alex
> >
> >
> >
>

--~--~-~--~~~---~--~~
You received this mess

[android-developers] Re: Capturing exceptions on user's phones?

2009-03-05 Thread admin.androidsl...@googlemail.com

That would be really great if you could post something Mads.

Alex



On Mar 5, 11:50 am, Mads Kristiansen 
wrote:
> Yes, you are right. It could probably be helpful to others and I'd be happy
> to share - I'll see if I can create a component somehow over the weekend. I
> don't have the code with me right now, but I'll be back ;)
>
> Basically I just have a default exception handler, which will catch all
> unhandled exceptions. I'll then batch them up and at a later time, I'll then
> submit the available traces to my server (and then of course also delete
> them on the phone, when they have been submitted).
>
> / Mads
>
> On Thu, Mar 5, 2009 at 12:40 PM, admin.androidsl...@googlemail.com <
>
> admin.androidsl...@googlemail.com> wrote:
>
> > Mads,
>
> > Thats exactly what we all need.
>
> > How do you get unhandled exceptions or do you put try...catch in all
> > your code blocks?
>
> > Do you submit stack traces individually or batch them up?
>
> > Any chance of sharing some of the code?
>
> > We really need a generic component for this - it will be a huge boost
> > for quality of the apps!
>
> > Alex
>
> > On Mar 5, 11:30 am, Mads Kristiansen 
> > wrote:
> > > I do this in my beta applications and it is incredibly valuable.
>
> > > I am not aware of any existing implementations, so I built it myself.
> > I'll
> > > store the stacktraces on the phone and upload them to a webserver, where
> > I
> > > have a PHP script which will store the stack trace to a plain text file
> > and
> > > also send me an email with the details.
>
> > > Some of the stack traces I collected would probably have taken me days to
> > > reproduce myself.
>
> > > / Mads
>
> > > On Thu, Mar 5, 2009 at 11:44 AM, admin.androidsl...@googlemail.com <
>
> > > admin.androidsl...@googlemail.com> wrote:
>
> > > > We all know what its like - everything works perfect on the dev's
> > > > phone, but once you roll something out, user's complain about the
> > > > dreaded force close!!
>
> > > > Sometimes its just on one or two phones, but wouldn't it be good if we
> > > > could get some kind of stack trace to see whats really going on?
>
> > > > Obviously we can't speak to our users in person or play with their
> > > > phones, so we need some way of getting error diagnostics off their
> > > > phone and onto the dev's computer.
>
> > > > I was thinking along the lines of apps having a generic exception
> > > > handler which could store the stack trace and then maybe upload to a
> > > > web server so that the dev can take a look - anyone achieved something
> > > > like this?
>
> > > > Maybe the SDK should (or already does?) support something like this -
> > > > I think it will benefit developers and users enormously!!
>
> > > > Alex
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Capturing exceptions on user's phones?

2009-03-05 Thread Mads Kristiansen
Yes, you are right. It could probably be helpful to others and I'd be happy
to share - I'll see if I can create a component somehow over the weekend. I
don't have the code with me right now, but I'll be back ;)

Basically I just have a default exception handler, which will catch all
unhandled exceptions. I'll then batch them up and at a later time, I'll then
submit the available traces to my server (and then of course also delete
them on the phone, when they have been submitted).

/ Mads

On Thu, Mar 5, 2009 at 12:40 PM, admin.androidsl...@googlemail.com <
admin.androidsl...@googlemail.com> wrote:

>
> Mads,
>
> Thats exactly what we all need.
>
> How do you get unhandled exceptions or do you put try...catch in all
> your code blocks?
>
> Do you submit stack traces individually or batch them up?
>
> Any chance of sharing some of the code?
>
> We really need a generic component for this - it will be a huge boost
> for quality of the apps!
>
> Alex
>
>
>
> On Mar 5, 11:30 am, Mads Kristiansen 
> wrote:
> > I do this in my beta applications and it is incredibly valuable.
> >
> > I am not aware of any existing implementations, so I built it myself.
> I'll
> > store the stacktraces on the phone and upload them to a webserver, where
> I
> > have a PHP script which will store the stack trace to a plain text file
> and
> > also send me an email with the details.
> >
> > Some of the stack traces I collected would probably have taken me days to
> > reproduce myself.
> >
> > / Mads
> >
> > On Thu, Mar 5, 2009 at 11:44 AM, admin.androidsl...@googlemail.com <
> >
> > admin.androidsl...@googlemail.com> wrote:
> >
> > > We all know what its like - everything works perfect on the dev's
> > > phone, but once you roll something out, user's complain about the
> > > dreaded force close!!
> >
> > > Sometimes its just on one or two phones, but wouldn't it be good if we
> > > could get some kind of stack trace to see whats really going on?
> >
> > > Obviously we can't speak to our users in person or play with their
> > > phones, so we need some way of getting error diagnostics off their
> > > phone and onto the dev's computer.
> >
> > > I was thinking along the lines of apps having a generic exception
> > > handler which could store the stack trace and then maybe upload to a
> > > web server so that the dev can take a look - anyone achieved something
> > > like this?
> >
> > > Maybe the SDK should (or already does?) support something like this -
> > > I think it will benefit developers and users enormously!!
> >
> > > Alex
> >
> >
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Capturing exceptions on user's phones?

2009-03-05 Thread admin.androidsl...@googlemail.com

Mads,

Thats exactly what we all need.

How do you get unhandled exceptions or do you put try...catch in all
your code blocks?

Do you submit stack traces individually or batch them up?

Any chance of sharing some of the code?

We really need a generic component for this - it will be a huge boost
for quality of the apps!

Alex



On Mar 5, 11:30 am, Mads Kristiansen 
wrote:
> I do this in my beta applications and it is incredibly valuable.
>
> I am not aware of any existing implementations, so I built it myself. I'll
> store the stacktraces on the phone and upload them to a webserver, where I
> have a PHP script which will store the stack trace to a plain text file and
> also send me an email with the details.
>
> Some of the stack traces I collected would probably have taken me days to
> reproduce myself.
>
> / Mads
>
> On Thu, Mar 5, 2009 at 11:44 AM, admin.androidsl...@googlemail.com <
>
> admin.androidsl...@googlemail.com> wrote:
>
> > We all know what its like - everything works perfect on the dev's
> > phone, but once you roll something out, user's complain about the
> > dreaded force close!!
>
> > Sometimes its just on one or two phones, but wouldn't it be good if we
> > could get some kind of stack trace to see whats really going on?
>
> > Obviously we can't speak to our users in person or play with their
> > phones, so we need some way of getting error diagnostics off their
> > phone and onto the dev's computer.
>
> > I was thinking along the lines of apps having a generic exception
> > handler which could store the stack trace and then maybe upload to a
> > web server so that the dev can take a look - anyone achieved something
> > like this?
>
> > Maybe the SDK should (or already does?) support something like this -
> > I think it will benefit developers and users enormously!!
>
> > Alex
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Capturing exceptions on user's phones?

2009-03-05 Thread Mads Kristiansen
I do this in my beta applications and it is incredibly valuable.

I am not aware of any existing implementations, so I built it myself. I'll
store the stacktraces on the phone and upload them to a webserver, where I
have a PHP script which will store the stack trace to a plain text file and
also send me an email with the details.

Some of the stack traces I collected would probably have taken me days to
reproduce myself.

/ Mads

On Thu, Mar 5, 2009 at 11:44 AM, admin.androidsl...@googlemail.com <
admin.androidsl...@googlemail.com> wrote:

>
> We all know what its like - everything works perfect on the dev's
> phone, but once you roll something out, user's complain about the
> dreaded force close!!
>
> Sometimes its just on one or two phones, but wouldn't it be good if we
> could get some kind of stack trace to see whats really going on?
>
> Obviously we can't speak to our users in person or play with their
> phones, so we need some way of getting error diagnostics off their
> phone and onto the dev's computer.
>
> I was thinking along the lines of apps having a generic exception
> handler which could store the stack trace and then maybe upload to a
> web server so that the dev can take a look - anyone achieved something
> like this?
>
> Maybe the SDK should (or already does?) support something like this -
> I think it will benefit developers and users enormously!!
>
> Alex
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---