Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid connection exception/lost manager
    primarykey
    data
    text
    <p><strong>Background</strong></p> <p>So I've inherited an android application that in various places connects to web services to send or receive information. </p> <p>As it is right now, when a connection fails the user of the android device is prompted with an error message that for most users are viewed as obscure. </p> <p><strong>The problem</strong></p> <p>So what I'm looking for is a pattern or suggestion on how to implement a solution in this android application that catches all java connection exceptions and presents a dialog telling the user he lost the internet connection and needs to try again.</p> <p>Any ideas? :-) </p> <p><strong>Edit, current idea</strong></p> <p>My current idea to solve this issue, or making it a bit more managed instead of having a fractured exception handling that takes care of the problem at every possible connection is this. Each communication instance/class will inherit from a super class, or implement an interface that forces this class to be used. This class contains the logic for connection exceptions. Lets just for now call it ConnectionExceptionManager. The problem then only becomes implementation of this in each communication class in each web service call. In each web service calls exception I need to check for communication exceptions and if it hits, use the ConnectionExceptionManager in this catch.</p> <p>This would however still make it a hassle, to copy into request method in each communication class. </p> <p>Any ideas about improving this current idea of mine?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload