问题标签 [java-binding]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
17 浏览

xamarin.android - 如何消除 Xamarin Android 项目中重复的 jni 签名?

我有一个仅针对 Android 的 Xamarin Forms 项目。

对于不同的 RFID 手持设备制造商,我有两个以 JAR 形式存在的独立 API。

我正在尝试将这两个 API 包含在同一个 Android 项目中,我可以在其中使用 API 选择器。

我在一个单独的 Java Bindings 项目中都有每个。

这两个 API 都包含霍尼韦尔条形码库,它们共享一个共同的 jni 签名。

我无法在添加了两个库的情况下构建 Android 项目,因为出现错误:java.lang.IllegalArgumentException:已添加:Lcom/hsm/barcode/DecodeOptions

我尝试在其中一个库的 Metadata.xml 中添加“remove-node”。

当我重建时,我可以看到类文件省略了 obj/debug/generated 目录。

在此处输入图像描述

在此处输入图像描述

jni 引用仍然出现在 api.xml 文件中,这反过来仍然会导致 Android 构建错误。

在我承认我不能将这两个库包含在同一个项目中之前,我想我会看看是否有人有建议。

TIA

0 投票
1 回答
26 浏览

java - 将 aar 库绑定到 Xamarin.Android

我正在从 AAR 库创建绑定库,以便生成可以在 Xamarin.Android 项目中使用的 dll。

我有一个问题,因为 Java 授权的语法在 C# 中没有得到授权

您将如何用 C# 编写此 Java 代码?

生成的自动绑定文件给了我这个结果之王,未授权

我收到以下错误:

我正在考虑创建一个完整的类来在 IChild 和 IParent 之间架起一座桥梁,但它必须是另一个更合适的解决方案......

0 投票
0 回答
56 浏览

xamarin - 将 AAR 库绑定到 Xamarin.Android、metadata.xml 模板

我正在从 java AAR 文件为 Xamarin.Android 创建一个绑定库。

这是编译后实际生成的代码:

生成的代码是从 Java 到 C# 的基本翻译,但无效且无法编译。

我想修改 Metadata.xml 文件(或任何其他文件)以告诉编译器生成以下代码:

请问我该怎么办?我已阅读文档但无法实现它:-(

非常感谢您的帮助!

0 投票
0 回答
68 浏览

c# - 无法为 Microsoft Engagement Insights SDK 创建 Xamarin.Android Java 绑定库

我正在尝试在我的 Xamarin Android 应用程序中集成用于 Microsoft Customer Insights Engagement Insights 的 Android SDK,并且需要创建一个 Xamarin.Android Java 绑定库,因为 SDK 提供了一个预发布的 aar 文件。

我创建了一个 Android 绑定库(Xamarin)项目,添加了 eiandroidsdk-debug.aar 并按照此处提到的步骤创建 dll 文件。我在构建时遇到以下错误: \obj\Debug\generated\src\Com.Microsoft.Engagementinsights.Transmission.Core.InternalMgrImpl.cs(78,76,78,90): error CS0234: The type or namespace name 'EventMessenger' does not exist in the namespace 'Com.Microsoft.Engagementinsights.Transmission.Core' \obj\Debug\generated\src\Com.Microsoft.Engagementinsights.Transmission.Core.ITransmissionEvents.cs(13,130,13,148): error CS0234: The type or namespace name 'RecordWithMetadata' does not exist in the namespace 'Com.Microsoft.Engagementinsights.Transmission.Core' \obj\Debug\generated\src\Com.Microsoft.Engagementinsights.Transmission.Core.ITransmissionEvents.cs(17,127,17,145): error CS0234: The type or namespace name 'RecordWithMetadata' does not exist in the namespace 'Com.Microsoft.Engagementinsights.Transmission.Core' \obj\Debug\generated\src\Com.Microsoft.Engagementinsights.Transmission.Core.ITransmissionEvents.cs(21,129,21,147): error CS0234: The type or namespace name 'RecordWithMetadata' does not exist in the namespace 'Com.Microsoft.Engagementinsights.Transmission.Core' \obj\Debug\generated\src\Com.Microsoft.Engagementinsights.Transmission.Core.ITransmissionEvents.cs(25,121,25,139): error CS0234: The type or namespace name 'RecordWithMetadata' does not exist in the namespace 'Com.Microsoft.Engagementinsights.Transmission.Core' \obj\Debug\generated\src\Com.Microsoft.Engagementinsights.Transmission.Core.ITransmissionEvents.cs(103,144,103,162): error CS0234: The type or namespace name 'RecordWithMetadata' does not exist in the namespace 'Com.Microsoft.Engagementinsights.Transmission.Core' \obj\Debug\generated\src\Com.Microsoft.Engagementinsights.Transmission.Core.ITransmissionEvents.cs(136,141,136,159): error CS0234: The type or namespace name 'RecordWithMetadata' does not exist in the namespace 'Com.Microsoft.Engagementinsights.Transmission.Core' \obj\Debug\generated\src\Com.Microsoft.Engagementinsights.Transmission.Core.ITransmissionEvents.cs(170,143,170,161): error CS0234: The type or namespace name 'RecordWithMetadata' does not exist in the namespace 'Com.Microsoft.Engagementinsights.Transmission.Core' \obj\Debug\generated\src\Com.Microsoft.Engagementinsights.Transmission.Core.ITransmissionEvents.cs(203,135,203,153): error CS0234: The type or namespace name 'RecordWithMetadata' does not exist in the namespace 'Com.Microsoft.Engagementinsights.Transmission.Core'

似乎没有生成 2 个引用的文件: 在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

在 sdk github 页面上也提出了一个问题:https ://github.com/microsoft/engagementinsights-sdk-android/issues/1

我尝试同时针对 Android SDK 10 和 11,但没有效果。有谁知道 aar 文件是否有问题或者我在绑定过程中遗漏了什么?

0 投票
1 回答
15 浏览

java - 绘制结束位置获取项目矩形大小

我正在尝试使用 ImGui(Java 绑定)来填充空白空间或填充某些 UI 的整个宽度,但我似乎无法弄清楚如何/何时向 ImGui 询问 Item Rect Max 以及在某些情况下我最终得到了一个没有填充的小空间。

在此处输入图像描述

我使用的代码在这里(这里添加的行太多了) https://github.com/blockout22/VisualScripting/blob/main/src/main/java/visual/scripting/GraphWindow.java#L295

这是我从中获得风格的地方,但我认为我遗漏了一些东西 https://github.com/thedmd/imgui-node-editor/blob/687a72f940c76cf5064e13fe55fa0408c18fcbe4/examples/blueprints-example/blueprints-example.cpp