MFP 似乎在某些 Android 设备中禁用了访问设备 camera/gallery 的能力

MFP seems to disable the ability of accessing the device camera/gallery in some Android devices

基本上 HTML5 way to access device camera/gallery 在大多数现代移动浏览器中都能正常工作。但是一旦包裹在 MobileFirst/Worklight Android 应用程序中,这似乎不起作用(测试设备:Samsung galaxy 系列)。

例如:以下 html 文件可以通过直接访问文件 URL 来触发设备 camera/gallery 在 Samsung Galaxy 5 中访问的行为,但在代码被包装时不起作用在 MFP Android 应用程序中。

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="UTF-8">
    <title>demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="css/main.css">
    <script>window.$ = window.jQuery = WLJQ;</script>
</head>
<body style="display: none;">
<div>
    <input type="file" accept="image/*">
</div>
<script src="js/initOptions.js"></script>
<script src="js/main.js"></script>
<script src="js/messages.js"></script>
</body>
</html>

这是因为您并不是真的在浏览器中;你在 WebView 中。科尔多瓦网络视图。要访问本机设备功能,例如相机、campess、文件系统等,您需要使用其提供的 API(与 Worklight/MFPF 捆绑在一起)通过 Cordova 层。这样做,您将能够访问所有内容...