Android : Read Remote Location Folder Name and file Name












2















I am connected to a Server whose address is 192.168.1.254 and on typing this address in the browser it is showing the list of available folder enter image description here
i want to display the name of the folder in my android application i have tried the following code but no-luck.



try {
SmbFile test = new SmbFile("smb://192.168.1.254");
SmbFile files = test.listFiles();
if (files != null)
for (SmbFile s : files) {
Log.d("debug", s.getName());
}
} catch (SmbException e) {
Log.d("debug", "ERROR");
} catch (Exception e) {
Log.d("debug", "ERROR");
}


which i find here
and i also tried



File f = new File("//192.168.1.254");
//also tried with File f = new File("http//192.168.1.254");
File files = f.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
// Specify the extentions of files to be included.
return name.endsWith(".bmp") || name.endsWith(".gif");
}
});

// get names of the files
String fileNamesArray = null;
for (int indx = 0; indx < files.length(); indx++) {
Log.d("name",files[indx].getName());
}

return fileNamesArray;









share|improve this question



























    2















    I am connected to a Server whose address is 192.168.1.254 and on typing this address in the browser it is showing the list of available folder enter image description here
    i want to display the name of the folder in my android application i have tried the following code but no-luck.



    try {
    SmbFile test = new SmbFile("smb://192.168.1.254");
    SmbFile files = test.listFiles();
    if (files != null)
    for (SmbFile s : files) {
    Log.d("debug", s.getName());
    }
    } catch (SmbException e) {
    Log.d("debug", "ERROR");
    } catch (Exception e) {
    Log.d("debug", "ERROR");
    }


    which i find here
    and i also tried



    File f = new File("//192.168.1.254");
    //also tried with File f = new File("http//192.168.1.254");
    File files = f.listFiles(new FilenameFilter() {
    public boolean accept(File dir, String name) {
    // Specify the extentions of files to be included.
    return name.endsWith(".bmp") || name.endsWith(".gif");
    }
    });

    // get names of the files
    String fileNamesArray = null;
    for (int indx = 0; indx < files.length(); indx++) {
    Log.d("name",files[indx].getName());
    }

    return fileNamesArray;









    share|improve this question

























      2












      2








      2








      I am connected to a Server whose address is 192.168.1.254 and on typing this address in the browser it is showing the list of available folder enter image description here
      i want to display the name of the folder in my android application i have tried the following code but no-luck.



      try {
      SmbFile test = new SmbFile("smb://192.168.1.254");
      SmbFile files = test.listFiles();
      if (files != null)
      for (SmbFile s : files) {
      Log.d("debug", s.getName());
      }
      } catch (SmbException e) {
      Log.d("debug", "ERROR");
      } catch (Exception e) {
      Log.d("debug", "ERROR");
      }


      which i find here
      and i also tried



      File f = new File("//192.168.1.254");
      //also tried with File f = new File("http//192.168.1.254");
      File files = f.listFiles(new FilenameFilter() {
      public boolean accept(File dir, String name) {
      // Specify the extentions of files to be included.
      return name.endsWith(".bmp") || name.endsWith(".gif");
      }
      });

      // get names of the files
      String fileNamesArray = null;
      for (int indx = 0; indx < files.length(); indx++) {
      Log.d("name",files[indx].getName());
      }

      return fileNamesArray;









      share|improve this question














      I am connected to a Server whose address is 192.168.1.254 and on typing this address in the browser it is showing the list of available folder enter image description here
      i want to display the name of the folder in my android application i have tried the following code but no-luck.



      try {
      SmbFile test = new SmbFile("smb://192.168.1.254");
      SmbFile files = test.listFiles();
      if (files != null)
      for (SmbFile s : files) {
      Log.d("debug", s.getName());
      }
      } catch (SmbException e) {
      Log.d("debug", "ERROR");
      } catch (Exception e) {
      Log.d("debug", "ERROR");
      }


      which i find here
      and i also tried



      File f = new File("//192.168.1.254");
      //also tried with File f = new File("http//192.168.1.254");
      File files = f.listFiles(new FilenameFilter() {
      public boolean accept(File dir, String name) {
      // Specify the extentions of files to be included.
      return name.endsWith(".bmp") || name.endsWith(".gif");
      }
      });

      // get names of the files
      String fileNamesArray = null;
      for (int indx = 0; indx < files.length(); indx++) {
      Log.d("name",files[indx].getName());
      }

      return fileNamesArray;






      android folder subfolder file-access






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 '18 at 11:58









      Shubham JainShubham Jain

      4771518




      4771518
























          2 Answers
          2






          active

          oldest

          votes


















          0














          Seems you need FTP client for list files on remote location. Try to use, for example, ftp4j library as described in it's official documentation or this Android Example by devert. Exactly list files on remote FTP server with ftp4j by Arun you can find here:




              FTPClient client = null;
          try { // Get the FTP Connection from the
          Utility class client =FTPUtility.connect(ipAddress, userName,
          password);
          if (client != null) { /* List all file inside the directory */
          FTPFile fileArray = client.list();
          System.out.println("List of files...");
          for (int i = 0; i < fileArray.length; i++) {
          FTPFile file = fileArray[i];
          if (file != null) {
          if (file.TYPE_FILE == FTPFile.TYPE_FILE) // File {
          System.out.println("File Name = " + file.getName() + " ; File Size = " + file.getSize() + " ;Modified Date = " + file.getModifiedDate());
          } else if (file.TYPE_DIRECTORY == FTPFile.TYPE_DIRECTORY) // Directory
          {
          System.out.println("Directory Name = " + file.getName() + " ; Directory Size = " + file.getSize() + " ;Modified Date = " + file.getModifiedDate());
          } else if (file.TYPE_LINK == FTPFile.TYPE_LINK) // Link
          {
          System.out.println("Link Name = " + file.getName() + " ;Modified Date = "
          + file.getModifiedDate());
          }
          }
          }
          }
          } catch(
          Exception e)

          {
          System.err.println("ERROR : Error in Connecting to Remote Machine... Hence exitting..."); //
          e.printStackTrace();
          System.exit(2);
          }

          finally

          {
          try {
          client.disconnect(true);
          } catch
          (Exception e) {
          }
          }



          Update



          If "there is no active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192" seems file list send over HTTP and you can download it via HttpURLConnection and parse response. Something like this:



          HttpURLConnection connection = null;
          BufferedReader reader = null;

          try {
          URL url = new URL("http://192.168.1.254");

          connection = (HttpURLConnection) url.openConnection();
          connection.setRequestMethod("GET");
          connection.connect();

          int responseCode = connection.getResponseCode();

          InputStream stream = connection.getInputStream();

          reader = new BufferedReader(new InputStreamReader(stream));
          StringBuilder responseStringBuilder = new StringBuilder();

          String line = "";

          while ((line = reader.readLine()) != null) {
          responseStringBuilder .append(line);
          responseStringBuilder .append("n");
          }

          // Parse responseStringBuilder.toString() (probably as HTML) here:
          ...

          } catch (MalformedURLException e) {
          e.printStackTrace();
          } catch (IOException e) {
          e.printStackTrace();
          } finally {
          if (connection != null) {
          connection.disconnect();
          }
          try {
          if (reader != null) {
          reader.close();
          }
          } catch (IOException e) {
          e.printStackTrace();
          }
          }





          share|improve this answer


























          • i have tried (not programmatically but using filezilla )this earlier but found that there is no Active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192

            – Shubham Jain
            Nov 27 '18 at 9:02













          • @ShubhamJain Please see update about HttpURLConnection.

            – Andrii Omelchenko
            Nov 27 '18 at 9:21



















          0














          One way is to download html as a string from the server. Then use



           urlConnection = new URL("your_url").openConnection();
          reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));

          while ((String line = reader.readLine()) != null) {
          stringBuilder.append(line).append("n");
          }
          String your_data = Html.fromHtml(stringBuilder.toString());


          This will contain the table in text format. You can process it to get the required data.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53446304%2fandroid-read-remote-location-folder-name-and-file-name%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Seems you need FTP client for list files on remote location. Try to use, for example, ftp4j library as described in it's official documentation or this Android Example by devert. Exactly list files on remote FTP server with ftp4j by Arun you can find here:




                FTPClient client = null;
            try { // Get the FTP Connection from the
            Utility class client =FTPUtility.connect(ipAddress, userName,
            password);
            if (client != null) { /* List all file inside the directory */
            FTPFile fileArray = client.list();
            System.out.println("List of files...");
            for (int i = 0; i < fileArray.length; i++) {
            FTPFile file = fileArray[i];
            if (file != null) {
            if (file.TYPE_FILE == FTPFile.TYPE_FILE) // File {
            System.out.println("File Name = " + file.getName() + " ; File Size = " + file.getSize() + " ;Modified Date = " + file.getModifiedDate());
            } else if (file.TYPE_DIRECTORY == FTPFile.TYPE_DIRECTORY) // Directory
            {
            System.out.println("Directory Name = " + file.getName() + " ; Directory Size = " + file.getSize() + " ;Modified Date = " + file.getModifiedDate());
            } else if (file.TYPE_LINK == FTPFile.TYPE_LINK) // Link
            {
            System.out.println("Link Name = " + file.getName() + " ;Modified Date = "
            + file.getModifiedDate());
            }
            }
            }
            }
            } catch(
            Exception e)

            {
            System.err.println("ERROR : Error in Connecting to Remote Machine... Hence exitting..."); //
            e.printStackTrace();
            System.exit(2);
            }

            finally

            {
            try {
            client.disconnect(true);
            } catch
            (Exception e) {
            }
            }



            Update



            If "there is no active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192" seems file list send over HTTP and you can download it via HttpURLConnection and parse response. Something like this:



            HttpURLConnection connection = null;
            BufferedReader reader = null;

            try {
            URL url = new URL("http://192.168.1.254");

            connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.connect();

            int responseCode = connection.getResponseCode();

            InputStream stream = connection.getInputStream();

            reader = new BufferedReader(new InputStreamReader(stream));
            StringBuilder responseStringBuilder = new StringBuilder();

            String line = "";

            while ((line = reader.readLine()) != null) {
            responseStringBuilder .append(line);
            responseStringBuilder .append("n");
            }

            // Parse responseStringBuilder.toString() (probably as HTML) here:
            ...

            } catch (MalformedURLException e) {
            e.printStackTrace();
            } catch (IOException e) {
            e.printStackTrace();
            } finally {
            if (connection != null) {
            connection.disconnect();
            }
            try {
            if (reader != null) {
            reader.close();
            }
            } catch (IOException e) {
            e.printStackTrace();
            }
            }





            share|improve this answer


























            • i have tried (not programmatically but using filezilla )this earlier but found that there is no Active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192

              – Shubham Jain
              Nov 27 '18 at 9:02













            • @ShubhamJain Please see update about HttpURLConnection.

              – Andrii Omelchenko
              Nov 27 '18 at 9:21
















            0














            Seems you need FTP client for list files on remote location. Try to use, for example, ftp4j library as described in it's official documentation or this Android Example by devert. Exactly list files on remote FTP server with ftp4j by Arun you can find here:




                FTPClient client = null;
            try { // Get the FTP Connection from the
            Utility class client =FTPUtility.connect(ipAddress, userName,
            password);
            if (client != null) { /* List all file inside the directory */
            FTPFile fileArray = client.list();
            System.out.println("List of files...");
            for (int i = 0; i < fileArray.length; i++) {
            FTPFile file = fileArray[i];
            if (file != null) {
            if (file.TYPE_FILE == FTPFile.TYPE_FILE) // File {
            System.out.println("File Name = " + file.getName() + " ; File Size = " + file.getSize() + " ;Modified Date = " + file.getModifiedDate());
            } else if (file.TYPE_DIRECTORY == FTPFile.TYPE_DIRECTORY) // Directory
            {
            System.out.println("Directory Name = " + file.getName() + " ; Directory Size = " + file.getSize() + " ;Modified Date = " + file.getModifiedDate());
            } else if (file.TYPE_LINK == FTPFile.TYPE_LINK) // Link
            {
            System.out.println("Link Name = " + file.getName() + " ;Modified Date = "
            + file.getModifiedDate());
            }
            }
            }
            }
            } catch(
            Exception e)

            {
            System.err.println("ERROR : Error in Connecting to Remote Machine... Hence exitting..."); //
            e.printStackTrace();
            System.exit(2);
            }

            finally

            {
            try {
            client.disconnect(true);
            } catch
            (Exception e) {
            }
            }



            Update



            If "there is no active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192" seems file list send over HTTP and you can download it via HttpURLConnection and parse response. Something like this:



            HttpURLConnection connection = null;
            BufferedReader reader = null;

            try {
            URL url = new URL("http://192.168.1.254");

            connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.connect();

            int responseCode = connection.getResponseCode();

            InputStream stream = connection.getInputStream();

            reader = new BufferedReader(new InputStreamReader(stream));
            StringBuilder responseStringBuilder = new StringBuilder();

            String line = "";

            while ((line = reader.readLine()) != null) {
            responseStringBuilder .append(line);
            responseStringBuilder .append("n");
            }

            // Parse responseStringBuilder.toString() (probably as HTML) here:
            ...

            } catch (MalformedURLException e) {
            e.printStackTrace();
            } catch (IOException e) {
            e.printStackTrace();
            } finally {
            if (connection != null) {
            connection.disconnect();
            }
            try {
            if (reader != null) {
            reader.close();
            }
            } catch (IOException e) {
            e.printStackTrace();
            }
            }





            share|improve this answer


























            • i have tried (not programmatically but using filezilla )this earlier but found that there is no Active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192

              – Shubham Jain
              Nov 27 '18 at 9:02













            • @ShubhamJain Please see update about HttpURLConnection.

              – Andrii Omelchenko
              Nov 27 '18 at 9:21














            0












            0








            0







            Seems you need FTP client for list files on remote location. Try to use, for example, ftp4j library as described in it's official documentation or this Android Example by devert. Exactly list files on remote FTP server with ftp4j by Arun you can find here:




                FTPClient client = null;
            try { // Get the FTP Connection from the
            Utility class client =FTPUtility.connect(ipAddress, userName,
            password);
            if (client != null) { /* List all file inside the directory */
            FTPFile fileArray = client.list();
            System.out.println("List of files...");
            for (int i = 0; i < fileArray.length; i++) {
            FTPFile file = fileArray[i];
            if (file != null) {
            if (file.TYPE_FILE == FTPFile.TYPE_FILE) // File {
            System.out.println("File Name = " + file.getName() + " ; File Size = " + file.getSize() + " ;Modified Date = " + file.getModifiedDate());
            } else if (file.TYPE_DIRECTORY == FTPFile.TYPE_DIRECTORY) // Directory
            {
            System.out.println("Directory Name = " + file.getName() + " ; Directory Size = " + file.getSize() + " ;Modified Date = " + file.getModifiedDate());
            } else if (file.TYPE_LINK == FTPFile.TYPE_LINK) // Link
            {
            System.out.println("Link Name = " + file.getName() + " ;Modified Date = "
            + file.getModifiedDate());
            }
            }
            }
            }
            } catch(
            Exception e)

            {
            System.err.println("ERROR : Error in Connecting to Remote Machine... Hence exitting..."); //
            e.printStackTrace();
            System.exit(2);
            }

            finally

            {
            try {
            client.disconnect(true);
            } catch
            (Exception e) {
            }
            }



            Update



            If "there is no active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192" seems file list send over HTTP and you can download it via HttpURLConnection and parse response. Something like this:



            HttpURLConnection connection = null;
            BufferedReader reader = null;

            try {
            URL url = new URL("http://192.168.1.254");

            connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.connect();

            int responseCode = connection.getResponseCode();

            InputStream stream = connection.getInputStream();

            reader = new BufferedReader(new InputStreamReader(stream));
            StringBuilder responseStringBuilder = new StringBuilder();

            String line = "";

            while ((line = reader.readLine()) != null) {
            responseStringBuilder .append(line);
            responseStringBuilder .append("n");
            }

            // Parse responseStringBuilder.toString() (probably as HTML) here:
            ...

            } catch (MalformedURLException e) {
            e.printStackTrace();
            } catch (IOException e) {
            e.printStackTrace();
            } finally {
            if (connection != null) {
            connection.disconnect();
            }
            try {
            if (reader != null) {
            reader.close();
            }
            } catch (IOException e) {
            e.printStackTrace();
            }
            }





            share|improve this answer















            Seems you need FTP client for list files on remote location. Try to use, for example, ftp4j library as described in it's official documentation or this Android Example by devert. Exactly list files on remote FTP server with ftp4j by Arun you can find here:




                FTPClient client = null;
            try { // Get the FTP Connection from the
            Utility class client =FTPUtility.connect(ipAddress, userName,
            password);
            if (client != null) { /* List all file inside the directory */
            FTPFile fileArray = client.list();
            System.out.println("List of files...");
            for (int i = 0; i < fileArray.length; i++) {
            FTPFile file = fileArray[i];
            if (file != null) {
            if (file.TYPE_FILE == FTPFile.TYPE_FILE) // File {
            System.out.println("File Name = " + file.getName() + " ; File Size = " + file.getSize() + " ;Modified Date = " + file.getModifiedDate());
            } else if (file.TYPE_DIRECTORY == FTPFile.TYPE_DIRECTORY) // Directory
            {
            System.out.println("Directory Name = " + file.getName() + " ; Directory Size = " + file.getSize() + " ;Modified Date = " + file.getModifiedDate());
            } else if (file.TYPE_LINK == FTPFile.TYPE_LINK) // Link
            {
            System.out.println("Link Name = " + file.getName() + " ;Modified Date = "
            + file.getModifiedDate());
            }
            }
            }
            }
            } catch(
            Exception e)

            {
            System.err.println("ERROR : Error in Connecting to Remote Machine... Hence exitting..."); //
            e.printStackTrace();
            System.exit(2);
            }

            finally

            {
            try {
            client.disconnect(true);
            } catch
            (Exception e) {
            }
            }



            Update



            If "there is no active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192" seems file list send over HTTP and you can download it via HttpURLConnection and parse response. Something like this:



            HttpURLConnection connection = null;
            BufferedReader reader = null;

            try {
            URL url = new URL("http://192.168.1.254");

            connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.connect();

            int responseCode = connection.getResponseCode();

            InputStream stream = connection.getInputStream();

            reader = new BufferedReader(new InputStreamReader(stream));
            StringBuilder responseStringBuilder = new StringBuilder();

            String line = "";

            while ((line = reader.readLine()) != null) {
            responseStringBuilder .append(line);
            responseStringBuilder .append("n");
            }

            // Parse responseStringBuilder.toString() (probably as HTML) here:
            ...

            } catch (MalformedURLException e) {
            e.printStackTrace();
            } catch (IOException e) {
            e.printStackTrace();
            } finally {
            if (connection != null) {
            connection.disconnect();
            }
            try {
            if (reader != null) {
            reader.close();
            }
            } catch (IOException e) {
            e.printStackTrace();
            }
            }






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 27 '18 at 9:19

























            answered Nov 27 '18 at 8:30









            Andrii OmelchenkoAndrii Omelchenko

            7,77262452




            7,77262452













            • i have tried (not programmatically but using filezilla )this earlier but found that there is no Active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192

              – Shubham Jain
              Nov 27 '18 at 9:02













            • @ShubhamJain Please see update about HttpURLConnection.

              – Andrii Omelchenko
              Nov 27 '18 at 9:21



















            • i have tried (not programmatically but using filezilla )this earlier but found that there is no Active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192

              – Shubham Jain
              Nov 27 '18 at 9:02













            • @ShubhamJain Please see update about HttpURLConnection.

              – Andrii Omelchenko
              Nov 27 '18 at 9:21

















            i have tried (not programmatically but using filezilla )this earlier but found that there is no Active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192

            – Shubham Jain
            Nov 27 '18 at 9:02







            i have tried (not programmatically but using filezilla )this earlier but found that there is no Active port for ftp , and my current finding is device is having only 4 active port i.e 80,443,3333,8192

            – Shubham Jain
            Nov 27 '18 at 9:02















            @ShubhamJain Please see update about HttpURLConnection.

            – Andrii Omelchenko
            Nov 27 '18 at 9:21





            @ShubhamJain Please see update about HttpURLConnection.

            – Andrii Omelchenko
            Nov 27 '18 at 9:21













            0














            One way is to download html as a string from the server. Then use



             urlConnection = new URL("your_url").openConnection();
            reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));

            while ((String line = reader.readLine()) != null) {
            stringBuilder.append(line).append("n");
            }
            String your_data = Html.fromHtml(stringBuilder.toString());


            This will contain the table in text format. You can process it to get the required data.






            share|improve this answer




























              0














              One way is to download html as a string from the server. Then use



               urlConnection = new URL("your_url").openConnection();
              reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));

              while ((String line = reader.readLine()) != null) {
              stringBuilder.append(line).append("n");
              }
              String your_data = Html.fromHtml(stringBuilder.toString());


              This will contain the table in text format. You can process it to get the required data.






              share|improve this answer


























                0












                0








                0







                One way is to download html as a string from the server. Then use



                 urlConnection = new URL("your_url").openConnection();
                reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));

                while ((String line = reader.readLine()) != null) {
                stringBuilder.append(line).append("n");
                }
                String your_data = Html.fromHtml(stringBuilder.toString());


                This will contain the table in text format. You can process it to get the required data.






                share|improve this answer













                One way is to download html as a string from the server. Then use



                 urlConnection = new URL("your_url").openConnection();
                reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));

                while ((String line = reader.readLine()) != null) {
                stringBuilder.append(line).append("n");
                }
                String your_data = Html.fromHtml(stringBuilder.toString());


                This will contain the table in text format. You can process it to get the required data.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 2 '18 at 8:57









                m__m__

                1




                1






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53446304%2fandroid-read-remote-location-folder-name-and-file-name%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Berounka

                    Sphinx de Gizeh

                    Different font size/position of beamer's navigation symbols template's content depending on regular/plain...