如何与像加速度传感器和摄像机使用C / C ++设备播放? [英] How to play with devices like accelerometer and camera using C/C++?

查看:127
本文介绍了如何与像加速度传感器和摄像机使用C / C ++设备播放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如你可以在下面的Andr​​oid平台架构示意图看到使用不同的层已建成。

  • 应用程序都制定了的Java
  • 应用程序框架是用写的Java (根据我的理解)
  • C / C ++

对于一些疯狂的原因,我要玩/处理像加速指南针和<$ C $设备C>相机使用 C / C ++ 这意味着直接访问它们在第三层即 。根据我的理解应用程序框架本身将消耗用于访问这些设备,然后提供原料药应用程序

我要寻找的任何文档/教程/演示,可以帮助我在这方面,即如何访问和使用这些设备,如摄像头,加速计和指南针从 C / C ++ code或者换句话说,如何与这些设备直接从层。

我最后的选择是获取Android源$ C ​​$ c和深入挖掘它,找出我在找什么,但我想在一个文档/演示/教程/任何形式的一些简单的方法,可以使这一点难不倒我。

解决方案
  

我要寻找的任何文档/教程/演示,可以帮助我在这方面,即如何访问和使用这些设备,如摄像头,加速计和指南针从C / C ++ code或者换句话说如何玩直接从库层这些设备。

您不知道。您从Java code访问它们。重新组织你的C / C ++ code来支持你的Java code。

As you can see in architecture diagram below android platform has been built using different layers.

  • Application are developed in Java
  • Application Framework is written using Java (according to my understanding)
  • Libraries are in C/C++

For some insane reason I have to play/deal with devices like accelerometer, compass and camera using C/C++ which means directly accessing them in 3rd layer i.e. Libraries. According to my understanding the Application Framework itself would be consuming Libraries for accessing these devices and then providing APIs for Applications.

I am looking for any documentation/tutorials/demo which can help me in this regard i.e how to access and use these devices like camera, accelerometer and compass from C/C++ code or in other words how to play with these devices directly from Libraries layer.

My last option would be to get the android source code and dig deep into it to find out what I am looking for but I would like some easy way in form of a documentation/demo/tutorial/anything that can make this a bit easy for me.

解决方案

I am looking for any documentation/tutorials/demo which can help me in this regard i.e how to access and use these devices like camera, accelerometer and compass from C/C++ code or in other words how to play with these devices directly from Libraries layer.

You don't. You access them from Java code. Reorganize your C/C++ code to support your Java code.

这篇关于如何与像加速度传感器和摄像机使用C / C ++设备播放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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