Taking picture without using camera application

I understand how to capture an image using intents and launching the camera app using intents, however I would like to know how to do so in the following steps: display surfaceview showing preview of camera to user when user presses capture, display captured image on screen to user and hide surfaceview with camera preview (exact same behaviour as snapchat). NP - I do not want the camera app

不使用相机应用拍摄照片

我了解如何使用意图捕捉图像并使用意图启动相机应用程序,但是我想知道如何在以下步骤中执行此操作: 显示表面视图,向用户显示相机的预览 当用户按下捕捉时,在屏幕上向用户显示拍摄的图像,并使用相机预览隐藏表面视图(与snapchat完全相同的行为)。 NP - 我不希望相机应用程序在此过程中的任何时候启动,我希望在我自己的应用程序中完成所有操作。 我当前的代码存在的问题是,当按下捕捉按钮时,它会启动相机应用程

Error while Parsing json into scala case class

In my spring(mvc) web application, I am using org.codehaus.jackson.map.ObjectMapper in my scala code to map my json to scala objects using case classes. My Json String is an array of json objects objects. so I am using: val user = mapper.readValue(myJson, classOf[List[MyClass]]) This line throws an error: Exception in thread "main" org.codehaus.jackson.map.JsonMappingException: Ca

将json解析为scala case类时出错

在我的spring(mvc)web应用程序中,我在我的scala代码中使用org.codehaus.jackson.map.ObjectMapper将我的json映射到使用case类的scala对象。 我的Json字符串是一个json对象数组。 所以我使用: val user = mapper.readValue(myJson, classOf[List[MyClass]]) 这行会引发一个错误: 线程“main”中的异常org.codehaus.jackson.map.JsonMappingException:无法构造scala.collection.immutable.List的实例,问题:抽象类型只

When do you use Java's @Override annotation and why?

What are the best practices for using Java's @Override annotation and why? It seems like it would be overkill to mark every single overridden method with the @Override annotation. Are there certain programming situations that call for using the @Override and others that should never use the @Override ? Use it every time you override a method for two benefits. Do it so that you can take

你什么时候使用Java的@Override注解,为什么?

使用Java的@Override注释的最佳实践是什么?为什么? 用@Override注解来标记每一个重写的方法似乎是过度的。 是否有某些编程情况需要使用@Override和其他不应使用@Override编程? 每次你重写一个方法有两个好处时使用它。 这样做是为了让你可以利用编译器检查来确保当你认为自己确实在重写某个方法时。 这样,如果您在拼写错误的方法名称或未正确匹配参数时犯了一个常见错误,您将被警告您的方法实际上并未按照您的想法覆

Can Java Annotations help me with this?

