简体   繁体   English

在现有项目中包含项目tango SDK

[英]Include the project tango SDK in an already existing project

I am new to Android development and I have no idea how to include the library that comes with the Google Tango SDK. 我是Android开发的新手,我不知道如何包括Google Tango SDK随附的库。

The app, as it is, is a small java wrapper around a c++ core that is basically a lightweight render engine. 该应用程序实际上是围绕c ++核心的小型Java包装程序,而c ++核心基本上是轻量级的渲染引擎。 It can render one model and handle input. 它可以渲染一个模型并处理输入。 It is all done in C++ using Android NDK. 所有这些都使用Android NDK在C ++中完成。

The problem is that I now want to use functions like onXyzIjAvailable() . 问题是我现在想使用类似onXyzIjAvailable()函数。 How do I include and use the library? 如何包含和使用该库? I know of this , but I need to include the library and get access to the TangoService_connectOnXYZijAvailable() function. 我知道这一点 ,但是我需要包括该库并获得对TangoService_connectOnXYZijAvailable()函数的访问权限。

I want to stress that I am new to android development and I have never included anything. 我想强调一下,我是android开发的新手,而且我从没包含任何东西。 I have only written the code myself or used Android Studio to download and include the SDKs, generate the GRADLE files and take care of the compilation/makefles. 我只是自己编写代码,还是使用Android Studio下载并包含了SDK,生成了GRADLE文件,并负责编译/编译。 I found this SO post talking about adding a library, but I did not understand the answer. 我发现这篇SO帖子是关于添加库的,但是我不明白答案。 How do I import it to this project and build it? 如何将其导入到此项目并进行构建?

Thank you so much for the help. 非常感谢你的帮助。

  1. You must download the current tango api and service sdk for C here 您必须在此处下载C的当前探戈api和服务sdk
  2. Unzip and place the folders (I named them tango_client_api and tango_service_sdk) you want to. 解压缩并放置所需的文件夹(我将其命名为tango_client_api和tango_service_sdk)。 I prefer a structure like that: 我更喜欢这样的结构:
    • ProjectFolder/app/ ProjectFolder / app /
    • ProjectFolder/build/... ProjectFolder /构建/ ...
    • ... ...
    • tango_client_api/ tango_client_api /
    • tango_service_sdk/ tango_service_sdk /
    • third-party/... 第三方/...
    • ... ...
  3. Now you have to include the lib paths into your Android.mk makefile (located in path like ProjectFolder/app/src/main/jni/Android.mk) as followed: 现在,您必须将lib路径包括到您的Android.mk makefile中(位于ProjectFolder / app / src / main / jni / Android.mk之类的路径中),如下所示:

     LOCAL_PATH := $(call my-dir) PROJECT_ROOT_FROM_JNI:= ../../../../.. PROJECT_ROOT:= $(call my-dir)/../../../../.. include $(CLEAR_VARS) LOCAL_MODULE := lib_your_project_name LOCAL_SHARED_LIBRARIES := tango_client_api LOCAL_CFLAGS := -std=c++11 LOCAL_C_INCLUDES := $(PROJECT_ROOT)/tango_service_sdk/include/ \\ LOCAL_SRC_FILES := your-project-file1.cc \\ your-project-file2.cc \\ your-project-file3.cc LOCAL_LDLIBS := -llog -lGLESv2 -L$(SYSROOT)/usr/lib include $(BUILD_SHARED_LIBRARY) $(call import-add-path, $(PROJECT_ROOT)) $(call import-module,tango_client_api) 
  4. In your .h files you can use for example: #include <tango_client_api.h> to get access to all TangoService_functions 在您的.h文件中,您可以使用例如: #include <tango_client_api.h>来访问所有TangoService_functions

And that's it. 就是这样。 I really recommend you to look into the tango C examples on github https://github.com/googlesamples/tango-examples-c 我真的建议您查看github https://github.com/googlesamples/tango-examples-c上的探戈C示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM