Open-source Mysql client for Android

Source: Internet
Author: User

Open-source Mysql client for Android
Github address: https://github.com/enbandari/amysqlclient

In the consistent style of love and nonsense, let's first explain why we should do this ..

After a dog came back from practice, it was really not our style to guard the big offer in the lab, so we started an application with our friends. The server and database of this application are naturally handed over to the home. Idle talk. He said that he was sleeping in a sleep night and was woken up by a phone call from the client development sister. He explained that the Mysql data may be abnormal and he needed to find out the truth. Lianxiao is reluctant, but he is still rolling and crawling, turning to the ground, opening a small book, and exploring the truth ..

If you are on your phone, you can understand this matter...

1. Search

Why repeat the wheel? So Google did not expect that all apps could allow android phones to operate Mysql. Yes ..

2. Think

How can this be done?

How can I simulate cmd to create a mysql command line? Start socket connection 3306? Self-resolution protocol? I am not from lanxiang, so I am afraid I am not competent. It is also destiny, at this time the home is turning the server code, a glance on the Spring jdbc. If you connect jdbc to mysql, you can save some time on the protocol.

3. for android 3.1, the Spring core cannot be used directly.

Since the author decided to use Spring jdbc to solve this problem, he decided to consider how the android client can use the Server framework. Experiment times, do not want to use Spring because of conflicts between Java library files and android. Troubles. In this case, it also saves a lot of trouble. Think about Spring jdbc, but it is also a layer of jdbc encapsulation. Should we use Spring jdbc only? Try it.

3.2 maintain command Context

The family is also drunk. Use Spring jdbc directly to create a command line. It is not impossible. The connection pool is not used at first, so that different connections are used for each command sent. So you want to use test (test is also a library !), Then select * from t (t is the table in the test database !), The recipient replied: Oh sorry, there is no t table.

This ..

How about the last DBCP? The problem is solved. The reason is that the connection is not released.

3.3 The jdbc url must specify the Database Name

The family is really unhappy ...... How can I know that your database server has sub-databases. If you want to go, you have to configure the database name information_schema for the jdbc url by default. If you have special requirements, please feel free to go!

4. View

Xianjia knows, no picture, no truth. The page is not so aesthetic. Don't pick it out.

4.1 simple mode

Service list. You can edit your server information here. The seller saves the information to sqlite of the official mobile phone. The hacker does not want your password.

Guest, if you only want to watch it out, advise you to select a simple mode.

The data page can be dragged! Up and down, no pressure!

4.2. Command Line Mode

The command line mode is a familiar mode! In order to facilitate the guest to enter commands, the following convenient methods are provided for the seller!

4.2.1 display history

Click 'mysql' to call out the history list ~~

4.2.2 call out common commands by long pressing "mysql>'

4.2.3 keyword input shortcuts

4.2.4 keyword prompt during command input

5. Postscript

In fact, the main function of the program was developed on the home train. It was boring to go on the train ..

Do not enable obfuscation, because obfuscation may cause connection failure. Why? I have had too many interviews recently. I am tired and don't want to worry about it ..

Related Article

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.