Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1808154
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:13:34+00:00 2026-05-17T06:13:34+00:00

I am new to Android mobile application development. I would like to know, how

  • 0

I am new to Android mobile application development.
I would like to know, how can I handle exceptions like HttpConnection related exceptions or any other exceptions? Do I need to display an AlertDialog to the user?

Kindly provide a sample code or project source code on how can I handle HttpConnection or similar type of Exceptions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T06:13:34+00:00Added an answer on May 17, 2026 at 6:13 am

    How you handle exception depends on the exception. If the exception is something that you cannot recover from, and the user needs to know about then you could catch the exception and show it in an AlertDialog:

    try {
      // do something
    } catch (SomeImportantException e) {
      AlertDialog.Builder builder = new AlertDialog.Builder(this);
      builder.setMessage("User friendly text explaining what went wrong.");
      AlertDialog alert = builder.create();
      alert.show();
    }
    

    For more info on the dialog, see creating dialogs.

    Alternatively, if the exception is something that you can deal with, you can just log information about the exception and move on.

    try {
      // do something
    } catch (SomeLessImportantException e) {
      Log.d(tag, "Failed to do something: " + e.getMessage());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi there Im new to mobile application development. I had developed Android apps using
I am new to using SQLite databases and android mobile development. I am trying
I'm pretty new to Android Development, i'm following some Youtube tutorials currently. I'd like
I am new to mobile application technologies.... We are developing applications for iPhone/android/blackberry/windows mobile.
I would like to add wireless printing to my android 2.2 application which is
I've developed a web application for mobile. As I'm new to mobile web development
I'm developing a phonegap/jquery-mobile test application (I'm new in this technologies) for android and
What Android API version would you choose to begin developing a new Java application?
I'm new to mobile phones development, but I wonder whether there is any way
i am creating a new android application.i am using the table layout. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.