Hi I am writing a test using UIAutomator API , however in my java project I want to import the com.android.camera package. 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. However I am not able to import this package.
Asked
Active
Viewed 1,214 times
4 Answers
1
There is no such package in android, maybe you are looking for
com.android.hardware.Camera
class ?
if so try
import com.android.hardware.Camera;

Mr.Me
- 9,192
- 5
- 39
- 51
-
Actually I want to retrieve the values of the variable mShutterToPostViewCallbackTime , mPictureDisplayedToJpegCallbackTime ,mJpegCallbackFinishTime which are from the class CameraActivity. But I am doing this in a UIAutomator class – madhuri Dec 27 '13 at 06:56
-
CamearaActivity is part of Android Camera App, you can't do unit testing for 3rd party apps since you don't have access to their source code. try building your test with a different approach instead – Mr.Me Dec 27 '13 at 10:48
-
Is there a way to read the values of these from logcat within my UiAutomator class? – madhuri Dec 30 '13 at 10:18
-
unless the android device you're testing on is rooted I don't think that is possible, also I don't think that those values are being logged in the first place. do you see them in the logcat ? – Mr.Me Dec 30 '13 at 10:26
-
Yes its rooted, I do see them in logcat, the logging level is V and TAG is "SomeTest". How can I read these values? V/CAM_TEST MODULE(2014) : mShutterToRawCallbackTime = xxxxxxxxms – madhuri Dec 30 '13 at 11:43
-
http://stackoverflow.com/questions/11461650/read-logs-permission-on-jelly-bean-api-16/12642918#12642918 check this – Mr.Me Dec 30 '13 at 13:27
0
The camera class resides inside the below package so try to import below package instead of com.android.camera
add the below.
import android.hardware.Camera;

GrIsHu
- 29,068
- 10
- 64
- 102
0
import android.hardware.Camera;
try to place it after your package name

vinay Maneti
- 1,447
- 1
- 23
- 31
0
If you are using Eclipse than just press Ctrl + Shift + O Eclipse will automatically add the required libraries in your source code. If still you are getting import issue than you need to check if you are using correct API or the spelling is correct.

Tabrej Khan
- 894
- 6
- 15