1

I want to install MySQL on my Server and create a database and access my database through my Android Code. I know that this work can be done through webservice in Android, is there any way that I can use it without webservice. I don't find anything related to this. Please provide any links useful for this kind of work.

Rakesh Yadav
  • 1,966
  • 2
  • 21
  • 35

1 Answers1

0

Yes you can write one restful web-service which will interact with your MySql database, and then you can integrate the service with your android code.

  1. To connect your java code to MySql, you can simply use JDBC or hibernate.

  2. To integrate and consume the restful web service, you can use spring-android-rest-template(to call web service) and jackson-databind(to get responce in JSON format)jars. You should read once this link. I have also used the same for my android app, and It is working. Its really easy to learn and use. It will take hardly 30 min. to understand it.

https://spring.io/guides/gs/consuming-rest-android/

pbajpai
  • 1,303
  • 1
  • 9
  • 24
  • the problem is I want to avoid creating web service. Can u suggest some link to create a simple web service. – Rakesh Yadav Jun 21 '16 at 09:55
  • You can use Spring @RestController annotation to create a simple RESTful webservice, Please check this link, its very easy: https://spring.io/guides/gs/rest-service/ – pbajpai Jun 21 '16 at 10:05