android webview setDatabasePath 已弃用 [英] android webview setDatabasePath deprecated

查看:28
本文介绍了android webview setDatabasePath 已弃用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此方法在 API 级别 19 中已弃用数据库路径由实现管理,调用此方法无效.

This method was deprecated in API level 19 Database paths are managed by the implementation and calling this method will have no effect.

我使用setDatabasePath来设置webview的数据库路径.

I use setDatabasePath to set the database path of the webview.

String databasePath = this.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath(); 
settings.setDatabasePath(databasePath);

这是否意味着在 API 19 中它再也找不到我的数据库了??如何解决这个问题?(它们是什么意思:数据库路径由实现管理)

Does this mean in API 19 it cant find my database anymore?? How to solve this? (What do they mean with: Database paths are managed by the implementation)

推荐答案

API level 19 是指 Android 4.4 KitKat,其中浏览器引擎从 Android webkit 切换到了 Chromium webkit,几乎所有原来的 WebView API 都封装到对应版本铬网络套件.

API level 19 means Android 4.4 KitKat, in which the browser engine is switched from Android webkit to chromium webkit, with almost all the original WebView APIs wrapped to the counterparts of chromium webkit.

这意味着 WebView API 的大部分实现与 Android 4.3 及之前版本不同,包括数据库存储 API.这也意味着由于 Android 4.4 开发人员不能(或不必)分配备用数据库路径;默认情况下,所有这些都由 Android 处理.

That means most of the implementations of WebView APIs are different from Android 4.3 and before, incuding the database storage API. That also means since Android 4.4 developers cannot (or don't have to) assign an alternative db path; all this is handled by Android by default.

由实现管理现在意味着数据库存储路径默认由chromium webkit引擎处理,而在Android 4.4之前,它是在框架层的android.webkit中处理的需要设置.

managed by the implementation now means the database storage path is handled by chromium webkit engine by default, while before Android 4.4 it's handled in android.webkit in framework layer which needs to be set.

这篇关于android webview setDatabasePath 已弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