0
  1. In Android API 21 they added android.hardware.camera2.params.StreamConfiguration but for some reason Android Studio can't find it.

  2. Also this class (android.hardware.camera2.params.StreamConfigurationMap) has a public constructor and yet it says I can't create an instance of it outside its package. Why?!

Tried this:

StreamConfigurationMap map = new StreamConfigurationMap();  //Says can only be instantiated in its package
StreamConfiguration map = new StreamConfiguration();   //can't find StreamConfiguration
Fish Below the Ice
  • 1,273
  • 13
  • 23
TomerZ
  • 615
  • 6
  • 17
  • Do you have your compileSdkVersion set to 21? – Bryan Herbst Nov 20 '14 at 17:36
  • I guess not, where and how am I supposed to define it? Manifest file? – TomerZ Nov 20 '14 at 17:37
  • You tagged this as android-studio, so I'm assuming you are using Gradle, in which case it should be in build.gradle in the defaultConfiguration section – Bryan Herbst Nov 20 '14 at 17:38
  • Yes I am. I dont see anything like this in my file, cant you please specify what exactly am I supposed to add? all I see are "dependencies" and "classpath" etc... – TomerZ Nov 20 '14 at 17:40
  • Where do you see the `StreamConfiguration` class in the documentation? I'm not seeing it. Perhaps it was in the L preview, but was removed for the final release? – Bryan Herbst Nov 20 '14 at 17:40
  • As for the compileSdkVersion, is sounds like you are looking in the project-level build.gradle. You should have a module-level build.gradle as well (in the /app folder by default) – Bryan Herbst Nov 20 '14 at 17:40
  • This is the map: https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html And as for StreamConfiguration, I got to it through the StreamConfigurationMap code... – TomerZ Nov 20 '14 at 17:42
  • Also I have compileSdkVersion set to 21 – TomerZ Nov 20 '14 at 17:48

1 Answers1

1

StreamConfigurationMap does not have a public constructor.

The android.hardware.camera2.params package does not expose the StreamConfiguration class. StreamConfigurationMapdoes allow you to use a StreamConfiguration to obtain a configuration- the configurations available are documented here.

The StreamConfiguration class and the StreamConfigurationMap constructor are hidden from the public Android API using the @hide annotation, so you cannot use them.

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
  • That class has an @hide annotation on it. That means it is not available for you to use it. See this SO question: http://stackoverflow.com/a/17056643/1253844 – Bryan Herbst Nov 20 '14 at 17:50
  • I see, thank you! please edit you answer accordingly so I can accept it :) – TomerZ Nov 20 '14 at 17:51