美文网首页
浏览器访问ObjectBox 数据库

浏览器访问ObjectBox 数据库

作者: mapleSeriesX | 来源:发表于2020-05-21 17:10 被阅读0次

清单文件

<!-- Required to provide the web interface -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required to run keep-alive service when targeting API 28 or higher -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

root build.gradle

buildscript {
    ext.objectboxVersion = '2.5.1' 
    dependencies { 
        classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion" 
    }
} 

app build.gradle

dependencies {
    //支持浏览器查看数据库数据,如果不需要可以去掉dependencies 代码块
    debugImplementation "io.objectbox:objectbox-android-objectbrowser:$objectboxVersion"
    releaseImplementation "io.objectbox:objectbox-android:$objectboxVersion" 
}
//一定放在dependencies代码块下
apply plugin: 'io.objectbox'// after applying Android plugin 

命令行输入:adb -s 192.168.2.186 forward tcp:8090 tcp:8090

浏览器访问
http://localhost:8090/index.html

相关文章

网友评论

      本文标题:浏览器访问ObjectBox 数据库

      本文链接:https://www.haomeiwen.com/subject/exrtahtx.html