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 8078553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:49:49+00:00 2026-06-05T15:49:49+00:00

I have a app which will download a file from web. The download action

  • 0

I have a app which will download a file from web. The download action is triggered by clicking a button and then it will start a new thread to download this file.

What I want to do now is to test if the download is succesfull or not.
So I wrote the following test code :

private void testGenerateFile() throws Exception {
    try {
        runTestOnUiThread(new Runnable() {
            @Override
            public void run() {
                ((EditText)mActivity.findViewById(R.id.edit_server)).setText("http://192.168.120.248/phonebook.xml");
                click(R.id.ok);
            }
        });
    } catch (Throwable e) {
    }
}

But after executing it, the file hasn’t been downloaded. But if I add Thread.sleep(2000) at the end, the file is generated. But I think this is not a proper solution. Can you help me? Thanks.

  • 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-06-05T15:49:52+00:00Added an answer on June 5, 2026 at 3:49 pm

    If you know the location where the file is downloaded to, and the size of the file, you could periodically check (till a predefined duration) for the file being created and downloaded. You could assume that the file is successfully downloaded if the file size meets the original size.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app which will generate 5 - 10 new database records in
I have a web app(jsp/servlets) which allows users to download audio files and play
In my app i have one use case Download Folder(s) from web server this
I am creating an app which will have a question in a UILabel and
I'm developing a ASP.Net MVC3 app which will have few hundred videos. I want
need help regarding USSD Gateway. I have to develop an app, which will directly
I have the method below, which in my Blackjack app will get the value
Here's my use case. I have a desktop app that can download from my
I've got a Javascript file which is automatically generated from a legacy app which
I have a Silverlight 3 app that that will let users download PDF files

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.