wearscript / wearscript-android Goto Github PK
View Code? Open in Web Editor NEWJavaScript with Batteries Included for Google Glass
Home Page: wearscript.com
JavaScript with Batteries Included for Google Glass
Home Page: wearscript.com
Should be doable just using an intent android.intent.action.CAMERA_BUTTON, we normally sense pictures using the preview image callback but this lets you get full sized frames.
Right now it sends them in a polling fashion
zxing allows us to scan many different kinds of 1D and 2D barcodes. Let's open that up to people and make WS.QR(callback)
an alias such as WS.barcode(callback, ["QR_CODE"])
This can be changed by the user just calling it again, but in the majority of instances you'd want to call it. I like having things be explicit but at the same time it may confuse people otherwise. It also would possibly reduce the iteration time for scripts because Glass doesn't have to reconnect.
People get confused when the wearscript apk fails to install when they're setting up initially. Let's just do an existence check for the file, or leave it out.
We need to document how signing works, including how to setup a new private key for your server and such.
The signer should check that
There should be an "upload but don't sign" button that skips this for temporary use of Gist. The reason for all this is that the signer isn't necessarily the original author, but they are attesting that they verified the script and will take the blame if it messes with someone's glass.
We already have QR support we just need to allow it to be used from wearscript
I know we can do it with adb
adb shell input keyevent 66
To use this easier you can use tools/glasskeyboard/monitor.py which simplifies the ADB commands and you can open it in a web browser remotely (and you can make your glass connect to adb wirelessly).
It's clearly possible because they do it when you tilt your head.
I think this is what most people want when they want to install and control a server, let's do that last step
https://github.com/mitchellh/vagrant-aws
Not sure what the syntax should be
// If view is hidden than implicitly call .shutdown() to close wearscript
WS.modeBackground()
// If activity opens, the service is already running, and this flag is set, don't scan QR code just reopen the last running app
WS.modeReentrant()
When alternating between launch, start, stop, and setup sometimes the mainactivity comes up when the selected activity should. This is likely because the activity is started without a create new flag of some sort.
tags: glass keyboard, feature request
To build the server you just use
sudo GOPATH="/home/vagrant/gopath" bash install.sh
WS.sensorOn(WS.sensors.accelerometer, .1)
10-05 21:35:29.230 2056-2916/? E/WearScript﹕ WS: Error!
java.net.SocketException: socket failed: EMFILE (Too many open files)
at libcore.io.IoBridge.socket(IoBridge.java:573)
at java.net.PlainSocketImpl.create(PlainSocketImpl.java:201)
at java.net.Socket.startupSocket(Socket.java:559)
at java.net.Socket.tryAllAddresses(Socket.java:127)
at java.net.Socket.<init>(Socket.java:177)
at java.net.Socket.<init>(Socket.java:149)
at javax.net.ssl.SSLSocket.<init>(SSLSocket.java:55)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.<init>(OpenSSLSocketImpl.java:122)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketFactoryImpl.createSocket(OpenSSLSocketFactoryImpl.java:64)
at com.codebutler.android_websockets.WebSocketClient$1.run(WebSocketClient.java:85)
at java.lang.Thread.run(Thread.java:856)
Caused by: libcore.io.ErrnoException: socket failed: EMFILE (Too many open files)
at libcore.io.Posix.socket(Native Method)
at libcore.io.BlockGuardOs.socket(BlockGuardOs.java:181)
at libcore.io.IoBridge.socket(IoBridge.java:558)
at java.net.PlainSocketImpl.create(PlainSocketImpl.java:201)
at java.net.Socket.startupSocket(Socket.java:559)
at java.net.Socket.tryAllAddresses(Socket.java:127)
at java.net.Socket.<init>(Socket.java:177)
at java.net.Socket.<init>(Socket.java:149)
at javax.net.ssl.SSLSocket.<init>(SSLSocket.java:55)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.<init>(OpenSSLSocketImpl.java:122)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketFactoryImpl.createSocket(OpenSSLSocketFactoryImpl.java:64)
at com.codebutler.android_websockets.WebSocketClient$1.run(WebSocketClient.java:85)
at java.lang.Thread.run(Thread.java:856)
10-05 21:35:29.230 2056-2914/? E/WearScript﹕ WS: Error!
java.net.SocketException: socket failed: EMFILE (Too many open files)
at libcore.io.IoBridge.socket(IoBridge.java:573)
at java.net.PlainSocketImpl.create(PlainSocketImpl.java:201)
at java.net.Socket.startupSocket(Socket.java:559)
at java.net.Socket.tryAllAddresses(Socket.java:127)
at java.net.Socket.<init>(Socket.java:177)
at java.net.Socket.<init>(Socket.java:149)
at javax.net.ssl.SSLSocket.<init>(SSLSocket.java:55)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.<init>(OpenSSLSocketImpl.java:122)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketFactoryImpl.createSocket(OpenSSLSocketFactoryImpl.java:64)
at com.codebutler.android_websockets.WebSocketClient$1.run(WebSocketClient.java:85)
at java.lang.Thread.run(Thread.java:856)
Caused by: libcore.io.ErrnoException: socket failed: EMFILE (Too many open files)
at libcore.io.Posix.socket(Native Method)
at libcore.io.BlockGuardOs.socket(BlockGuardOs.java:181)
at libcore.io.IoBridge.socket(IoBridge.java:558)
at java.net.PlainSocketImpl.create(PlainSocketImpl.java:201)
at java.net.Socket.startupSocket(Socket.java:559)
at java.net.Socket.tryAllAddresses(Socket.java:127)
at java.net.Socket.<init>(Socket.java:177)
at java.net.Socket.<init>(Socket.java:149)
at javax.net.ssl.SSLSocket.<init>(SSLSocket.java:55)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.<init>(OpenSSLSocketImpl.java:122)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketFactoryImpl.createSocket(OpenSSLSocketFactoryImpl.java:64)
at com.codebutler.android_websockets.WebSocketClient$1.run(WebSocketClient.java:85)
at java.lang.Thread.run(Thread.java:856)
Implement using a map with unique keys, add a defer to remove once the handler is done.
not sure if it will be better or worse to have it feel less like a webpage, but worth a try!
tags:glasskeyboard, featurerequest
10-05 22:03:07.517 3476-3840/com.dappervision.wearscript A/Looper﹕ Could not create epoll instance. errno=24
It's possible that if the app is reinstalled using ADB while using the camera that it gets locked. You have to restart the device.
We need a way to set if the cardscroll should get the events or if we want them. It is inconsistent now.
Specifically the install.sh.
Same as the other calls but recycles the existing webview
Brandyn got burned by the lastest "canary" update. Scott suggests having users select a more stable update channel when installing. The disadvantage is that some users may have already updated and even potentially have project structures that are not backwards compatible.
Can use this as a baseline
https://github.com/googleglass/apk-waveform-sample
The screen is 427x240 which is 2/3 what it should be
Should turn off service and finish() the activity
Should display the rate each sensor is being updated at (apparent value vs set value), change log to include the script iteration number. Along with #14 we will want to indicate to the user that we are in the BIOS (basically a hint that their script crashed). If connected to server we should send periodic updates about the state of the javascript.
right now you have to look at the source, hear from someone, or just randomly/accidentally press keys
Using the WS.wifi* commands you can get signal strength, MACs, and SSIDs. It should be fairly simple to make a JS library that can provide either relative positioning or (with calibration) absolute positioning.
I've tested basic existing code on Glass using NDK + OpenCV so now I need to port over the things we showed in the videos. It shouldn't be too difficult and once it is done we can use it on the phone/glass.
labels: glasskeyboard, bug
labels: glasskeyboard, featurerequest
This is useful when you have remote data coming in to be able to differentiate.
(1) single all-knowing dictionary for event names, event constants, key codes, android commands
will add more as comments
JSON is overly bulky, can't support binary (needs b64 which adds 30% overhead to images), and too slow. Here https://github.com/eishay/jvm-serializers/wiki is a Java benchmark of many ser/de libraries and msgpack is the fastest multi-language and self-describing encoding (only barely beaten by kryo and protostuff). This is also a good time to evaluate if the information we have in the format is all that is necessary (maybe leave out sensor names? look into better sensor timestamps?), if we want to add encryption, and if we want to add compression.
Similar to https://github.com/kaze0/winky/blob/master/src/com/mikedg/android/glass/winky/MainActivity.java
Can use stock eye sensor or our experimental one
https://plus.google.com/109113122718379096525/posts/CZ2psySiwDt
https://plus.google.com/109113122718379096525/posts/VEhzFjps2cn
e.g. playground refers to wearscript.com/colors.html
XE10 update causes 3rd party applications (zxing, opencv). Native preview works fine.
We want people to be able to run scripts directly in the browser as if they were on glass, and having to bring in and out a simulator dependency is messy.
WS.env
returns glass or browserSome operations like creating a new webview need to run on the UI thread, but it's not clear what that means if there is no activity and only the service is running.
For the OpenKinect project, I developed a system called Fakenect (on my personal site below but search for Fakenect) that allowed people to use recorded dumps of data from the Kinect. The reason was the device itself was expensive and of limited availability, but many people at universities in the US and basically anyone outside of the US wanted to work with it. Glass is in the same position due to the limited supply and distribution, a priority should be enabling people without glass to participate as much as possible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.