我们正在使用Indoor Atlas SDK构建一个导航应用程序,它在屏幕的上半部分有一个地图,在屏幕的下部70%有一个列表视图,并且为了保持代码跨平台,我使用Xamarin创建了它形成可移植类库并使用依赖注入来实现特定于平台的代码。
我创建了一个绑定库,如本教程中所描述的,虽然它在开始时很难,因为只要我在模拟器中加载应用程序就会因为抛出一个未指定的链接错误而崩溃,原来是因为我的默认模拟器是在x86架构上,而IndoorAtlas Native库仅用于armabi-v7a和arm64-v8a,并且在这样的设备上运行应用程序并没有引发错误,但是我无法使它在检测当前位置时工作并获得目前的平面图,虽然我可以使其完全相反。
要显示确切的代码 - 这在BackgroundListener.Currentlocation的类型为 Android.Locations.Location
的情况下不起作用mIALocationManager = IALocationManager.Create(this);
IALocation currentLocation = IALocation.From(BackgroundListener.Currentlocation);
mIALocationManager.SetLocation(currentLocation);
但是这样做
string floorPlanID = "b11a5c2b-6f9b-4865-b52e-lastidpart";
IALocation FLOOR_PLAN_ID = IALocation.From(IARegion.FloorPlan(floorPlanID));
mIALocationManager.SetLocation(FLOOR_PLAN_ID);
通过不起作用我的意思是它无法检测到在很大程度上直观的区域。我检查了文档,发现这段代码可以获取FloorPlan
private void fetchFloorPlan(String id) {
// Cancel pending operation, if any
if (mPendingAsyncResult != null && !mPendingAsyncResult.isCancelled()) {
mPendingAsyncResult.cancel();
}
mPendingAsyncResult = mResourceManager.fetchFloorPlanWithId(id);
if (mPendingAsyncResult != null) {
mPendingAsyncResult.setCallback(new IAResultCallback<IAFloorPlan>() {
@Override
public void onResult(IAResult<IAFloorPlan> result) {
Logger.d(TAG, "onResult: %s", result);
if (result.isSuccess()) {
handleFloorPlanChange(result.getResult());
} else {
// do something with error
Toast.makeText(FloorPlanManagerActivity.this,
"loading floor plan failed: " + result.getError(), Toast.LENGTH_LONG)
.show();
}
}
}, Looper.getMainLooper()); // deliver callbacks in main thread
}
}
现在我花了3天时间寻找解决方案,但在撰写本文时,IndoorAtlas的文档不是很详细(或者我可能只是习惯了MSDN的详细类型)。我确实有一点Java知识(因为我在大学学习,但没有熟练程度),这是我转向Xamarin的主要原因。由于C#是我的主要专业语言,我能够在短短3周内完成Xamarin的大部分应用程序,而在过去的6个月中我甚至无法完成一半的Java(这排除了在Native Android中使用应用程序的任何建议)。
现在查询
所以我需要帮助和指导才能找到解决方案的途径。
其他一点虽然说明了为什么这个泛型问题发生的原因,我正在寻找解决方案
注意:如果你觉得我是一个帮助吸血鬼的免费帮助,我们可以连接并外包应用程序的某些部分,因为我已经发布了query on Upwork和我无论如何都会将解决方案发布给未来读者的社区。 p>