I am new to android. I am trying to download a file from server and save the file in a particular path. The application is working fine. However I am not able to find the path of the downloaded file. In the code I have given as
File output = new File(“/data/data/com.test.firstApp/”, fileName);
Where can i find the file on my system?
Don’t use hard coded file paths. The framework will give you the base path of the area you want to save files to.
For the SD card, use
Environment.getExternalStorageDirectory()For local files, use
Context.getFilesDir()(orContext.openFileOutput(String name, int mode), etc)For local cache, use
Context.getCacheDir()