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

  • SEARCH
  • Home
  • 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 6353903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:29:27+00:00 2026-05-24T22:29:27+00:00

I am trying to fetchg data from server like MP3 files, video files, etc.

  • 0

I am trying to fetchg data from server like MP3 files, video files, etc. in my application. The application should show the list of video files received from the server.

How can I do this?

  • 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-24T22:29:28+00:00Added an answer on May 24, 2026 at 10:29 pm
    /** this function will download content from the internet */
        static int writeData(String fileurl, boolean append, String path,
                String filename, Activity mContext) throws CustomException {
    
            URL myfileurl = null;
            ByteArrayBuffer baf = null;
            HttpURLConnection conn = null;
            String mimeType="";
            final int length;
            try {
                myfileurl = new URL(fileurl);
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
            try {
                conn = (HttpURLConnection) myfileurl
                        .openConnection();
                conn.setDoInput(true);
                conn.connect();
                conn.setConnectTimeout(100000);
    
                length = conn.getContentLength();
                mimeType=conn.getContentType().toString();
                System.out.println("Extension..."+mimeType);
                if(mimeType.equalsIgnoreCase("application/vnd.adobe.adept+xml") || mimeType.equalsIgnoreCase("text/html; charset=utf-8"))
                    return 0;
    
                if (length > 0) {
                    InputStream is = conn.getInputStream();
                    BufferedInputStream bis = new BufferedInputStream(is);
                    baf = new ByteArrayBuffer(1000);
                    int current = 0;
                    while ((current = bis.read()) != -1) {
                        try {
                            baf.append((byte) current);
    
                            mBufferError=false;
                        } catch (Exception e){
                            // TODO: handle exception
                            mBufferError=true;
                            e.printStackTrace();
                            throw new CustomException("@@@ memory problem ", "Buffer Error");
                        }
                    }
                }
    
            } catch (IOException e) {
                mBufferError=true;
                e.printStackTrace();
            }
            try{
            if(conn.getResponseCode()==200 && mBufferError==false)
            {
                path = path + "/" + filename;
                boolean appendData = append;
                FileOutputStream foutstream;
    
                    File file = new File(path);
                boolean exist = false;
    
                try {
                    if (appendData)
                        exist = file.exists();
                    else
                        exist = file.createNewFile();
                } catch (IOException e) {
                    try {
                        return 1;
                    } catch (Exception err) {
                        Log.e("SAX", err.toString());
                    }
                }
                if (!appendData && !exist) {
                } else if (appendData && !exist) {
    
                } else {
                    try {
                        foutstream = new FileOutputStream(file, appendData);
                        foutstream.write(baf.toByteArray());
                        foutstream.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
            }catch (Exception e) {
                // TODO: handle exception
                throw new CustomException("@@@ I/O problem ", "I/O Error");
            }
            return 1;
        }
    

    once download complete search the file with extension(.3gp) for video
    hope it helps

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

Sidebar

Related Questions

I've been analyzing a WPF application which basically fetch data from a server and
Here I am trying to fetch data from MS-SQL Server 2008 to my Rails
I'm trying to write a program that will fetch data from a SQL Server
I'm trying to fetch data from a div (based on his id), using PHP's
I'm trying to fetch some settings from my membership provider in my asp.net application
i am trying to fetch anything that looks like a URL from a string
i am trying to return a list of users whose accounts have expired from
I am using NSURLConnection to fetch XML data from the server. I am parsing
I'm trying to get data from a database if a link is clicked. Basically
I am trying to create a script to obtain data from a multiple databases

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.