简体   繁体   English

如何通过处理在“ android模式”下运行“ spacebrew”?

[英]How to run 'spacebrew' in “android mode” from processing?

I am making an andriod app using 'andriod for processing lib" of processing (ie. running android mode in processing 2.0.3 and lauching it on my device). 我正在使用“ andriod处理lib”(即在处理2.0.3时运行android模式并在我的设备上启动它)制作一个andriod应用。

Spacebrew ( http://docs.spacebrew.cc ) is a easy to use web socket library for processing , also availabel as javascript. Spacebrew( http://docs.spacebrew.cc )是一个易于使用的Web套接字库,可以进行处理,也可以作为javascript使用。

if i run the spacebrew example codes in andriod mode, the app gets launched in my device but doesnt show up in my spacebrew admin. 如果我在andriod模式下运行spacebrew示例代码,则该应用会在我的设备中启动,但不会在我的spacebrew管理员中显示。 whereas if i run the same thing in my mac, it shows up correctly. 而如果我在Mac中运行相同的内容,则显示正确。 guess the websocket communication is not happening while using "andriod for processing". 猜想使用“ andriod进行处理”时没有发生websocket通信。 But this is the easiest way to use web sockets. 但这是使用Web套接字的最简单方法。 So can anyone help me figure out on how to make spacebrew work in processing (android mode) 所以谁能帮我弄清楚如何在处理中使用太空啤酒(android模式)

this is for my college project. 这是我的大学项目。 any suggestions on how to get this running please? 关于如何使此运行有任何建议吗? thankyou in advance 先感谢您

Thanks for pointing me to Spacebrew, didn't know about that! 感谢您将我指向“ Spacebrew”,对此一无所知!

I've just tested it from Android Mode and it does work, but there is a tiny quirk you might be missing out: permissions! 我刚刚在Android模式下对其进行了测试,它确实可以正常工作,但是您可能会错过一个小怪癖:权限!

Normally, if your app uses extra permissions, the application's manifest allows you to use these. 通常,如果您的应用使用了额外的权限,则应用的清单可允许您使用这些权限。 In Processing, that's also possible via Android > Sketch Permissions and in the case of Spacebrew, INTERNET is the permission you need enabled, as you can see below: 在处理中,也可以通过Android > Sketch Permissions来实现,对于Spacebrew,需要启用INTERNET权限,如下所示:

Android处理权限

I just a did a test myself and it seems to work just fine with the amazon hosted demo : 我自己做了一个测试,它与Amazon托管的演示程序一起正常工作: 太空按钮演示

Note that the Spacebrew Processing library uses the java websocket library, but only sets up a WsClient client. 请注意,Spacebrew处理库使用java websocket库,但仅设置WsClient客户端。 You can if you want use this jar in an Android SDK eclipse project and have your Android app act as a websockets server as well, not just a client (just in case this will become handy to you at some point in the future) 您可以在Android SDK eclipse项目中使用此jar,并让您的Android应用不仅充当客户端,还可以充当websockets服务器(以防万一将来会派上用场)

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

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