简体   繁体   English

如何在Java项目中导入com.android.camera包

[英]how to import com.android.camera package in a java project

Hi I am writing a test using UIAutomator API , however in my java project I want to import the com.android.camera package. 嗨,我正在使用UIAutomator API编写测试,但是在我的Java项目中,我想导入com.android.camera包。 However I am always getting an error that this import cannot be resolved. 但是,我总是收到一个错误,指出此导入无法解决。 I have added the android.jar in my build path and rest of the things work fine. 我在构建路径中添加了android.jar,其余的一切工作正常。 However I am not able to import this package. 但是,我无法导入此软件包。

There is no such package in android, maybe you are looking for android中没有这样的包,也许您正在寻找

com.android.hardware.Camera com.android.hardware.Camera

class ? 类?

if so try 如果是这样,请尝试

import com.android.hardware.Camera;

camera类位于下面的包中,因此请尝试导入下面的包而不是com.android.camera添加以下内容。

import android.hardware.Camera;

import android.hardware.Camera; 导入android.hardware.Camera;

try to place it after your package name 尝试将其放在您的包裹名称之后

If you are using Eclipse than just press Ctrl + Shift + O Eclipse will automatically add the required libraries in your source code. 如果您使用的是Eclipse,则只需按Ctrl + Shift + O, Eclipse会自动在源代码中添加所需的库。 If still you are getting import issue than you need to check if you are using correct API or the spelling is correct. 如果仍然遇到导入问题,则需要检查使用的API是否正确或拼写是否正确。

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

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