Accesssing a common database from different apps

I would like to be able to use the same database from two separate apps, with either of them able to alter the data. I’ve tried using the same name and file path for the database in each app (datatbase is in the DocumentsDirectory of each app), but the databases seem to be exclusive to the app that is running, so updates of the data from one app do not carry across to the other app. It sort of makes sense that this would be the case as otherwise all sorts of clashes could happen, but is there any way to save a data file so that I can access it and alter it from more than one app?

Any ideas gratefully received!

Thanks
Pete
[import]uid: 24031 topic_id: 18227 reply_id: 318227[/import]

You could always use a server side webservice to store/retrieve data… Just code your web service by using your preferred language (php,asp,python,java etc), then use it by network.request api functions. [import]uid: 11686 topic_id: 18227 reply_id: 69717[/import]

Thanks - I may have to do that but I am really wanting to manage it without accessing the web so that it works when there is no connection available. [import]uid: 24031 topic_id: 18227 reply_id: 69719[/import]

Every iOS application (i guess also this is true for android devices…) runs in a sandbox environment. That means; your device tries its best to prohibit you accessing resources outside your application.

So its not possible unless you have jailbroken your device and use raw api calls (from Xcode/objc) [import]uid: 11686 topic_id: 18227 reply_id: 69722[/import]

hey, after doing some research on google i come up with this post in stackoverflow

http://stackoverflow.com/questions/220630/how-to-share-custom-data-between-iphone-applications

But, the methods mentioned above can not be used unless ansca implement them in future corona builds.

cheers.
[import]uid: 11686 topic_id: 18227 reply_id: 69724[/import]

Thanks for that. I thought I might be going down a dead end trying to do it on the device itself. Will either have to go with using the web or forget about it for now!

Many thanks for such quick responses.
Pete
[import]uid: 24031 topic_id: 18227 reply_id: 69727[/import]

Pete,

I’m assuming for the sake of my suggestion that these multiple apps you want accessing a shared database are all your own apps. If so, you could combine all your apps into one “suite” of apps. That would be treated by iOS as one app for sandbox purposes. If you were not able to release all the apps together, you could simply add them as updates over time. And if you wanted to charge separately for each, you could do so as an in-app purchase.

Just one more possible workaround. -Shane [import]uid: 64596 topic_id: 18227 reply_id: 69742[/import]

Shane

Yes - they will all be mine apps so that could be a cunning solution. The only thing is that I’m developing for Android and I don’t think that in app purchasing is available yet for that. I’ll keep it in mind for when in app purchasing becomes available.

Many thanks
Pete [import]uid: 24031 topic_id: 18227 reply_id: 69749[/import]