In summer practice, if you want to access the database on campus, you can access the database on your mobile phone, and then query your scores, achievements, and other things. However, android does not support access to sqlserver, but you can add a bridge to access it. This is webservice. Fortunately, I found a senior who has done this.
In summer practice, if you want to access the database on campus, you can access the database on your mobile phone, and then query your scores, achievements, and other things. However, android does not support access to sqlserver, but you can add a bridge to access it. This is webservice. Fortunately, I found a senior who has done this.
In summer practice, if you want to access the database on campus, you can access the database on your mobile phone, and then query your scores, achievements, and other things. HoweverAndroid itself does not support access to sqlserver, but it can add a bridge for access. The added webservice.
Fortunately, I found a senior who has worked in this field. His complete setup is a library management system that can access the SQL database from a mobile device. I am going to study the source code, and I have encountered some headaches ...... I don't know how to use it.
Well, I have consulted myself, and I will summarize it as follows:
1. determine the format of the database table.
2. Write a webservice and set aside functions as the interface for accessing the database (add, delete, query, and modify ).
3. define the mobile phone (android) class, transmit and accept data to the webservice through the soap protocol, and parse (in fact, xml is sent to the webservice, and then webservice operates on the database, then return a value to the mobile phone ).
4. Visual Studio can directly connect to the database (this has never been done before, and the database is also learned for the purpose of doing this program. Today, the database has gained a lot of knowledge ).
5. Run webservice and a webpage pops up. This means that webservice is started.
6. There is a hello world function in webservice, which is to test whether the server is connected successfully. Click and a page with xml content is displayed. OK.
7. android running simulator, connection, and Shenma, that's easy to say.
What I had previously struggled with was how to use webservice. In fact, it was enough to run the service on a computer.
Attached source code example: http://download.csdn.net/detail/zhyl8157121/4503288
Updated a more detailed tutorial: http://blog.csdn.net/zhyl8157121/article/details/8169172