0

I would like to create sqlite db outside of app data folder in android. I need other apps to use the same db without using features like content provider to access the same db.

Please help me how to achieve this with Android. [Newbie in Android]

Anuradha
  • 145
  • 1
  • 1
  • 6

1 Answers1

0

If you plan to make a great app. that hackers and enthusiastic may wanna hack. Making a public database is easy but also leaky. If you are really sure you have considered security i can give you the code for it.

For example:

SQLiteDatabase sql = openOrCreateDatabase("sql.db", MODE_WORLD_READABLE, null);

This Should Help https://developer.android.com/guide/topics/data/data-storage.html

An app can do a lot of unrelated tasks in activities. and also read this Share SQLite database between 2 android apps?

M.Mavini
  • 589
  • 8
  • 20
  • Yes, I have to consider the security I dont' want hackers to get it. please help me on this – Anuradha Aug 14 '17 at 04:44
  • The link gives you the information on how secure each option is and what are the options. Look android is not windows or linux, there is sometimes some firm principles. Or maybe i should say i don't know. – M.Mavini Aug 14 '17 at 04:53
  • Correct me , if I am wrong as I just started with Android only. I saw the option Content Provider to share the data. But in that case, one service should be there to communicate with db and that module will share the data all other required apps. With Android programming, with security maintained, is there any option for all apps to communicate with db directly without any dedicated service for communication and sharing. – Anuradha Aug 14 '17 at 05:01
  • You can use Encryption where only desired app have the key. can i ask about what your app wanna achieve with this? – M.Mavini Aug 14 '17 at 05:14
  • I need to give all other apps an interface to do data storage to sqlite db. All apps needs to get data inserted by others apps from the sqlite. Every application needs to manage their own data storage and I am looking for an option to do this without having a central application doing the db operations. – Anuradha Aug 14 '17 at 05:25