这是我的问题,我目前无法在调用捕获后使用来自 Camera2API 的静止捕获图像填充 3 个表面之一。我使用了 Google Camera2 Getting Started(需要链接)来设置样板,因此这段代码的大部分内容可能看起来很熟悉。
Camera2捕获状态:
每个请求将生成一个 CaptureResult 并为一个或多个目标 Surface 生成新帧,使用 CaptureRequest 构建器的 addTarget(Surface) 方法设置。目标表面(使用 addTarget(Surface) 设置)必须是创建此捕获会话时提供的表面的子集。
好的Android,我会遵守的
// in order to use a surface they must be registered when creating the session
List<Surface> surfaces = new ArrayList<>(previewSurfaces); //size + 1
surfaces.addAll(displaySurfaces); // size + 1
surfaces.add(mImageReader.getSurface()); //size + 1
try {
mCameraDevice.createCaptureSession(surfaces, mCaptureSessionCallback , null);
...
Run Code Online (Sandbox Code Playgroud)
然后这样做
// Add the display surfaces along with the internal image reader
captureBuilder.addTarget(mImageReader.getSurface());
for(Surface surface : this.displaySurfaces) …
Run Code Online (Sandbox Code Playgroud) 我想知道是否有人试图创建类似Windows手机提供(基于磁贴的UI)到Android应用程序的感觉.总的来说,我希望有一些"瓷砖"显示某些信息.当图块具有触摸事件时,图块将展开或开始另一活动或者向用户显示更多信息.如果API有任何导致也会很棒.
谢谢!
有没有人试图在App Engine之外的服务器上运行玻璃器皿,比如Tomcat?
我正在尝试使用玻璃器皿应用程序,我宁愿避免使用Google App Engine本身.我很难接近这个,我将使用Tomcat作为我的服务器.
任何帮助表示赞赏.谢谢.
我正在尝试导入队列,并且我继续获得以下内容
Traceback (most recent call last):
File "threading.py", line 2, in <module>
import Queue
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/Queue.py", line 5, in <module>
import threading as _threading
File "/Users/zaq/threading.py", line 10, in <module>
queue = Queue.Queue()
AttributeError: 'module' object has no attribute 'Queue'
Run Code Online (Sandbox Code Playgroud)
我在使用队列的python中使用链接Threading中的代码
另外,我可以在python解释器中导入和使用Queue.
我究竟做错了什么?
我需要一个额外的寄存器来存储 smali 方法中的字符串。我知道 smali 代码中的寄存器逻辑(请参阅https://github.com/JesusFreke/smali/wiki/Registers),但我仍然想知道如何归档寄存器的增加。
假设我有一个.locals n方法。现在我想要.locals n+1。首先,我想迭代该方法并向每个 v 寄存器添加 1(v0 -> v1,v1 -> v2)。那么 v0 将是我的新寄存器,我不会破坏任何现有数据。此外,我保持 p 和 v 寄存器之间的对齐。
不幸的是,这种简单的方法会导致无法编译代码。我不知道为什么。我错过了什么?
我想从一个类生成通知,Utilities.java
,的子类之外Context
。我也想过提供SingletonContext
类和已经看过帖子IKE此。我希望能够return != null
Context
反对,因为通知可以在任何给定时间生成,因为它是从messageReceived()
回调生成的。
做这样的事情有什么缺点:
public static Context c;
public class MainActivity extends Activity{
@Override
public void onStart()
super.onStart()
c = this.getApplicationContext();
}
//other method somewhere outside this class
public Context getContext(){
return MainActivity.c
}
Run Code Online (Sandbox Code Playgroud)
我认为这与将其放在 上没有任何不同onCreate()
,但是,它可以保证活动开始时上下文是最新的。