Question

On Android, do people create separate apps accessing the same database? For example an app that has users, producers and a customer support.

How can one decide if it makes more sense to have a single app for this case, or multiple apps accessing a shared database?.

For example having a single app and classifying each via their input when they log in and redirecting to their activities. Or: make separate apps which I guess could be easier for development and maintaining purposes?

A good example of what I am speaking would be of app like "Uber".

Était-ce utile?

La solution

If I understand you correctly, your question is more about the different user roles and whether you should offer separate apps for these users. The fact that all of these user roles need access to the same database is secondary.

It depends on your specific case, especially on whether users can be expected to switch roles (for example, an uber driver could be a passenger in another city) or whether you want to make sure that certain functionality such as database administration is really only available to a limited group of users. You also need to consider how often you expect schema/API changes and whether your release schedule for the separate user role functionalities is very similar or varies widely.

Considering the maintenance overhead for multiple apps, I'd normally lean towards a single app that can be used by several user roles, and separate software only for very limited admin/manager roles (maybe desktop/web applications to utilize more screen space).

Autres conseils

RDBMS like PostGreSQL are designed to be capable of handling several clients applications communicating with the PostGreSQL server thru TCP/IP sockets.

So setup some PostGreSQL on a Linux remote server, and have your Android application communicate with it, probably indirectly thru some HTTPS server application (maybe coded with libonion) running on another Linux server connected to the Internet.

Read more about DMZ. And about Continuations and web.

Your Android application would make HTTPS requests to some web service (AJAX, SOAP, REST). That Web service could query an RDBMS.

Actually, your Android app could just be some web page, a single page application.

See also ocsigen and haxe.

Look also into the helpcovid project as an example (work in progress in April 2020).

I donot know if this is "best practice" but this is how google has decided that android should work as (b):

In android local databases are private to the app that owns the database.

Instead of public local databases android has public content-providers that other apps can use. (i.e. there is a telephone-book contentprovider where other apps can interact with.)

Technically it is easy to have a private local database. If you want to use a public local database you need this android workaround

Licencié sous: CC-BY-SA avec attribution
scroll top