1. Making the address

Android-Debug-Database

2. Add dependencies

Add to app build.gradle

dependencies { 
     debugCompile 'com. Amitshekhar. Android debug - db: 1.0.4' 
}

Copy the code

3. Real phone access (mobile phone and computer must be on the same LAN)

Click on the address to access it directly, or you can enter it manually in your browser. The default address is mobile IP:8080. If the mobile IP is 192.2.2.2, the default address is 192.2.2.2:8080.

4. Simulator access

There is another method for virtual machines, but it also works for real machines, where the browser accesses localhost:8080; A prerequisite for such access is the adb forward TCP :8080 TCP :8080 command.

5. Change the port number

If you do not want to use the default 8080 port number, you can specify it yourself. In your app’s build.gradle

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId ""
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'} debug {// here resValue("string"."PORT_NUMBER"."8088")}}}Copy the code

6. Rendering