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 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 lot of time in internet and couldn't end up with a suitable tutorial or solution. So I kindly request from you to give some idea/solution or at least a good tutorial which satisfy my requirement. If my problem is not clear, please mention that also. Thank you all.

S.Basnagoda
  • 611
  • 1
  • 8
  • 20

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
  • 53,818
  • 35
  • 164
  • 173