D
D
Danil Ochagov2018-08-06 16:08:56
Java
Danil Ochagov, 2018-08-06 16:08:56

What is the best way to work with db in android development?

What is the best way to work with a database in android development in java (it is desirable that you can work with different types of databases, be it mysql, oracle or others (well, who knows, suddenly you have to)).
I myself know jdbc and I don’t understand if I need it here, so I know MySQL, but startandroid used SQLLite (as I understand it will be different from MySQL) and this is 1 way. The 2nd way is jdbc (like someone does through it). 3 through firebase (I was interested in learning to teach it?) and 4 way it is somehow through JSON (for example, you can write PHP code and convert it to JSON and receive it). And for sure there are a bunch of methods, but which one is better?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Chinakin, 2018-08-06
@SaintRepublic

All that you have listed are not methods, but completely different things, they are not similar to each other, each of them is used for its own specific purposes.
MySQL and SQLite are just DBMS based on the same sql, same queries. The differences between them are that MySQL is used most often for servers, and SQLite is an "embedded" DBMS, it is already present in the Android OS and is used to create local databases.
More precisely, each application can create its own local databases to store any data.
If you want the most convenient way to store some local data on a user's device, use SQLite. Development environments such as Android Studio already include packages to easily work with SQLite using regular sql queries.
Let me tell you more about JSON. It is often used to exchange data with the server. In android, of course, you can create json files and store data in them, but, as for me, this is ...

D
Dmtm, 2018-08-09
@Dmtm

the best way to work with the database is through ORM (ORMLite, greenDAO and who else is there now)
and for 99% of cases it will be native sqlite,
but no one bothers to add something third-party, here you can look at various embedded databases,
such as HSQLDB - we take jar and add it to the project,
but why?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question