Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to put text files in directory in Android

Tags:

java

file

android

I have a text file i want to include in my Android application, it is not a string file it is a standard text file. It contains data that defines the characteristics of a "map" that is drawn on a board. The file is not an XML file so i am unsure where i should put it or if this isn't good file structure for android? Are you suppose to do this? If you are then under what directory are you suppose to put them? How then are you suppose to access the file? I know how to use FileInputStreams and FileOutputStreams i just need to know how to access the file. All relevant answers are welcome and appreciated!

like image 892
John Avatar asked Feb 02 '12 21:02

John


People also ask

Where do I put text files in Android project?

Project window , press Alt-Insert , and select Folder->Assets folder . Android Studio will add it automatically to the correct location. And then you can add your assets or/txt files(whatever you want) on it.

Where are TXT files stored?

This file is located in data/data/your.package.name/files/ folder. You can see this file with DDMS File Explorer on emulator or rooted device.

What is a directory in Android?

A Directory represents a contacts corpus, e.g. Local contacts, Google Apps Global Address List or Corporate Global Address List. A Directory is implemented as a content provider with its unique authority and the same API as the main Contacts Provider.


1 Answers

Use assets or raw folder in your android folders structure to keep that file. For more info read this

like image 103
waqaslam Avatar answered Sep 21 '22 06:09

waqaslam