Best practice selecting database for mobile app [closed] - android

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
So, I am fairly new to mobile app developing. Are currently making project documents for a mobile app, and I want some input on what database solution I should use.
1) mobile app -> online only -> talking to a database
2) I Have several webservers up and running (mysql mostly), possible to use?
So my question is simple :) What solution should I use for my mobile app database.
- Setup a mysql database on a server?
- Use some kind of cloud based solution?
- Any API considurations?
need to be "best practice" for both android and ios.
Any and all suggestions is much appreciated! Thanks all! You are AWESOME!

Tom,
The most common solution for this problem is:
1) Your application get data via a webservice in your server. You can use Soap solution based on XML communication, or simple REST access (simple http request in GET or POST method) and use your own choice: XML or JSON.
Today, there is a lot of solution based on REST GET/POST with JSON file communication.
2) After, if you want that your application can turn in offline mode or just be more reactive, you can store old loaded data by webservice in local database.
For this, in Android you can use direct access to sqlite database, and in iOs, you can use the CoreData api.
Hope it help you.
Fabecc.

Tom - If you need data to be available offline without internet connectivity then you should you SQLITE database which comes as part of android/ios.
If your app saves the data on server which in turn is used by other portal or other devices (sharing) then consider storing data via web/server and mysql database.
So really it depends on the usage and sharing requirements. Storing data locally has much benefit because it is faster, no network required, data always available, and not using network also increases battery life..

Related

How to Cloud Database Cross-platform apps? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I need some tips, something to give me a way or to brighten my mind. My app idea is a Recipe's Book app. But I imagine the following scenario: user writes recipes in PC (desktop app), and then, when going to cook, at the kitchen, read/ edit the recipes on the Mobile version. Aka the app do the same things in both platforms. The app is simple, basically the data will be text. But my problem is: I only knew how to develop native apps, both mobile or desktop, with local database. Recently I've been developing on xamarin. I'm doing well at it, but My question is: how am I going to share this database? I would need it to be on cloud, right? So how could I be doing that? I just want to understand, not how exactly to do it, but now I dont have a clue on how to do that. And if you have a better platform to develop this idea, I accept tips
You need two things
Database
API
The database is to store the data, and the API is the way your different apps will exchange the data with the API.
API in a nutshell
For example : the desktop will talk to the API to add a recipe to the database, and form the other side the Mobile App will ask the API to get that recipe.
I advice you to start with MongoDB (free tier) and Express it's the fastest way to get started
According to your situation I can advice you to use Firebase Real Time Database, it has all the functionality you want of updating data in real time and fetch it also faster and implementing it is not hard as you need to configure it in your project environment I can refer you to this Page to learn more about firebase , in case you want to refer to their documentation check here.

Can I use Google Drive instead of a Server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am creating my first Android application. This will be something like a Diary or Notebook.
Andorid part is almost done and I don't know what should I do next.
Should I use data base, server....
Or can I use Drive API instead of both?
Thank you
If you're creating a note or a diary app, your better off using some sort of database, whether that's a local SQLite database on the device or a remote database.
If remote it will need some sort of web service to communicate with the database as Android doesn't support connecting to remote mysql databases such as MySQL.
Whether the database is local or remote, it doesn't matter but this would be the better option. If it is stored in the database you can store and retrieve the meta data more easily, such as creation time, title, etc whereas in Google Drive you would either need lots of files or store the data in 1 file in a particular way that you can then parse to get the meta data out.
You could however, export the data from a database and store that on Google drive that can be used as a backup/restore option.
This is a variation on the perennial rdbms vs networked filesystem approach. Many large projects I have worked with have used both, even together. Usually an RDBMS gives you more flexibility and easier development, while a networked filesystem approach works better when you are working with other tooks which expect file-level access.
The simple answer is yes you can but it probably is not worth it. You end up having to do a lot of work yourself to implement what SQLite can offer you. And in the case of Google Drive, latency will likely be a killer.
So keep your data local and fast. And work with something that gives you the flexibility you need.

Web app, android and ios. How to interface them all with a database [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'm new to android and ios development. My question is pretty simple. I've got a basic ecommerce website and I need to create an app version of the website. I want to create two native apps. What's the best way to do it? How can I interact with the database on an android and ios app. (I wasn't able to find a complete answer on the internet, but if there's one please let me know and I will close this question immediately). Thank you
You need to create web services.
You can develop in java, PHP, etc.
The web services will receive requests from the mobile, get the data from the database and then send a response to the mobile. The mobile APPs will never interact with the server database, they will only make request to the web services and get responses.
To this the most common is to make REST calls with JSON.
In Android you can use Retrofit.
And in iOS you can use AFNetworking.
A good PHP example of how to develop your REST and JSON service you can find here.
You would need some API to access the data. You can use PHP, Java or C# to develop your own API's. The API will handle requests and return the required data. You Android client will connect to the API and perform Http requests. Check out this guide on how to perform Http requests: https://developer.android.com/training/volley/simple.html
You can also check this question for more info: I want to make a apps where people can upload their status,image or video what I need to know for this?

Android - guidelines - app with online database [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I want to create an app that is based on the data stored on remote database.
What i have in mind is to use a VPS i have to store the database. Then the app will, on demand, access (and update) the data on the database.
How should i set up my VPS in order to do that? Right now i just have a MYSQL server running.
Edit: I want to know what are the best practices i should follow in order to have an android app based on an online database.
Can i access the db directly from the app?
Do i need anything
besides the database server to assist the communication of the db and
the app?
Should i use, for some reason, another db instead of mysql
(faster,more secure, easier to connect)?
I am new to this and i would like some general guidelines.
Thanks.
Can i access the db directly from the app?
As far as I know, no you still cannot access MySQL directly from Android. It has been a year since I did Android development, but you will most likely need something sitting in between (like a RESTful service, see http://phprestsql.sourceforge.net/).
How to access online mysql database in android?
how to access external mysql database in android?
Do i need anything besides the database server to assist the communication of the db and the app?
Yes. See answer above.
Should i use, for some reason, another db instead of mysql (faster,more secure, easier to connect)?
That is up to you. There are some NoSQL solutions that offer a RESTful interface built in (I think CouchDB does this, MongoDB, etc...).

How to connect an android app to a remote database? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I've been doing my own research but to no avail. I am doing an android app which contains listviews and it needs to query data from a remote database. I would really appreciate it if someone could share good tutorial links that teach that kind of stuff. Sorry, I know this isn't a proper question but I really need some help. Thanks.
You can refer to this tutorial
Or refer to this
How about a simple web service in the middle?
It helps to prevent you putting database username/pw directly in the app too.
App -> Http requests -> Web service -> Database
The Http requests can be done via Android HttpClient
The web service can be in php for example. (There is a lot example for php to database on google.)
To communicate with the remote databse, you require web service which can fetch data from or suit data to remote database.
I am not sure about which web platforms are you using currently but I would suggest you to go with REST with JSON.
This is the typical case of SyncAdapter with it you can use the remote database from your content provider as a regular DB.
I have done it and it works well with only few complexities.

Categories

Resources