0

Background

I am developing an android application that will only be used on Nexus 7 tablets (my team is also providing and has access to the hardware).

Problem

The app needs to be flexible to allow content to be added (by non-tech savvy users) to the app and accessed without an internet connection.

Our Idea

Android devices have a file system. We want to design a file system layout such that the people adding content to the application can drag and drop into the correct folder.

e.g.

AppName Images Videos 

If the user adds a video to the videos folder of the device under our app, it will show up in the app.

We understand that this could easily go wrong (accidentally delete a folder, etc.) but this is out best attempt to solve this without having to update the app ourselves whenever new content comes up (and remember, no internet connection!).

The Question

Is it possible to access the android file system contents and insert them into an app as described in the "Our Idea" section? If so, how?

2
  • Yes, using the external storage and MTP (on the nexus) or USB Mass Storage (much older devices) interface. You'll need to learn about things like the media scanner, making sure the storage exists before trying to access it, etc. You may also find the FileObserver class interesting (beware it is not recursive) and various broadcasts intents related to changes in the state of the external storage or media file changes. Commented Apr 2, 2014 at 21:25
  • Why is there no internet connection? Commented Apr 2, 2014 at 22:39

1 Answer 1

1

Yes. This is possible if you don't bother about content security. You can copy the content to any of the file system path in sdcard and your app can look for the folder and read the files .

Example , you can create a folder in sdcard as

 sdcard/appname/media/ 

and create a layout to access the files in the device, and when user selects the files provide option to copy it to your sdcard/appname path.

Check this link

http://developer.android.com/training/basics/data-storage/files.html

Note : the sdcard path can be accessed if you connect to any external system ( PC).

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, but this doesn't address the question. I ended up resolving it though and your link helped. I ended up needing Environment.getExternalStorageDirectory()

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.