Live Debug Database on Android Studio (SQLite)

Source: Internet
Author: User

Installation

Sqlscout is a plugin for Android Studio, by clicking on:

Setting —> Plugings —> Browse Repositories
    • 1

Search Sqlscout installation.

If the download does not move, you can go to   here   download, then click Install Plugin from disk to import.

Load

After successful installation restart Android Studio, you will find the right side bar appears SQLite Exporer, expand and click "+" will appear three options:

Local SQLite Database

If the database you are debugging is already exported to your computer, select this option to load.

Android (Download Database locally)

Normally, the database that we want to debug is on the phone, can use this function to extract the database. Select the device you want to debug, the project package name, and the database name.

Android (Live Device Connection)

The disadvantages of the above two methods are obvious and the database cannot be updated in real time.  
Live Device Connection is a new feature of Sqlscout 2.0, and the difference is that it can manage and update the database in real time.  
need to be added in Project Build.gradle before use:

allprojects {    repositories {        jcenter(www.tiaotiaoylzc.com)        maven {            ‘www.yongshiyule178.comhttp://www.idescout.com/maven/repo/‘   

Inside the module's build.gradle, add:

‘com.idescout.sql:sqlscout-server:2.0‘
    • 1

Add a line of code to the OnCreate method of the activated Activity:

SqlScoutServer.create(this, getPackageName(www.078881.cn));
    • 1
Debugging

The entire interface is as follows:  

They are:

    • Database list: List of databases to debug, expand the display of tables in the database, and right-click to open the SQL editor.
    • SQL Editor: A place to enter SQL statements that supports auto-completion and code highlighting.
    • Data console: Displays the data of the query in an Excel-like format, or you can edit the data here.
    • Data graph: A relationship that is used to show tables and fields.

is not very useful, it is an artifact Ah!  
but it's a charge for something so useful.  
If you're shy, you can keep looking down

Android Debug Database

This is an open source project, project address   here.

First, add the Build.gradle inside the module:

‘com.amitshekhar.android:debug-db:1.0.0‘
    • 1

Let the phone and the computer in a LAN, when the project ran up, in the logcat inside will print out such a line:

D/DebugDB: Open http://XXX.XXX.X.XXX:8080 in your browser

Copy the address to the browser and you'll see an interface like this:

It's easy to understand, there are several columns:

    • Query: Where to write the SQL statement
    • Databases: Database
    • Tables: Table in database
    • data: table, supported Edit, Search

It's that simple, and it's a complete one.

Live Debug Database on Android Studio (SQLite)

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.