0

I want to keep database creation queries and data accessing queries in text file format (those text files will be in a folder like "res" folder) and access them from android.

Let's say I want to execute the createDB() query, then I should be able to call by the relevant text file name and query should be executed.

I searched the internet and couldn't end up with a suitable tutorial or solution. So I am seeking some idea/solution or at least a good tutorial which satisfy my requirement.

halfer
  • 19,824
  • 17
  • 99
  • 186
S.Basnagoda
  • 671
  • 2
  • 8
  • 21

1 Answers1

1

I don't know why you want to do that but this is how you can do it:

1) Put those files in assets folder
2) You can open them like this:

InputStream input = context.getAssets().open("example.xml"); 
Caner
  • 57,267
  • 35
  • 174
  • 180