Nitish Patel
Nitish Patel

Reputation: 1026

Create a content provider for a different database

Is it possible to create a content provider for a different database like MySQL or SQL. How can I achieve this? Any suggestions?

Upvotes: 2

Views: 902

Answers (4)

Sabaripriyan Kamaraj
Sabaripriyan Kamaraj

Reputation: 21

If you want to expose the data to your another app you can use content provider. Otherwise it is not needed.

Upvotes: 2

Patrick R
Patrick R

Reputation: 6857

This is not possible to use android content provider for different database.Please have a look at Does the content provider allow for MySql synchronization?. As Android doesn't currently include support for automated MySql server synchronization.

The Alternate Option

Content provider can be applied to any kind of data even not SQL one. If you know how to get connection to MySQL (not easy task) - you can easily implement your own content provider over MySQL data - just create your own class extending content provider - and you're there.

But As currently Android content provider or resources are not available to connect or create content provider which can be able to server synch.

Upvotes: 1

Barmaley
Barmaley

Reputation: 16363

ContentProvider can be applied to any kind of data even not SQL one. If you know how to get connection to MySQL (not easy task) - you can easily implement your own ContentProvider over MySQL data - just create your own class extending ContentProvider - and you're there.

Upvotes: 2

Razor
Razor

Reputation: 1794

Unfortunately, Android doesn't have too much support for MySQL unless you have a web server. As far as SQL Server, there may be some classes that are available for you to use but many of them are targeted at ASP.NET and Microsoft-based platforms. This page practically says it all.

Upvotes: 0

Related Questions