Access Sqlserver through Android

Source: Internet
Author: User
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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.