₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,329,090 members, 8,438,781 topics. Date: Friday, 03 July 2026 at 10:52 PM

Toggle theme

Help On Android Internal Storage - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingHelp On Android Internal Storage (1556 Views)

1 Reply

Help On Android Internal Storage by Jinf(op): 12:00pm On May 12, 2015
How do i check if android internal storage path already exists before creating one.
Re: Help On Android Internal Storage by lordZOUGA(m): 12:50pm On May 12, 2015
Jinf:
How do i check if android internal storage path already exists before creating one.
in android, you don't really have to worry if a path exists in order to create it. The code below creates all the directories but doesn't overwrite an existing one.
File myDirectory = new File(Environment.getExternalStorageDirectory(), "/parent/child"wink;
myDirectory.mkdirs();


to check if a file exists on internal storage. (that's from stackoverflow. I haven't tested it)

File file = getBaseContext().getFileStreamPath(fname);
return file.exists();
Re: Help On Android Internal Storage by Jinf(op): 2:37pm On May 14, 2015
lordZOUGA:
in android, you don't really have to worry if a path exists in order to create it. The code below creates all the directories but doesn't overwrite an existing one.
File myDirectory = new File(Environment.getExternalStorageDirectory(), "/parent/child"wink;
myDirectory.mkdirs();


to check if a file exists on internal storage. (that's from stackoverflow. I haven't tested it)

File file = getBaseContext().getFileStreamPath(fname);
return file.exists();
Hey Bro! Thanks.
1 Reply

Programming On Android DeviceCan Programimg Be Done On Android?How To Change IP Address On Android Device234

Data Science Nigeria AI Bootcamp 2019 All You Need To KnowPlease Why Do Nigerian Men Look Down On Women Who Try To Raise Head On ProgramiUpload File To Host Using Ftp Client