---
title: "How to use Choose file in android without using browse?"  
description: "How to use Choose file in android without using browse?"  
author: "Anonymous User"  
published: 2014-11-16  
updated: 2014-11-17  
canonical: https://www.mindstick.com/forum/12600/how-to-use-choose-file-in-android-without-using-browse  
category: "android"  
tags: ["java", "file"]  
reading_time: 2 minutes  

---

# How to use Choose file in android without using browse?

I have an [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) on [android](https://www.mindstick.com/articles/13046/10-reasons-why-i-prefer-android-vs-iphone-ios) phone. People will [download pdf](https://www.mindstick.com/forum/34170/download-pdf-in-php) file before using my app, and the [pdf file](https://www.mindstick.com/forum/572/pdf-file-download-in-zip-file-in-mvc-4) will be saved in a certain folder.

I know the [absolute](https://www.mindstick.com/interview/1159/what-is-absolute-and-sliding-expiration-in-dot-net) path of the folder, but I don't know the name of the new pdf file people download, so I can't get the absolute path of the pdf apparently.

Is there any method to [choose](https://www.mindstick.com/articles/13030/how-to-choose-the-best-online-bitcoin-casino) the file by using maybe the file type? (Because I am sure that there is only one pdf file in that folder.) By the way, I don't want to choose file by browse.

Here is the stupid method I used before, but it can't match my [demand](https://www.mindstick.com/blog/11944/15-killer-digital-marketing-skills-that-are-high-in-demand-pay-out) anymore.

```
public static final String file_name = "//sdcard//Download//test.pdf";File myFile = new File(file_name);
```

Any easy way to [solve the problem](https://answers.mindstick.com/qa/94744/why-is-google-play-store-not-completing-downloads-and-how-can-i-solve-the-problem)? Thanks for your help sincerely.

## Replies

### Reply by Tom Cruser

Below method will give all the PDF files in [Download](https://www.mindstick.com/articles/188403/website-to-download-photos-from-instagram) folder.

```
String path = Environment.getExternalStorageDirectory().toString()+"/Download";File f = new File(path);        File files[] = f.listFiles();   for (File f : files)     {      String fullPath =f.getAbsolutePath();      int dot =fullPath.lastIndexOf(".");      String ext = fullPath.substring(dot+ 1);      if(ext.equals("pdf"))      {        //do something with f here      }      } 
```


---

Original Source: https://www.mindstick.com/forum/12600/how-to-use-choose-file-in-android-without-using-browse

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
