G
G
GLAZIKK2018-04-19 12:19:49
MySQL
GLAZIKK, 2018-04-19 12:19:49

How to display data from MySQL database in Android Studio?

I need to display data from MySQL database in Android Studio. How can this be done?
Database connection code:

@RequiresApi(api = Build.VERSION_CODES.KITKAT) 
public static void main(String[] args) throws ParserConfigurationException, IOException, SAXException, ClassNotFoundException, SQLException { 
String url = "jdbc:mysql://10.10.61.171:3306/Priem_zayvok"; 
String username = "GLAZIK"; 
String password = ""; 
Class.forName("com.mysql.jdbc.Driver"); 
try(Connection conn = DriverManager.getConnection(url, username, password)) { 
System.out.println("We ' re connected"); 
}
}
java
mysql
androidstudio

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexalexes, 2018-04-19
@alexalexes

Between your client application and MySQL, there must be a server application that will directly query MySQL and provide data and APIs to your application.
The easiest way is to set up a PHP or node.js server and connect it to MySQL, data exchange with the client is in JSON format.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question