I'm wondering if there is a way to specify that a method gets called in advance of a class method. I know something like this should be posssible, since JUnit has before(), what I want to do is similar. Here is a concrete example of what I'd like to do class A { public void init(int a) { System.out.println(a); } @magic(arg=1) public void foo() { // } public static void

Java注释可以帮助我吗?

我想知道是否有方法来指定在类方法之前调用方法。 我知道这样的事情应该是可行的,因为JUnit之前有(),我想要做的是类似的。 这是我想要做的一个具体例子 class A { public void init(int a) { System.out.println(a); } @magic(arg=1) public void foo() { // } public static void main() { A a = new A(); a.foo(); } } //Output: 1 基本上我想要一个注释来告诉编译器或者在foo()之前调用jvm

Adding EJB interceptors with custom annotations

I have a number of EJB3.0 interceptors that require additional configuration. So far I have been simply adding the interceptors via @Interceptors( { MyInterceptor.class } ) and then added a second, custom annotation like @MyInterceptorConfiguration(value=something) . This is rather tedious though. Is it possible to annotate a custom annotation so that it will trigger the addition of an Interc

使用自定义注释添加EJB拦截器

我有一些需要额外配置的EJB3.0拦截器。 到目前为止,我一直只是通过@Interceptors( { MyInterceptor.class } )添加拦截器,然后添加第二个自定义注释,如@MyInterceptorConfiguration(value=something) 。 这虽然很乏味。 是否可以注释一个自定义注释,以便它会触发添加一个拦截器? 理想情况下,我想添加@DoMyInterception(config=foo)到一个类,并添加我的拦截器。 这仅适用于EE 6(EJB 3.1)中的CDI构造型注释(请参阅拦

glassfish 4.1 and cluster with JMS

I have create the cluster "mycluster", two local instance and the resources jms/Queue1, jms/Queue2 and jms/Topic with target server and cluster. So in this way I created the cluster: create-cluster mycluster create-instance --node localhost-domain1 --cluster mycluster instance01 create-instance --node localhost-domain1 --cluster mycluster instance02 [...] start-cluster myclu

glassfish 4.1和JMS集群

我用目标服务器和集群创建了集群“mycluster”,两个本地实例和资源jms / Queue1,jms / Queue2和jms / Topic。 所以这样我创建了集群: 创建群集mycluster create-instance --node localhost-domain1 --cluster mycluster instance01 create-instance --node localhost-domain1 --cluster mycluster instance02 [...] 启动集群mycluster 部署--target mycluster Coo.ear 应用程序以名称Coo部署。 警告:命令_de

Anyone experience PCI Compliance scan create errors in application server?

I'm running GlassFish 3.1.2 behind Apache 2.4.10 web server and mod_jk on CentOS 6 Linux server. I've observed PCI Compliance scans consistently create errors in the GlassFish server.log file, which cause my web app running in GlassFish to become unavailable (file not found). Basically, the web app dies, but the domain continues to run, although it continuously generates errors from tha

任何人都会遇到PCI合规性扫描在应用程序服务器上创建错

我在Apache 2.4.10 Web服务器后运行GlassFish 3.1.2,在CentOS 6 Linux服务器上运行mod_jk。 我观察到PCI合规性扫描一直在GlassFish server.log文件中创建错误,这会导致我在GlassFish中运行的Web应用程序变得不可用(未找到文件)。 基本上,该网络应用程序会死亡,但该域继续运行,尽管它从这一点持续产生错误。 任何人都可以证实这是已知的行为? 如果是这样,有没有已知的解决方法? 或者,是运行PCI合规性扫描所需的

JSP: can't figure out how to set UTF

I'm using GlassFish 3.1.2 and seeing the following warning whenever I access my JSP pages: PWC4011: Unable to set request character encoding to UTF-8 from context /myapp, because request parameters have already been read, or ServletRequest.getReader() has already been called My JSP files start with: <%@page pageEncoding="UTF-8"%> My WEB-INF/glassfish-web.xml file is: <?xml ver

JSP:无法弄清楚如何设置UTF

我使用GlassFish 3.1.2并在访问我的JSP页面时看到以下警告: PWC4011:由于请求参数已被读取,或者ServletRequest.getReader()已被调用 我的JSP文件从以下开始: <%@page pageEncoding="UTF-8"%> 我的WEB-INF/glassfish-web.xml文件是: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://

Glassfish so many FileNotFoundException on server startup

I have an ear file. I start my glassfish domain and deploy using an ide (IDEA or eclipse). On server start up when I check the logs I see a FileNotFoundException for I believe each and every dependency we have on the project. Sample : java.io.FileNotFoundException: C:Developerweb-serverglassfish3.1.2glassfishdomainsdomain1applicationsAYDEMPANOTEST-EAR.earspring-beans-3.2.0.RELEASE.jar (The

Glassfish在服务器启动时有很多FileNotFoundException

我有一个耳朵文件。 我启动我的glassfish域并使用ide(IDEA或eclipse)进行部署。 在服务器启动时,当我检查日志时,我看到FileNotFoundException,因为我相信我们对项目有每个依赖项。 示例: java.io.FileNotFoundException:C: Developer web-server glassfish3.1.2 glassfish domains domain1 applications AYDEMPANOTEST-EAR.ear spring-beans-3.2.0.RELEASE.jar(系统找不到文件指定) 我使用maven进行依

Errors when deploying Liferay 6.0.6 on Glassfish 3.1.1

I'm trying to deploy Liferay 6.0.6 on an already existing Glassfish 3.1.1 installation. I have followed the Liferay Administration Guide perfectly and while I can deploy the war, it doesn't do it right. Here is how the log looks when I deploy: [#|2011-11-10T11:32:33.056+0100|WARNING|glassfish3.1.1|org.apache.catalina.connector.Request|_ThreadID=95;_ThreadName=admin-thread-pool-4848(2

在Glassfish 3.1.1上部署Liferay 6.0.6时出错

我正试图在现有的Glassfish 3.1.1安装上部署Liferay 6.0.6。 我完全遵循了“救生员管理指南”,虽然我可以部署这场战争,但它并没有做到这一点。 以下是部署时日志的外观: [#| 2011-11-10T11:32:33.056 + 0100 |警告| glassfish3.1.1 | org.apache.catalina.connector.Request | _ThreadID = 95; _ThreadName =管理线程池-4848(2); | PWC4011 :由于请求参数已被读取,或ServletRequest.getReader()已被调用|#],所