You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Ross Gerbasi <rg...@gmail.com> on 2013/12/24 04:43:44 UTC

Google Glass Support

Hello All,

I have been working on Google Glass support for Cordova and hit a wall. I
am looking for some guidance/advice on how to proceed. There are a couple
things that I need to deal with but I will start with just creating the
proper project. I have a feeling this will not only be about google glass
but a issue we will come across later.

Essentially in order to make this happen I need to modify
AndroidManifest.xml and add some resources to the project. Ideally This
would be a custom template of some kind for an android project. Possibly
running a command like "cordova platform add android glass". The other
option is to just modify the existing android project after it has been
added, this seems messy though and a problem if the user trashes the
android project they have to remember to run whatever command modifies the
project for glass again.

Once I am able to get a basic project together for Glass the next thing is
events. In order to get touch pad events into the webview it requires a bit
of tweaking, so I need some java code to handle this. I am not sure if this
should be a plugin or not. It seems like it should not be a plugin as it
really is essential for the project to even really work. I could then see
voice as a plugin?

Currently I am planning on making a 3rd party node package that you would
run against your project. Something like "cordova-glass __VOICE_TRIGGER__",
that would then check for an android project, create it if needed, then
modify it for glass. It would add the voice trigger to start your app and
such. If it already exists it will just make the tweaks needed. This will
at least get the ball rolling and allow people to start building apps
pretty easily, then maybe we can find a more efficient way to create the
project for users?

Anyways I would love for anyone to chime in, I will be cranking away on
this but any ideas would be greatly appreciated.

-ross

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
Woah what! haha there is a 4th parameter for custom template!?! is there
any info on how to use this? Any chance this can be a github URL that it
would pull from? If not what should this folder look like? Should it be
like this folder here (
https://github.com/apache/cordova-android/tree/master/bin/templates/project)
or one if its parents? That could be a great solution right there...

I would like to use plugins all around but I need to totally change the
Intent, and I do not think I can do that via a plugin?

The tweaks are minimal for sure, it runs android apps, but I need to change
up the theme, and to launch the app you use a voice trigger so I need to
modify intents & theme in AndroidMainifest.xml. Lastly I need some extra
Java files to properly pass through the touch events from the frames.

I already have everything working, cordova app, touch event plugin, etc
etc. I just need to clean this up into a package that is very easy for
people to use. Ideally I want this to work via the CLI.




On Mon, Dec 23, 2013 at 9:56 PM, Andrew Grieve <ag...@chromium.org> wrote:

> Neat stuff!
>
> If possible, it would definitely be neat to make glass work more
> out-of-the-box with Cordova. I'm totally unfamiliar with what tweaks are
> necessary to make it work though.
>
> One thing that's possible already is to use a custom template. This is the
> 4th parameter to the create command - a path to a directory to use as the
> project template.
>
> Would be awesome if all of the tweaks could be done via a cordova plugin.
> Plugins have the <config-file> tag, which allows you to edit XML (although
> limited) on plugin install time.
>
> Andrew
>
>
> On Mon, Dec 23, 2013 at 10:43 PM, Ross Gerbasi <rg...@gmail.com> wrote:
>
> > Hello All,
> >
> > I have been working on Google Glass support for Cordova and hit a wall. I
> > am looking for some guidance/advice on how to proceed. There are a couple
> > things that I need to deal with but I will start with just creating the
> > proper project. I have a feeling this will not only be about google glass
> > but a issue we will come across later.
> >
> > Essentially in order to make this happen I need to modify
> > AndroidManifest.xml and add some resources to the project. Ideally This
> > would be a custom template of some kind for an android project. Possibly
> > running a command like "cordova platform add android glass". The other
> > option is to just modify the existing android project after it has been
> > added, this seems messy though and a problem if the user trashes the
> > android project they have to remember to run whatever command modifies
> the
> > project for glass again.
> >
> > Once I am able to get a basic project together for Glass the next thing
> is
> > events. In order to get touch pad events into the webview it requires a
> bit
> > of tweaking, so I need some java code to handle this. I am not sure if
> this
> > should be a plugin or not. It seems like it should not be a plugin as it
> > really is essential for the project to even really work. I could then see
> > voice as a plugin?
> >
> > Currently I am planning on making a 3rd party node package that you would
> > run against your project. Something like "cordova-glass
> __VOICE_TRIGGER__",
> > that would then check for an android project, create it if needed, then
> > modify it for glass. It would add the voice trigger to start your app and
> > such. If it already exists it will just make the tweaks needed. This will
> > at least get the ball rolling and allow people to start building apps
> > pretty easily, then maybe we can find a more efficient way to create the
> > project for users?
> >
> > Anyways I would love for anyone to chime in, I will be cranking away on
> > this but any ideas would be greatly appreciated.
> >
> > -ross
> >
>

Re: Google Glass Support

Posted by Axel Nennker <ig...@gmail.com>.
          Intent intent =
context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());

          intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
          // set some extras
          context.startActivity(intent);




2013/12/24 Ross Gerbasi <rg...@gmail.com>

> You are correct, the idea of changing an attribute was a bad one. I am not
> doing that anymore, I am following what you were doing now with a separate
> activity. Can you paste in a code snippet from your "CordovaGlassActivity"
> where you use getLaunchIntentForPackage to launch the users main activity?
>
> thanks!
>
>
> On Tue, Dec 24, 2013 at 9:29 AM, Axel Nennker <ig...@gmail.com>wrote:
>
>> Why do you need the attribute to be changed?
>> If you use a separate activity you can set all the attributes you want on
>> it; like the nohistory=true in my example
>> I start the "main" cordova activity through getLaunchIntentForPackage
>> As a class inheriting from CordovaPlugin you get all the OS messages:
>> GoogleGlassPlugin::onNewIntent
>>
>> Could you upload your plugin code to e.g.
>> https://github.com/rgerbasi/cordova-googleglass-plugin
>>
>> -Axel
>>
>>
>>
>>
>>
>>
>> 2013/12/24 Ross Gerbasi <rg...@gmail.com>
>>
>>> Alright nevermind on the variable thing. this is starting to shape up.
>>> you
>>> can run it like this
>>>
>>> cordova plugin add ~/Desktop/Google\ Glass\
>>> Cordova/dev/cordova-glass-core/
>>> --variable VOICE_COMMAND='wazzup cordova'
>>>
>>> Still need a way to modify an attribute or get the android:name...
>>>
>>>
>>> On Tue, Dec 24, 2013 at 8:38 AM, Ross Gerbasi <rg...@gmail.com>
>>> wrote:
>>>
>>> > Ok progress on all this, creating the resource files was actually
>>> really
>>> > easy, also modifying the manifest is working great. The only thing
>>> left is
>>> > trying to either modify an attribute of a config file or having access
>>> to
>>> > the value of android:name= on the existing activity. Anyone have any
>>> ideas
>>> > on how I could do either of those things?
>>> >
>>> > Lastly is there anyway to pass in a variable that plugin XML can use? I
>>> > would like the user to be able to do something like cordova plugin add
>>> > [URL] [VOICE_COMMAND]  where voice command is the string they wish to
>>> say
>>> > to open the application. Any ideas? thanks!
>>> >
>>> > Also chime in on the name of this plugin if you have any opinion :)
>>> >
>>> >
>>> >
>>> > On Tue, Dec 24, 2013 at 8:22 AM, Ross Gerbasi <rg...@gmail.com>
>>> wrote:
>>> >
>>> >> I really do like the idea of using the plugin XML, I think Axel has a
>>> >> good start but as mentioned is there a way to handle xml resources
>>> via a
>>> >> plugin? I need to copy a couple files (or write some xml) into the
>>> >> resources folder then I also need to make an addition to strings.xml
>>> in the
>>> >> values resources.
>>> >>
>>> >> Lastly it would be nice to be able to add the intent to an existing
>>> >> activity instead of having to create an activity just for glass. The
>>> >> template for android already has the activity I wish to run I just
>>> need to
>>> >> change the intent for it. Otherwise is there anyway to get the name
>>> of the
>>> >> current activity for use in my own?
>>> >>
>>> >> I guess it would be nice if the plugin could have more then just
>>> >> plugin.xml, possible a node script that also ran that would allow me
>>> to
>>> >> actually do modifications myself?
>>> >>
>>> >> Finally if I do go through with the plugin setup what do you all think
>>> >> about names for these plugins. Should it be something like
>>> >> cordova-glass-core which then opens the potential to have
>>> >> cordova-glass-voice, cordova-glass-camera, etc?
>>> >>
>>> >> Dan - I already have a working hook, but it all feels dirty. It is an
>>> >> after_platform_add hook that then modifies your android project. It
>>> just
>>> >> doesn't feel clean doing it this way, a plugin would be much nicer.
>>> >>
>>> >> -ross
>>> >>
>>> >>
>>> >> On Tue, Dec 24, 2013 at 7:05 AM, Dan Moore <mo...@yahoo.com>
>>> wrote:
>>> >>
>>> >>> Hi Ross.
>>> >>>
>>> >>> Wow, this will be really cool!
>>> >>>
>>> >>> You can manipulate the Android manifest and listen for intents with a
>>> >>> plugin.  See this example plugin.xml that does so:
>>> >>>
>>> https://github.com/8zrealestate/android-referrer-plugin/blob/master/plugin.xml
>>> >>>
>>> >>> Some of the limits of plugins right now (unless things have radically
>>> >>> changed since I looked at them in Cordova 3.0):
>>> >>> * you cannot remove nodes from an xml file
>>> >>> * you cannot change values or attributes of xml file nodes
>>> >>> * you can't modify any other kind of file.
>>> >>>
>>> >>> If you need to do any of the above kind of file manipulation, you
>>> should
>>> >>> use a hook.  But I don't know a way to include a hook into a plugin.
>>> >>>
>>> >>> --
>>> >>> Dan Moore
>>> >>> https://leanpub.com/developingwithcordovacli/
>>> >>>
>>> >>>
>>> >>
>>> >
>>>
>>
>>
>

Re: Google Glass Support

Posted by Axel Nennker <ig...@gmail.com>.
Why do you need the attribute to be changed?
If you use a separate activity you can set all the attributes you want on
it; like the nohistory=true in my example
I start the "main" cordova activity through getLaunchIntentForPackage
As a class inheriting from CordovaPlugin you get all the OS messages:
GoogleGlassPlugin::onNewIntent

Could you upload your plugin code to e.g.
https://github.com/rgerbasi/cordova-googleglass-plugin

-Axel






2013/12/24 Ross Gerbasi <rg...@gmail.com>

> Alright nevermind on the variable thing. this is starting to shape up. you
> can run it like this
>
> cordova plugin add ~/Desktop/Google\ Glass\ Cordova/dev/cordova-glass-core/
> --variable VOICE_COMMAND='wazzup cordova'
>
> Still need a way to modify an attribute or get the android:name...
>
>
> On Tue, Dec 24, 2013 at 8:38 AM, Ross Gerbasi <rg...@gmail.com> wrote:
>
> > Ok progress on all this, creating the resource files was actually really
> > easy, also modifying the manifest is working great. The only thing left
> is
> > trying to either modify an attribute of a config file or having access to
> > the value of android:name= on the existing activity. Anyone have any
> ideas
> > on how I could do either of those things?
> >
> > Lastly is there anyway to pass in a variable that plugin XML can use? I
> > would like the user to be able to do something like cordova plugin add
> > [URL] [VOICE_COMMAND]  where voice command is the string they wish to say
> > to open the application. Any ideas? thanks!
> >
> > Also chime in on the name of this plugin if you have any opinion :)
> >
> >
> >
> > On Tue, Dec 24, 2013 at 8:22 AM, Ross Gerbasi <rg...@gmail.com>
> wrote:
> >
> >> I really do like the idea of using the plugin XML, I think Axel has a
> >> good start but as mentioned is there a way to handle xml resources via a
> >> plugin? I need to copy a couple files (or write some xml) into the
> >> resources folder then I also need to make an addition to strings.xml in
> the
> >> values resources.
> >>
> >> Lastly it would be nice to be able to add the intent to an existing
> >> activity instead of having to create an activity just for glass. The
> >> template for android already has the activity I wish to run I just need
> to
> >> change the intent for it. Otherwise is there anyway to get the name of
> the
> >> current activity for use in my own?
> >>
> >> I guess it would be nice if the plugin could have more then just
> >> plugin.xml, possible a node script that also ran that would allow me to
> >> actually do modifications myself?
> >>
> >> Finally if I do go through with the plugin setup what do you all think
> >> about names for these plugins. Should it be something like
> >> cordova-glass-core which then opens the potential to have
> >> cordova-glass-voice, cordova-glass-camera, etc?
> >>
> >> Dan - I already have a working hook, but it all feels dirty. It is an
> >> after_platform_add hook that then modifies your android project. It just
> >> doesn't feel clean doing it this way, a plugin would be much nicer.
> >>
> >> -ross
> >>
> >>
> >> On Tue, Dec 24, 2013 at 7:05 AM, Dan Moore <mo...@yahoo.com> wrote:
> >>
> >>> Hi Ross.
> >>>
> >>> Wow, this will be really cool!
> >>>
> >>> You can manipulate the Android manifest and listen for intents with a
> >>> plugin.  See this example plugin.xml that does so:
> >>>
> https://github.com/8zrealestate/android-referrer-plugin/blob/master/plugin.xml
> >>>
> >>> Some of the limits of plugins right now (unless things have radically
> >>> changed since I looked at them in Cordova 3.0):
> >>> * you cannot remove nodes from an xml file
> >>> * you cannot change values or attributes of xml file nodes
> >>> * you can't modify any other kind of file.
> >>>
> >>> If you need to do any of the above kind of file manipulation, you
> should
> >>> use a hook.  But I don't know a way to include a hook into a plugin.
> >>>
> >>> --
> >>> Dan Moore
> >>> https://leanpub.com/developingwithcordovacli/
> >>>
> >>>
> >>
> >
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
Alright nevermind on the variable thing. this is starting to shape up. you
can run it like this

cordova plugin add ~/Desktop/Google\ Glass\ Cordova/dev/cordova-glass-core/
--variable VOICE_COMMAND='wazzup cordova'

Still need a way to modify an attribute or get the android:name...


On Tue, Dec 24, 2013 at 8:38 AM, Ross Gerbasi <rg...@gmail.com> wrote:

> Ok progress on all this, creating the resource files was actually really
> easy, also modifying the manifest is working great. The only thing left is
> trying to either modify an attribute of a config file or having access to
> the value of android:name= on the existing activity. Anyone have any ideas
> on how I could do either of those things?
>
> Lastly is there anyway to pass in a variable that plugin XML can use? I
> would like the user to be able to do something like cordova plugin add
> [URL] [VOICE_COMMAND]  where voice command is the string they wish to say
> to open the application. Any ideas? thanks!
>
> Also chime in on the name of this plugin if you have any opinion :)
>
>
>
> On Tue, Dec 24, 2013 at 8:22 AM, Ross Gerbasi <rg...@gmail.com> wrote:
>
>> I really do like the idea of using the plugin XML, I think Axel has a
>> good start but as mentioned is there a way to handle xml resources via a
>> plugin? I need to copy a couple files (or write some xml) into the
>> resources folder then I also need to make an addition to strings.xml in the
>> values resources.
>>
>> Lastly it would be nice to be able to add the intent to an existing
>> activity instead of having to create an activity just for glass. The
>> template for android already has the activity I wish to run I just need to
>> change the intent for it. Otherwise is there anyway to get the name of the
>> current activity for use in my own?
>>
>> I guess it would be nice if the plugin could have more then just
>> plugin.xml, possible a node script that also ran that would allow me to
>> actually do modifications myself?
>>
>> Finally if I do go through with the plugin setup what do you all think
>> about names for these plugins. Should it be something like
>> cordova-glass-core which then opens the potential to have
>> cordova-glass-voice, cordova-glass-camera, etc?
>>
>> Dan - I already have a working hook, but it all feels dirty. It is an
>> after_platform_add hook that then modifies your android project. It just
>> doesn't feel clean doing it this way, a plugin would be much nicer.
>>
>> -ross
>>
>>
>> On Tue, Dec 24, 2013 at 7:05 AM, Dan Moore <mo...@yahoo.com> wrote:
>>
>>> Hi Ross.
>>>
>>> Wow, this will be really cool!
>>>
>>> You can manipulate the Android manifest and listen for intents with a
>>> plugin.  See this example plugin.xml that does so:
>>> https://github.com/8zrealestate/android-referrer-plugin/blob/master/plugin.xml
>>>
>>> Some of the limits of plugins right now (unless things have radically
>>> changed since I looked at them in Cordova 3.0):
>>> * you cannot remove nodes from an xml file
>>> * you cannot change values or attributes of xml file nodes
>>> * you can't modify any other kind of file.
>>>
>>> If you need to do any of the above kind of file manipulation, you should
>>> use a hook.  But I don't know a way to include a hook into a plugin.
>>>
>>> --
>>> Dan Moore
>>> https://leanpub.com/developingwithcordovacli/
>>>
>>>
>>
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
Ok progress on all this, creating the resource files was actually really
easy, also modifying the manifest is working great. The only thing left is
trying to either modify an attribute of a config file or having access to
the value of android:name= on the existing activity. Anyone have any ideas
on how I could do either of those things?

Lastly is there anyway to pass in a variable that plugin XML can use? I
would like the user to be able to do something like cordova plugin add
[URL] [VOICE_COMMAND]  where voice command is the string they wish to say
to open the application. Any ideas? thanks!

Also chime in on the name of this plugin if you have any opinion :)



On Tue, Dec 24, 2013 at 8:22 AM, Ross Gerbasi <rg...@gmail.com> wrote:

> I really do like the idea of using the plugin XML, I think Axel has a good
> start but as mentioned is there a way to handle xml resources via a plugin?
> I need to copy a couple files (or write some xml) into the resources folder
> then I also need to make an addition to strings.xml in the values
> resources.
>
> Lastly it would be nice to be able to add the intent to an existing
> activity instead of having to create an activity just for glass. The
> template for android already has the activity I wish to run I just need to
> change the intent for it. Otherwise is there anyway to get the name of the
> current activity for use in my own?
>
> I guess it would be nice if the plugin could have more then just
> plugin.xml, possible a node script that also ran that would allow me to
> actually do modifications myself?
>
> Finally if I do go through with the plugin setup what do you all think
> about names for these plugins. Should it be something like
> cordova-glass-core which then opens the potential to have
> cordova-glass-voice, cordova-glass-camera, etc?
>
> Dan - I already have a working hook, but it all feels dirty. It is an
> after_platform_add hook that then modifies your android project. It just
> doesn't feel clean doing it this way, a plugin would be much nicer.
>
> -ross
>
>
> On Tue, Dec 24, 2013 at 7:05 AM, Dan Moore <mo...@yahoo.com> wrote:
>
>> Hi Ross.
>>
>> Wow, this will be really cool!
>>
>> You can manipulate the Android manifest and listen for intents with a
>> plugin.  See this example plugin.xml that does so:
>> https://github.com/8zrealestate/android-referrer-plugin/blob/master/plugin.xml
>>
>> Some of the limits of plugins right now (unless things have radically
>> changed since I looked at them in Cordova 3.0):
>> * you cannot remove nodes from an xml file
>> * you cannot change values or attributes of xml file nodes
>> * you can't modify any other kind of file.
>>
>> If you need to do any of the above kind of file manipulation, you should
>> use a hook.  But I don't know a way to include a hook into a plugin.
>>
>> --
>> Dan Moore
>> https://leanpub.com/developingwithcordovacli/
>>
>>
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
So Glass support is in a good place right now, here is what I came up with.

Google Glass Core - Adds Voice Trigger and Prompts results to application
launching. Essentially makes your android app "Glass" friendly.
https://github.com/aphex/cordova-glass-core

Google Glass Touch - Adds Basic touchstart & touchend from the touchpad to
the application. This is helpful as frameworks (like sencha touch) do there
own gesture detection based on these events.
https://github.com/aphex/cordova-glass-touch

Google Glass Gesture - After looking over Joe's code I realized there are a
lot of other applications out there that will want native gestures instead
of JS interpreted ones. So this plugin adds all the gestures from the
touchpad to the webview. This is the only plugin that required the Google
Glass SDK, and this posed a problem. i could not find a good way to use the
google glass SDK with my Cordova project. I will explain below.
https://github.com/aphex/cordova-glass-gesture

Barcode Scanner - I have forked and modified the barcode scanner plugin to
properly work with Google Glass. Its hacky but using it is pretty awesome :)
https://github.com/aphex/BarcodeScanner

Again its worth noting that all the existing 'backbutton' even logic just
works with google glass. A Swipe down will trigger that event if you have a
listener.


*Google Glass SDK Issue. *

In order to use the Google Glass SDK properly there are a few options

First during the build process the target of project.properties should be
"Google Inc.:Glass Development Kit Sneak Peek:15". Currently if you attempt
to change the target of a cordova project to that the CLI will break as it
is not able to properly parse this. The issue is found in
{app}/platforms/android/cordova/lib/check_reqs.js inside the get_target
function. Error is on line 39 as of writing this. Target will be null and
throw an error as the grep does not properly account for this. Even if we
were able to fix this issue there does not seem to be a way for a plugin to
change the target of project.properties anyway. So this would have to be
manual, and annoying.

Second is to link to the Google SDK jar file in the SDK folder, this can be
found in {ANDROID_SDK}/add-ons/addon-google_gdk-google-15/libs. I was not
able to find a way to get a plugin to link up a jar though. If anyone knows
how to do this, please chime in. I tried doing jar.libs.dir in my
local.properties file but that did not seem to work, I also worry if it did
I would lose any jar files in my projects libs folder. So specifying
another path to look for a jar file seems to be difficult, any ideas would
be appreciated.

Third (and my current solution) is to include the Google Glass jar with my
plugin. So I have the gdk.jar file included with my plugin and then that
file is copied into the android projects libs folder. This is not ideal as
I really should be using the one provided by the SDK. I figure due to the
fact that this is all alpha at this point anyway there is not a lot of fuss
needed. I am assuming at some point we will be able to target glass
normally using project.properties and a normal android target like
android-20 or something. If anyone has a major beef with this I am all for
alternatives, but for now this was the quick and easy way to handle this.

Anyways I am working up some videos and demos on how to use all this.
Figuring out a good way to film what is being seen on Glass is a tough one,
but I have some ideas :) Also have a few Sencha Touch components in the
works that are glass specific. We are likely doing an article for our
January newsletter on all this jazz, should be good.

Oh and if anyone cares to have them here are the Chrome emulation settings
for Glass

Screen
Res: 640x360
DPR: 1
font Scale: 1
[x] Emulate Viewport
[x] Enable Text Autosize
[ ] Shrink to fit
[ ] css media

User Agent:
Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Glass 1 Build/IMM76L; XE12)
AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

Sensors
[x] Emulate touch screen






On Wed, Dec 25, 2013 at 2:49 PM, Ross Gerbasi <rg...@gmail.com> wrote:

> Annddd... I'm an idiot. I do not know why I doubt cordova's awesomeness
> before I jump into things. Adding a back button listener required no
> updates to any of the code at all. It just simply works, add the listener
> in JS and the glass app doesn't exit it dispatches a backbutton event.
> Simple.
>
>
> On Wed, Dec 25, 2013 at 2:29 PM, Ross Gerbasi <rg...@gmail.com> wrote:
>
>> Alrighty, more info, swipe_down default has been controlled the same way
>> the back button is for normal android. If you have a backbutton listener it
>> will bind the swipe down and dispatch a backbutton event instead of exiting
>> the app. This should work for users to navigate around :)
>>
>> Now I need to find a way to apply what I have done via my touch plugin
>> instead of modifications to the main activity... so moving along...
>>
>>
>> On Wed, Dec 25, 2013 at 1:39 PM, Ross Gerbasi <rg...@gmail.com> wrote:
>>
>>> Swipe down actually appears to be more of a key up event. Going down
>>> this road to try to cancel it.
>>>
>>>
>>> On Wed, Dec 25, 2013 at 1:02 PM, Ross Gerbasi <rg...@gmail.com>wrote:
>>>
>>>> I haven't been able to find a way to prevent the SWIPE_DOWN event from
>>>> closing the app, Joe you happen to dig into this? We really need swipe down
>>>> dispatched on the webview. Any ideas?
>>>>
>>>>
>>>> On Tue, Dec 24, 2013 at 3:36 PM, Ross Gerbasi <rg...@gmail.com>wrote:
>>>>
>>>>> Thanks Brian will do.
>>>>>
>>>>> For now I only know that of the XML for voice trigger. I will look
>>>>> into coding it into a plugin. Great idea.
>>>>> On Dec 24, 2013 4:04 PM, "Brian LeRoux" <b...@brian.io> wrote:
>>>>>
>>>>>> I could see something like this graduating to 'core' plugin status if
>>>>>> it
>>>>>> gets popular enough (and you are into it) Ross. For now, as Joe says,
>>>>>> let
>>>>>> it bake under your personal brand and feel free to enlist our help. :)
>>>>>> On Dec 25, 2013 5:52 AM, "Ross Gerbasi" <rg...@gmail.com> wrote:
>>>>>>
>>>>>> > Copy that.
>>>>>> >
>>>>>> > Thanks
>>>>>> > On Dec 24, 2013 11:22 AM, "Joe Bowser" <bo...@gmail.com> wrote:
>>>>>> >
>>>>>> > > They should go into your own package. I really shouldn't have used
>>>>>> > > org.apache.cordova.glass.
>>>>>> > >
>>>>>> > > On Tue, Dec 24, 2013 at 9:20 AM, Ross Gerbasi <rgerbasi@gmail.com
>>>>>> >
>>>>>> > wrote:
>>>>>> > > > Also should I put these into my own package like
>>>>>> > > > com.rossgerbasi.cordova.glass or should they go into
>>>>>> > > > org.apache.cordova.glass ?
>>>>>> > > >
>>>>>> > > > thanks!
>>>>>> > > >
>>>>>> > > >
>>>>>> > > > On Tue, Dec 24, 2013 at 11:13 AM, Ross Gerbasi <
>>>>>> rgerbasi@gmail.com>
>>>>>> > > wrote:
>>>>>> > > >>
>>>>>> > > >> Well hot damn, maybe i won't need to then. thanks for the
>>>>>> heads up.
>>>>>> > > >>
>>>>>> > > >>
>>>>>> > > >> On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <
>>>>>> bowserj@gmail.com>
>>>>>> > wrote:
>>>>>> > > >>>
>>>>>> > > >>> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <
>>>>>> rgerbasi@gmail.com>
>>>>>> > > wrote:
>>>>>> > > >>> >
>>>>>> > > >>> > Finally if I do go through with the plugin setup what do
>>>>>> you all
>>>>>> > > think
>>>>>> > > >>> > about names for these plugins. Should it be something like
>>>>>> > > >>> > cordova-glass-core which then opens the potential to have
>>>>>> > > >>> > cordova-glass-voice, cordova-glass-camera, etc?
>>>>>> > > >>> >
>>>>>> > > >>>
>>>>>> > > >>> The Camera and the Voice Recognition in Google Glass use the
>>>>>> exact
>>>>>> > > >>> same intents and code as Android.  I don't see why you would
>>>>>> want to
>>>>>> > > >>> make them glass specific.
>>>>>> > > >>
>>>>>> > > >>
>>>>>> > > >
>>>>>> > >
>>>>>> >
>>>>>>
>>>>>
>>>>
>>>
>>
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
Annddd... I'm an idiot. I do not know why I doubt cordova's awesomeness
before I jump into things. Adding a back button listener required no
updates to any of the code at all. It just simply works, add the listener
in JS and the glass app doesn't exit it dispatches a backbutton event.
Simple.


On Wed, Dec 25, 2013 at 2:29 PM, Ross Gerbasi <rg...@gmail.com> wrote:

> Alrighty, more info, swipe_down default has been controlled the same way
> the back button is for normal android. If you have a backbutton listener it
> will bind the swipe down and dispatch a backbutton event instead of exiting
> the app. This should work for users to navigate around :)
>
> Now I need to find a way to apply what I have done via my touch plugin
> instead of modifications to the main activity... so moving along...
>
>
> On Wed, Dec 25, 2013 at 1:39 PM, Ross Gerbasi <rg...@gmail.com> wrote:
>
>> Swipe down actually appears to be more of a key up event. Going down this
>> road to try to cancel it.
>>
>>
>> On Wed, Dec 25, 2013 at 1:02 PM, Ross Gerbasi <rg...@gmail.com> wrote:
>>
>>> I haven't been able to find a way to prevent the SWIPE_DOWN event from
>>> closing the app, Joe you happen to dig into this? We really need swipe down
>>> dispatched on the webview. Any ideas?
>>>
>>>
>>> On Tue, Dec 24, 2013 at 3:36 PM, Ross Gerbasi <rg...@gmail.com>wrote:
>>>
>>>> Thanks Brian will do.
>>>>
>>>> For now I only know that of the XML for voice trigger. I will look into
>>>> coding it into a plugin. Great idea.
>>>> On Dec 24, 2013 4:04 PM, "Brian LeRoux" <b...@brian.io> wrote:
>>>>
>>>>> I could see something like this graduating to 'core' plugin status if
>>>>> it
>>>>> gets popular enough (and you are into it) Ross. For now, as Joe says,
>>>>> let
>>>>> it bake under your personal brand and feel free to enlist our help. :)
>>>>> On Dec 25, 2013 5:52 AM, "Ross Gerbasi" <rg...@gmail.com> wrote:
>>>>>
>>>>> > Copy that.
>>>>> >
>>>>> > Thanks
>>>>> > On Dec 24, 2013 11:22 AM, "Joe Bowser" <bo...@gmail.com> wrote:
>>>>> >
>>>>> > > They should go into your own package. I really shouldn't have used
>>>>> > > org.apache.cordova.glass.
>>>>> > >
>>>>> > > On Tue, Dec 24, 2013 at 9:20 AM, Ross Gerbasi <rg...@gmail.com>
>>>>> > wrote:
>>>>> > > > Also should I put these into my own package like
>>>>> > > > com.rossgerbasi.cordova.glass or should they go into
>>>>> > > > org.apache.cordova.glass ?
>>>>> > > >
>>>>> > > > thanks!
>>>>> > > >
>>>>> > > >
>>>>> > > > On Tue, Dec 24, 2013 at 11:13 AM, Ross Gerbasi <
>>>>> rgerbasi@gmail.com>
>>>>> > > wrote:
>>>>> > > >>
>>>>> > > >> Well hot damn, maybe i won't need to then. thanks for the heads
>>>>> up.
>>>>> > > >>
>>>>> > > >>
>>>>> > > >> On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <bowserj@gmail.com
>>>>> >
>>>>> > wrote:
>>>>> > > >>>
>>>>> > > >>> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <
>>>>> rgerbasi@gmail.com>
>>>>> > > wrote:
>>>>> > > >>> >
>>>>> > > >>> > Finally if I do go through with the plugin setup what do you
>>>>> all
>>>>> > > think
>>>>> > > >>> > about names for these plugins. Should it be something like
>>>>> > > >>> > cordova-glass-core which then opens the potential to have
>>>>> > > >>> > cordova-glass-voice, cordova-glass-camera, etc?
>>>>> > > >>> >
>>>>> > > >>>
>>>>> > > >>> The Camera and the Voice Recognition in Google Glass use the
>>>>> exact
>>>>> > > >>> same intents and code as Android.  I don't see why you would
>>>>> want to
>>>>> > > >>> make them glass specific.
>>>>> > > >>
>>>>> > > >>
>>>>> > > >
>>>>> > >
>>>>> >
>>>>>
>>>>
>>>
>>
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
Alrighty, more info, swipe_down default has been controlled the same way
the back button is for normal android. If you have a backbutton listener it
will bind the swipe down and dispatch a backbutton event instead of exiting
the app. This should work for users to navigate around :)

Now I need to find a way to apply what I have done via my touch plugin
instead of modifications to the main activity... so moving along...


On Wed, Dec 25, 2013 at 1:39 PM, Ross Gerbasi <rg...@gmail.com> wrote:

> Swipe down actually appears to be more of a key up event. Going down this
> road to try to cancel it.
>
>
> On Wed, Dec 25, 2013 at 1:02 PM, Ross Gerbasi <rg...@gmail.com> wrote:
>
>> I haven't been able to find a way to prevent the SWIPE_DOWN event from
>> closing the app, Joe you happen to dig into this? We really need swipe down
>> dispatched on the webview. Any ideas?
>>
>>
>> On Tue, Dec 24, 2013 at 3:36 PM, Ross Gerbasi <rg...@gmail.com> wrote:
>>
>>> Thanks Brian will do.
>>>
>>> For now I only know that of the XML for voice trigger. I will look into
>>> coding it into a plugin. Great idea.
>>> On Dec 24, 2013 4:04 PM, "Brian LeRoux" <b...@brian.io> wrote:
>>>
>>>> I could see something like this graduating to 'core' plugin status if it
>>>> gets popular enough (and you are into it) Ross. For now, as Joe says,
>>>> let
>>>> it bake under your personal brand and feel free to enlist our help. :)
>>>> On Dec 25, 2013 5:52 AM, "Ross Gerbasi" <rg...@gmail.com> wrote:
>>>>
>>>> > Copy that.
>>>> >
>>>> > Thanks
>>>> > On Dec 24, 2013 11:22 AM, "Joe Bowser" <bo...@gmail.com> wrote:
>>>> >
>>>> > > They should go into your own package. I really shouldn't have used
>>>> > > org.apache.cordova.glass.
>>>> > >
>>>> > > On Tue, Dec 24, 2013 at 9:20 AM, Ross Gerbasi <rg...@gmail.com>
>>>> > wrote:
>>>> > > > Also should I put these into my own package like
>>>> > > > com.rossgerbasi.cordova.glass or should they go into
>>>> > > > org.apache.cordova.glass ?
>>>> > > >
>>>> > > > thanks!
>>>> > > >
>>>> > > >
>>>> > > > On Tue, Dec 24, 2013 at 11:13 AM, Ross Gerbasi <
>>>> rgerbasi@gmail.com>
>>>> > > wrote:
>>>> > > >>
>>>> > > >> Well hot damn, maybe i won't need to then. thanks for the heads
>>>> up.
>>>> > > >>
>>>> > > >>
>>>> > > >> On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <bo...@gmail.com>
>>>> > wrote:
>>>> > > >>>
>>>> > > >>> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <
>>>> rgerbasi@gmail.com>
>>>> > > wrote:
>>>> > > >>> >
>>>> > > >>> > Finally if I do go through with the plugin setup what do you
>>>> all
>>>> > > think
>>>> > > >>> > about names for these plugins. Should it be something like
>>>> > > >>> > cordova-glass-core which then opens the potential to have
>>>> > > >>> > cordova-glass-voice, cordova-glass-camera, etc?
>>>> > > >>> >
>>>> > > >>>
>>>> > > >>> The Camera and the Voice Recognition in Google Glass use the
>>>> exact
>>>> > > >>> same intents and code as Android.  I don't see why you would
>>>> want to
>>>> > > >>> make them glass specific.
>>>> > > >>
>>>> > > >>
>>>> > > >
>>>> > >
>>>> >
>>>>
>>>
>>
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
Swipe down actually appears to be more of a key up event. Going down this
road to try to cancel it.


On Wed, Dec 25, 2013 at 1:02 PM, Ross Gerbasi <rg...@gmail.com> wrote:

> I haven't been able to find a way to prevent the SWIPE_DOWN event from
> closing the app, Joe you happen to dig into this? We really need swipe down
> dispatched on the webview. Any ideas?
>
>
> On Tue, Dec 24, 2013 at 3:36 PM, Ross Gerbasi <rg...@gmail.com> wrote:
>
>> Thanks Brian will do.
>>
>> For now I only know that of the XML for voice trigger. I will look into
>> coding it into a plugin. Great idea.
>> On Dec 24, 2013 4:04 PM, "Brian LeRoux" <b...@brian.io> wrote:
>>
>>> I could see something like this graduating to 'core' plugin status if it
>>> gets popular enough (and you are into it) Ross. For now, as Joe says, let
>>> it bake under your personal brand and feel free to enlist our help. :)
>>> On Dec 25, 2013 5:52 AM, "Ross Gerbasi" <rg...@gmail.com> wrote:
>>>
>>> > Copy that.
>>> >
>>> > Thanks
>>> > On Dec 24, 2013 11:22 AM, "Joe Bowser" <bo...@gmail.com> wrote:
>>> >
>>> > > They should go into your own package. I really shouldn't have used
>>> > > org.apache.cordova.glass.
>>> > >
>>> > > On Tue, Dec 24, 2013 at 9:20 AM, Ross Gerbasi <rg...@gmail.com>
>>> > wrote:
>>> > > > Also should I put these into my own package like
>>> > > > com.rossgerbasi.cordova.glass or should they go into
>>> > > > org.apache.cordova.glass ?
>>> > > >
>>> > > > thanks!
>>> > > >
>>> > > >
>>> > > > On Tue, Dec 24, 2013 at 11:13 AM, Ross Gerbasi <rgerbasi@gmail.com
>>> >
>>> > > wrote:
>>> > > >>
>>> > > >> Well hot damn, maybe i won't need to then. thanks for the heads
>>> up.
>>> > > >>
>>> > > >>
>>> > > >> On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <bo...@gmail.com>
>>> > wrote:
>>> > > >>>
>>> > > >>> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <
>>> rgerbasi@gmail.com>
>>> > > wrote:
>>> > > >>> >
>>> > > >>> > Finally if I do go through with the plugin setup what do you
>>> all
>>> > > think
>>> > > >>> > about names for these plugins. Should it be something like
>>> > > >>> > cordova-glass-core which then opens the potential to have
>>> > > >>> > cordova-glass-voice, cordova-glass-camera, etc?
>>> > > >>> >
>>> > > >>>
>>> > > >>> The Camera and the Voice Recognition in Google Glass use the
>>> exact
>>> > > >>> same intents and code as Android.  I don't see why you would
>>> want to
>>> > > >>> make them glass specific.
>>> > > >>
>>> > > >>
>>> > > >
>>> > >
>>> >
>>>
>>
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
I haven't been able to find a way to prevent the SWIPE_DOWN event from
closing the app, Joe you happen to dig into this? We really need swipe down
dispatched on the webview. Any ideas?


On Tue, Dec 24, 2013 at 3:36 PM, Ross Gerbasi <rg...@gmail.com> wrote:

> Thanks Brian will do.
>
> For now I only know that of the XML for voice trigger. I will look into
> coding it into a plugin. Great idea.
> On Dec 24, 2013 4:04 PM, "Brian LeRoux" <b...@brian.io> wrote:
>
>> I could see something like this graduating to 'core' plugin status if it
>> gets popular enough (and you are into it) Ross. For now, as Joe says, let
>> it bake under your personal brand and feel free to enlist our help. :)
>> On Dec 25, 2013 5:52 AM, "Ross Gerbasi" <rg...@gmail.com> wrote:
>>
>> > Copy that.
>> >
>> > Thanks
>> > On Dec 24, 2013 11:22 AM, "Joe Bowser" <bo...@gmail.com> wrote:
>> >
>> > > They should go into your own package. I really shouldn't have used
>> > > org.apache.cordova.glass.
>> > >
>> > > On Tue, Dec 24, 2013 at 9:20 AM, Ross Gerbasi <rg...@gmail.com>
>> > wrote:
>> > > > Also should I put these into my own package like
>> > > > com.rossgerbasi.cordova.glass or should they go into
>> > > > org.apache.cordova.glass ?
>> > > >
>> > > > thanks!
>> > > >
>> > > >
>> > > > On Tue, Dec 24, 2013 at 11:13 AM, Ross Gerbasi <rg...@gmail.com>
>> > > wrote:
>> > > >>
>> > > >> Well hot damn, maybe i won't need to then. thanks for the heads up.
>> > > >>
>> > > >>
>> > > >> On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <bo...@gmail.com>
>> > wrote:
>> > > >>>
>> > > >>> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <rgerbasi@gmail.com
>> >
>> > > wrote:
>> > > >>> >
>> > > >>> > Finally if I do go through with the plugin setup what do you all
>> > > think
>> > > >>> > about names for these plugins. Should it be something like
>> > > >>> > cordova-glass-core which then opens the potential to have
>> > > >>> > cordova-glass-voice, cordova-glass-camera, etc?
>> > > >>> >
>> > > >>>
>> > > >>> The Camera and the Voice Recognition in Google Glass use the exact
>> > > >>> same intents and code as Android.  I don't see why you would want
>> to
>> > > >>> make them glass specific.
>> > > >>
>> > > >>
>> > > >
>> > >
>> >
>>
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
Thanks Brian will do.

For now I only know that of the XML for voice trigger. I will look into
coding it into a plugin. Great idea.
On Dec 24, 2013 4:04 PM, "Brian LeRoux" <b...@brian.io> wrote:

> I could see something like this graduating to 'core' plugin status if it
> gets popular enough (and you are into it) Ross. For now, as Joe says, let
> it bake under your personal brand and feel free to enlist our help. :)
> On Dec 25, 2013 5:52 AM, "Ross Gerbasi" <rg...@gmail.com> wrote:
>
> > Copy that.
> >
> > Thanks
> > On Dec 24, 2013 11:22 AM, "Joe Bowser" <bo...@gmail.com> wrote:
> >
> > > They should go into your own package. I really shouldn't have used
> > > org.apache.cordova.glass.
> > >
> > > On Tue, Dec 24, 2013 at 9:20 AM, Ross Gerbasi <rg...@gmail.com>
> > wrote:
> > > > Also should I put these into my own package like
> > > > com.rossgerbasi.cordova.glass or should they go into
> > > > org.apache.cordova.glass ?
> > > >
> > > > thanks!
> > > >
> > > >
> > > > On Tue, Dec 24, 2013 at 11:13 AM, Ross Gerbasi <rg...@gmail.com>
> > > wrote:
> > > >>
> > > >> Well hot damn, maybe i won't need to then. thanks for the heads up.
> > > >>
> > > >>
> > > >> On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <bo...@gmail.com>
> > wrote:
> > > >>>
> > > >>> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <rg...@gmail.com>
> > > wrote:
> > > >>> >
> > > >>> > Finally if I do go through with the plugin setup what do you all
> > > think
> > > >>> > about names for these plugins. Should it be something like
> > > >>> > cordova-glass-core which then opens the potential to have
> > > >>> > cordova-glass-voice, cordova-glass-camera, etc?
> > > >>> >
> > > >>>
> > > >>> The Camera and the Voice Recognition in Google Glass use the exact
> > > >>> same intents and code as Android.  I don't see why you would want
> to
> > > >>> make them glass specific.
> > > >>
> > > >>
> > > >
> > >
> >
>

Re: Google Glass Support

Posted by Brian LeRoux <b...@brian.io>.
I could see something like this graduating to 'core' plugin status if it
gets popular enough (and you are into it) Ross. For now, as Joe says, let
it bake under your personal brand and feel free to enlist our help. :)
On Dec 25, 2013 5:52 AM, "Ross Gerbasi" <rg...@gmail.com> wrote:

> Copy that.
>
> Thanks
> On Dec 24, 2013 11:22 AM, "Joe Bowser" <bo...@gmail.com> wrote:
>
> > They should go into your own package. I really shouldn't have used
> > org.apache.cordova.glass.
> >
> > On Tue, Dec 24, 2013 at 9:20 AM, Ross Gerbasi <rg...@gmail.com>
> wrote:
> > > Also should I put these into my own package like
> > > com.rossgerbasi.cordova.glass or should they go into
> > > org.apache.cordova.glass ?
> > >
> > > thanks!
> > >
> > >
> > > On Tue, Dec 24, 2013 at 11:13 AM, Ross Gerbasi <rg...@gmail.com>
> > wrote:
> > >>
> > >> Well hot damn, maybe i won't need to then. thanks for the heads up.
> > >>
> > >>
> > >> On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <bo...@gmail.com>
> wrote:
> > >>>
> > >>> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <rg...@gmail.com>
> > wrote:
> > >>> >
> > >>> > Finally if I do go through with the plugin setup what do you all
> > think
> > >>> > about names for these plugins. Should it be something like
> > >>> > cordova-glass-core which then opens the potential to have
> > >>> > cordova-glass-voice, cordova-glass-camera, etc?
> > >>> >
> > >>>
> > >>> The Camera and the Voice Recognition in Google Glass use the exact
> > >>> same intents and code as Android.  I don't see why you would want to
> > >>> make them glass specific.
> > >>
> > >>
> > >
> >
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
Copy that.

Thanks
On Dec 24, 2013 11:22 AM, "Joe Bowser" <bo...@gmail.com> wrote:

> They should go into your own package. I really shouldn't have used
> org.apache.cordova.glass.
>
> On Tue, Dec 24, 2013 at 9:20 AM, Ross Gerbasi <rg...@gmail.com> wrote:
> > Also should I put these into my own package like
> > com.rossgerbasi.cordova.glass or should they go into
> > org.apache.cordova.glass ?
> >
> > thanks!
> >
> >
> > On Tue, Dec 24, 2013 at 11:13 AM, Ross Gerbasi <rg...@gmail.com>
> wrote:
> >>
> >> Well hot damn, maybe i won't need to then. thanks for the heads up.
> >>
> >>
> >> On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <bo...@gmail.com> wrote:
> >>>
> >>> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <rg...@gmail.com>
> wrote:
> >>> >
> >>> > Finally if I do go through with the plugin setup what do you all
> think
> >>> > about names for these plugins. Should it be something like
> >>> > cordova-glass-core which then opens the potential to have
> >>> > cordova-glass-voice, cordova-glass-camera, etc?
> >>> >
> >>>
> >>> The Camera and the Voice Recognition in Google Glass use the exact
> >>> same intents and code as Android.  I don't see why you would want to
> >>> make them glass specific.
> >>
> >>
> >
>

Re: Google Glass Support

Posted by Joe Bowser <bo...@gmail.com>.
They should go into your own package. I really shouldn't have used
org.apache.cordova.glass.

On Tue, Dec 24, 2013 at 9:20 AM, Ross Gerbasi <rg...@gmail.com> wrote:
> Also should I put these into my own package like
> com.rossgerbasi.cordova.glass or should they go into
> org.apache.cordova.glass ?
>
> thanks!
>
>
> On Tue, Dec 24, 2013 at 11:13 AM, Ross Gerbasi <rg...@gmail.com> wrote:
>>
>> Well hot damn, maybe i won't need to then. thanks for the heads up.
>>
>>
>> On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <bo...@gmail.com> wrote:
>>>
>>> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <rg...@gmail.com> wrote:
>>> >
>>> > Finally if I do go through with the plugin setup what do you all think
>>> > about names for these plugins. Should it be something like
>>> > cordova-glass-core which then opens the potential to have
>>> > cordova-glass-voice, cordova-glass-camera, etc?
>>> >
>>>
>>> The Camera and the Voice Recognition in Google Glass use the exact
>>> same intents and code as Android.  I don't see why you would want to
>>> make them glass specific.
>>
>>
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
Also should I put these into my own package like
com.rossgerbasi.cordova.glass or should they go into
org.apache.cordova.glass ?

thanks!


On Tue, Dec 24, 2013 at 11:13 AM, Ross Gerbasi <rg...@gmail.com> wrote:

> Well hot damn, maybe i won't need to then. thanks for the heads up.
>
>
> On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <bo...@gmail.com> wrote:
>
>> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <rg...@gmail.com> wrote:
>> >
>> > Finally if I do go through with the plugin setup what do you all think
>> > about names for these plugins. Should it be something like
>> > cordova-glass-core which then opens the potential to have
>> > cordova-glass-voice, cordova-glass-camera, etc?
>> >
>>
>> The Camera and the Voice Recognition in Google Glass use the exact
>> same intents and code as Android.  I don't see why you would want to
>> make them glass specific.
>>
>
>

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
Well hot damn, maybe i won't need to then. thanks for the heads up.


On Tue, Dec 24, 2013 at 11:02 AM, Joe Bowser <bo...@gmail.com> wrote:

> On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <rg...@gmail.com> wrote:
> >
> > Finally if I do go through with the plugin setup what do you all think
> > about names for these plugins. Should it be something like
> > cordova-glass-core which then opens the potential to have
> > cordova-glass-voice, cordova-glass-camera, etc?
> >
>
> The Camera and the Voice Recognition in Google Glass use the exact
> same intents and code as Android.  I don't see why you would want to
> make them glass specific.
>

Re: Google Glass Support

Posted by Joe Bowser <bo...@gmail.com>.
On Tue, Dec 24, 2013 at 6:22 AM, Ross Gerbasi <rg...@gmail.com> wrote:
>
> Finally if I do go through with the plugin setup what do you all think
> about names for these plugins. Should it be something like
> cordova-glass-core which then opens the potential to have
> cordova-glass-voice, cordova-glass-camera, etc?
>

The Camera and the Voice Recognition in Google Glass use the exact
same intents and code as Android.  I don't see why you would want to
make them glass specific.

Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
I really do like the idea of using the plugin XML, I think Axel has a good
start but as mentioned is there a way to handle xml resources via a plugin?
I need to copy a couple files (or write some xml) into the resources folder
then I also need to make an addition to strings.xml in the values
resources.

Lastly it would be nice to be able to add the intent to an existing
activity instead of having to create an activity just for glass. The
template for android already has the activity I wish to run I just need to
change the intent for it. Otherwise is there anyway to get the name of the
current activity for use in my own?

I guess it would be nice if the plugin could have more then just
plugin.xml, possible a node script that also ran that would allow me to
actually do modifications myself?

Finally if I do go through with the plugin setup what do you all think
about names for these plugins. Should it be something like
cordova-glass-core which then opens the potential to have
cordova-glass-voice, cordova-glass-camera, etc?

Dan - I already have a working hook, but it all feels dirty. It is an
after_platform_add hook that then modifies your android project. It just
doesn't feel clean doing it this way, a plugin would be much nicer.

-ross


On Tue, Dec 24, 2013 at 7:05 AM, Dan Moore <mo...@yahoo.com> wrote:

> Hi Ross.
>
> Wow, this will be really cool!
>
> You can manipulate the Android manifest and listen for intents with a
> plugin.  See this example plugin.xml that does so:
> https://github.com/8zrealestate/android-referrer-plugin/blob/master/plugin.xml
>
> Some of the limits of plugins right now (unless things have radically
> changed since I looked at them in Cordova 3.0):
> * you cannot remove nodes from an xml file
> * you cannot change values or attributes of xml file nodes
> * you can't modify any other kind of file.
>
> If you need to do any of the above kind of file manipulation, you should
> use a hook.  But I don't know a way to include a hook into a plugin.
>
> --
> Dan Moore
> https://leanpub.com/developingwithcordovacli/
>
>

Re: Google Glass Support

Posted by Axel Nennker <ig...@gmail.com>.
Please find attached an initial plugin.xml for your Google Glass plugin.
GoogleGlassActivity.java is started when you say "OK Glass". This activity
should call an handler in GoogleGlassPlugin.java. GoogleGlassPlugin could
then send an event to your Cordova app using webView.sendJavaScript (if you
want that)

One problem remains: I am not sure how to handle res/xml/cordova_show.xml
This list discussed the topic "resources" in the past but there was no
implementation (I think).



2013/12/24 Axel Nennker <ig...@gmail.com>

> I suggest to use a plugin. A plugin can add to the AndroidManifest.xml and
> add any Java package needed (your code to handle OS events (intents)).
>
> I do not understand what "...until we can work with intents via a plugin"
> means?
> Your plugin can add an Activity definition with an IntentFilter to the
> AndroidManifest.xml.
> That Activity can then send an Javascript event to Cordovas Javascript.
>
>
>
>
>
> 2013/12/24 Ross Gerbasi <rg...@gmail.com>
>
>> So do you suggest trying to do this as a plugin? Or is that pretty much a
>> no go until we can work with intents via a plugin?
>>
>> I am not also sure what you mean by the main launcher intent. I am using
>> IntelliJ IDEA and the debugger waits until i launch the app on Glass
>> automatically via voice or the menu. So I just run in debug mode and then
>> launch my app, it then hooks itself up.
>>
>>
>>
>>
>> On Mon, Dec 23, 2013 at 10:06 PM, Joe Bowser <bo...@gmail.com> wrote:
>>
>> > On Mon, Dec 23, 2013 at 7:56 PM, Andrew Grieve <ag...@chromium.org>
>> > wrote:
>> > > Neat stuff!
>> > >
>> > > If possible, it would definitely be neat to make glass work more
>> > > out-of-the-box with Cordova. I'm totally unfamiliar with what tweaks
>> are
>> > > necessary to make it work though.
>> > >
>> > > One thing that's possible already is to use a custom template. This is
>> > the
>> > > 4th parameter to the create command - a path to a directory to use as
>> the
>> > > project template.
>> > >
>> > > Would be awesome if all of the tweaks could be done via a cordova
>> plugin.
>> > > Plugins have the <config-file> tag, which allows you to edit XML
>> > (although
>> > > limited) on plugin install time.
>> > >
>> >
>> > I've done some work with this on this PoC here:
>> > https://github.com/infil00p/CordovaGlass/
>> >
>> > The thing that we have to consider is that plugins don't have to just
>> > be confined to a single class.  There's nothing that says
>> > that plugins can't move resource files, add node scripts or add Java
>> > classes other than ones descended from CordovaPlugin.java.  The only
>> > tricky bit that I see is that we're needing to modify the
>> > AndroidManifest.xml to handle the VOICE_TRIGGER intent, which is
>> > required so that when you say "Ok Glass", it does something.
>> >
>> > The other thing is that you want to keep the main launcher intent for
>> > debugger purposes, because otherwise you'll have to manually add code
>> > to listen for the debugger after you say "OK Glass".
>> >
>> > As far as whether it should be its own platform in the CLI, that whole
>> > argument is for CLI people to discuss.
>> >
>> > Joe
>> >
>> > >
>> > >
>> > > On Mon, Dec 23, 2013 at 10:43 PM, Ross Gerbasi <rg...@gmail.com>
>> > wrote:
>> > >
>> > >> Hello All,
>> > >>
>> > >> I have been working on Google Glass support for Cordova and hit a
>> wall.
>> > I
>> > >> am looking for some guidance/advice on how to proceed. There are a
>> > couple
>> > >> things that I need to deal with but I will start with just creating
>> the
>> > >> proper project. I have a feeling this will not only be about google
>> > glass
>> > >> but a issue we will come across later.
>> > >>
>> > >> Essentially in order to make this happen I need to modify
>> > >> AndroidManifest.xml and add some resources to the project. Ideally
>> This
>> > >> would be a custom template of some kind for an android project.
>> Possibly
>> > >> running a command like "cordova platform add android glass". The
>> other
>> > >> option is to just modify the existing android project after it has
>> been
>> > >> added, this seems messy though and a problem if the user trashes the
>> > >> android project they have to remember to run whatever command
>> modifies
>> > the
>> > >> project for glass again.
>> > >>
>> > >> Once I am able to get a basic project together for Glass the next
>> thing
>> > is
>> > >> events. In order to get touch pad events into the webview it
>> requires a
>> > bit
>> > >> of tweaking, so I need some java code to handle this. I am not sure
>> if
>> > this
>> > >> should be a plugin or not. It seems like it should not be a plugin
>> as it
>> > >> really is essential for the project to even really work. I could then
>> > see
>> > >> voice as a plugin?
>> > >>
>> > >> Currently I am planning on making a 3rd party node package that you
>> > would
>> > >> run against your project. Something like "cordova-glass
>> > __VOICE_TRIGGER__",
>> > >> that would then check for an android project, create it if needed,
>> then
>> > >> modify it for glass. It would add the voice trigger to start your app
>> > and
>> > >> such. If it already exists it will just make the tweaks needed. This
>> > will
>> > >> at least get the ball rolling and allow people to start building apps
>> > >> pretty easily, then maybe we can find a more efficient way to create
>> the
>> > >> project for users?
>> > >>
>> > >> Anyways I would love for anyone to chime in, I will be cranking away
>> on
>> > >> this but any ideas would be greatly appreciated.
>> > >>
>> > >> -ross
>> > >>
>> >
>>
>
>

Re: Google Glass Support

Posted by Axel Nennker <ig...@gmail.com>.
I suggest to use a plugin. A plugin can add to the AndroidManifest.xml and
add any Java package needed (your code to handle OS events (intents)).

I do not understand what "...until we can work with intents via a plugin"
means?
Your plugin can add an Activity definition with an IntentFilter to the
AndroidManifest.xml.
That Activity can then send an Javascript event to Cordovas Javascript.





2013/12/24 Ross Gerbasi <rg...@gmail.com>

> So do you suggest trying to do this as a plugin? Or is that pretty much a
> no go until we can work with intents via a plugin?
>
> I am not also sure what you mean by the main launcher intent. I am using
> IntelliJ IDEA and the debugger waits until i launch the app on Glass
> automatically via voice or the menu. So I just run in debug mode and then
> launch my app, it then hooks itself up.
>
>
>
>
> On Mon, Dec 23, 2013 at 10:06 PM, Joe Bowser <bo...@gmail.com> wrote:
>
> > On Mon, Dec 23, 2013 at 7:56 PM, Andrew Grieve <ag...@chromium.org>
> > wrote:
> > > Neat stuff!
> > >
> > > If possible, it would definitely be neat to make glass work more
> > > out-of-the-box with Cordova. I'm totally unfamiliar with what tweaks
> are
> > > necessary to make it work though.
> > >
> > > One thing that's possible already is to use a custom template. This is
> > the
> > > 4th parameter to the create command - a path to a directory to use as
> the
> > > project template.
> > >
> > > Would be awesome if all of the tweaks could be done via a cordova
> plugin.
> > > Plugins have the <config-file> tag, which allows you to edit XML
> > (although
> > > limited) on plugin install time.
> > >
> >
> > I've done some work with this on this PoC here:
> > https://github.com/infil00p/CordovaGlass/
> >
> > The thing that we have to consider is that plugins don't have to just
> > be confined to a single class.  There's nothing that says
> > that plugins can't move resource files, add node scripts or add Java
> > classes other than ones descended from CordovaPlugin.java.  The only
> > tricky bit that I see is that we're needing to modify the
> > AndroidManifest.xml to handle the VOICE_TRIGGER intent, which is
> > required so that when you say "Ok Glass", it does something.
> >
> > The other thing is that you want to keep the main launcher intent for
> > debugger purposes, because otherwise you'll have to manually add code
> > to listen for the debugger after you say "OK Glass".
> >
> > As far as whether it should be its own platform in the CLI, that whole
> > argument is for CLI people to discuss.
> >
> > Joe
> >
> > >
> > >
> > > On Mon, Dec 23, 2013 at 10:43 PM, Ross Gerbasi <rg...@gmail.com>
> > wrote:
> > >
> > >> Hello All,
> > >>
> > >> I have been working on Google Glass support for Cordova and hit a
> wall.
> > I
> > >> am looking for some guidance/advice on how to proceed. There are a
> > couple
> > >> things that I need to deal with but I will start with just creating
> the
> > >> proper project. I have a feeling this will not only be about google
> > glass
> > >> but a issue we will come across later.
> > >>
> > >> Essentially in order to make this happen I need to modify
> > >> AndroidManifest.xml and add some resources to the project. Ideally
> This
> > >> would be a custom template of some kind for an android project.
> Possibly
> > >> running a command like "cordova platform add android glass". The other
> > >> option is to just modify the existing android project after it has
> been
> > >> added, this seems messy though and a problem if the user trashes the
> > >> android project they have to remember to run whatever command modifies
> > the
> > >> project for glass again.
> > >>
> > >> Once I am able to get a basic project together for Glass the next
> thing
> > is
> > >> events. In order to get touch pad events into the webview it requires
> a
> > bit
> > >> of tweaking, so I need some java code to handle this. I am not sure if
> > this
> > >> should be a plugin or not. It seems like it should not be a plugin as
> it
> > >> really is essential for the project to even really work. I could then
> > see
> > >> voice as a plugin?
> > >>
> > >> Currently I am planning on making a 3rd party node package that you
> > would
> > >> run against your project. Something like "cordova-glass
> > __VOICE_TRIGGER__",
> > >> that would then check for an android project, create it if needed,
> then
> > >> modify it for glass. It would add the voice trigger to start your app
> > and
> > >> such. If it already exists it will just make the tweaks needed. This
> > will
> > >> at least get the ball rolling and allow people to start building apps
> > >> pretty easily, then maybe we can find a more efficient way to create
> the
> > >> project for users?
> > >>
> > >> Anyways I would love for anyone to chime in, I will be cranking away
> on
> > >> this but any ideas would be greatly appreciated.
> > >>
> > >> -ross
> > >>
> >
>

Re: Google Glass Support

Posted by Dan Moore <mo...@yahoo.com>.
Hi Ross.

Wow, this will be really cool!

You can manipulate the Android manifest and listen for intents with a plugin.  See this example plugin.xml that does so: https://github.com/8zrealestate/android-referrer-plugin/blob/master/plugin.xml

Some of the limits of plugins right now (unless things have radically changed since I looked at them in Cordova 3.0):
* you cannot remove nodes from an xml file
* you cannot change values or attributes of xml file nodes
* you can't modify any other kind of file.

If you need to do any of the above kind of file manipulation, you should use a hook.  But I don't know a way to include a hook into a plugin.  

--
Dan Moore
https://leanpub.com/developingwithcordovacli/ 


Re: Google Glass Support

Posted by Ross Gerbasi <rg...@gmail.com>.
So do you suggest trying to do this as a plugin? Or is that pretty much a
no go until we can work with intents via a plugin?

I am not also sure what you mean by the main launcher intent. I am using
IntelliJ IDEA and the debugger waits until i launch the app on Glass
automatically via voice or the menu. So I just run in debug mode and then
launch my app, it then hooks itself up.




On Mon, Dec 23, 2013 at 10:06 PM, Joe Bowser <bo...@gmail.com> wrote:

> On Mon, Dec 23, 2013 at 7:56 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
> > Neat stuff!
> >
> > If possible, it would definitely be neat to make glass work more
> > out-of-the-box with Cordova. I'm totally unfamiliar with what tweaks are
> > necessary to make it work though.
> >
> > One thing that's possible already is to use a custom template. This is
> the
> > 4th parameter to the create command - a path to a directory to use as the
> > project template.
> >
> > Would be awesome if all of the tweaks could be done via a cordova plugin.
> > Plugins have the <config-file> tag, which allows you to edit XML
> (although
> > limited) on plugin install time.
> >
>
> I've done some work with this on this PoC here:
> https://github.com/infil00p/CordovaGlass/
>
> The thing that we have to consider is that plugins don't have to just
> be confined to a single class.  There's nothing that says
> that plugins can't move resource files, add node scripts or add Java
> classes other than ones descended from CordovaPlugin.java.  The only
> tricky bit that I see is that we're needing to modify the
> AndroidManifest.xml to handle the VOICE_TRIGGER intent, which is
> required so that when you say "Ok Glass", it does something.
>
> The other thing is that you want to keep the main launcher intent for
> debugger purposes, because otherwise you'll have to manually add code
> to listen for the debugger after you say "OK Glass".
>
> As far as whether it should be its own platform in the CLI, that whole
> argument is for CLI people to discuss.
>
> Joe
>
> >
> >
> > On Mon, Dec 23, 2013 at 10:43 PM, Ross Gerbasi <rg...@gmail.com>
> wrote:
> >
> >> Hello All,
> >>
> >> I have been working on Google Glass support for Cordova and hit a wall.
> I
> >> am looking for some guidance/advice on how to proceed. There are a
> couple
> >> things that I need to deal with but I will start with just creating the
> >> proper project. I have a feeling this will not only be about google
> glass
> >> but a issue we will come across later.
> >>
> >> Essentially in order to make this happen I need to modify
> >> AndroidManifest.xml and add some resources to the project. Ideally This
> >> would be a custom template of some kind for an android project. Possibly
> >> running a command like "cordova platform add android glass". The other
> >> option is to just modify the existing android project after it has been
> >> added, this seems messy though and a problem if the user trashes the
> >> android project they have to remember to run whatever command modifies
> the
> >> project for glass again.
> >>
> >> Once I am able to get a basic project together for Glass the next thing
> is
> >> events. In order to get touch pad events into the webview it requires a
> bit
> >> of tweaking, so I need some java code to handle this. I am not sure if
> this
> >> should be a plugin or not. It seems like it should not be a plugin as it
> >> really is essential for the project to even really work. I could then
> see
> >> voice as a plugin?
> >>
> >> Currently I am planning on making a 3rd party node package that you
> would
> >> run against your project. Something like "cordova-glass
> __VOICE_TRIGGER__",
> >> that would then check for an android project, create it if needed, then
> >> modify it for glass. It would add the voice trigger to start your app
> and
> >> such. If it already exists it will just make the tweaks needed. This
> will
> >> at least get the ball rolling and allow people to start building apps
> >> pretty easily, then maybe we can find a more efficient way to create the
> >> project for users?
> >>
> >> Anyways I would love for anyone to chime in, I will be cranking away on
> >> this but any ideas would be greatly appreciated.
> >>
> >> -ross
> >>
>

Re: Google Glass Support

Posted by Joe Bowser <bo...@gmail.com>.
On Mon, Dec 23, 2013 at 7:56 PM, Andrew Grieve <ag...@chromium.org> wrote:
> Neat stuff!
>
> If possible, it would definitely be neat to make glass work more
> out-of-the-box with Cordova. I'm totally unfamiliar with what tweaks are
> necessary to make it work though.
>
> One thing that's possible already is to use a custom template. This is the
> 4th parameter to the create command - a path to a directory to use as the
> project template.
>
> Would be awesome if all of the tweaks could be done via a cordova plugin.
> Plugins have the <config-file> tag, which allows you to edit XML (although
> limited) on plugin install time.
>

I've done some work with this on this PoC here:
https://github.com/infil00p/CordovaGlass/

The thing that we have to consider is that plugins don't have to just
be confined to a single class.  There's nothing that says
that plugins can't move resource files, add node scripts or add Java
classes other than ones descended from CordovaPlugin.java.  The only
tricky bit that I see is that we're needing to modify the
AndroidManifest.xml to handle the VOICE_TRIGGER intent, which is
required so that when you say "Ok Glass", it does something.

The other thing is that you want to keep the main launcher intent for
debugger purposes, because otherwise you'll have to manually add code
to listen for the debugger after you say "OK Glass".

As far as whether it should be its own platform in the CLI, that whole
argument is for CLI people to discuss.

Joe

>
>
> On Mon, Dec 23, 2013 at 10:43 PM, Ross Gerbasi <rg...@gmail.com> wrote:
>
>> Hello All,
>>
>> I have been working on Google Glass support for Cordova and hit a wall. I
>> am looking for some guidance/advice on how to proceed. There are a couple
>> things that I need to deal with but I will start with just creating the
>> proper project. I have a feeling this will not only be about google glass
>> but a issue we will come across later.
>>
>> Essentially in order to make this happen I need to modify
>> AndroidManifest.xml and add some resources to the project. Ideally This
>> would be a custom template of some kind for an android project. Possibly
>> running a command like "cordova platform add android glass". The other
>> option is to just modify the existing android project after it has been
>> added, this seems messy though and a problem if the user trashes the
>> android project they have to remember to run whatever command modifies the
>> project for glass again.
>>
>> Once I am able to get a basic project together for Glass the next thing is
>> events. In order to get touch pad events into the webview it requires a bit
>> of tweaking, so I need some java code to handle this. I am not sure if this
>> should be a plugin or not. It seems like it should not be a plugin as it
>> really is essential for the project to even really work. I could then see
>> voice as a plugin?
>>
>> Currently I am planning on making a 3rd party node package that you would
>> run against your project. Something like "cordova-glass __VOICE_TRIGGER__",
>> that would then check for an android project, create it if needed, then
>> modify it for glass. It would add the voice trigger to start your app and
>> such. If it already exists it will just make the tweaks needed. This will
>> at least get the ball rolling and allow people to start building apps
>> pretty easily, then maybe we can find a more efficient way to create the
>> project for users?
>>
>> Anyways I would love for anyone to chime in, I will be cranking away on
>> this but any ideas would be greatly appreciated.
>>
>> -ross
>>

Re: Google Glass Support

Posted by Andrew Grieve <ag...@chromium.org>.
Neat stuff!

If possible, it would definitely be neat to make glass work more
out-of-the-box with Cordova. I'm totally unfamiliar with what tweaks are
necessary to make it work though.

One thing that's possible already is to use a custom template. This is the
4th parameter to the create command - a path to a directory to use as the
project template.

Would be awesome if all of the tweaks could be done via a cordova plugin.
Plugins have the <config-file> tag, which allows you to edit XML (although
limited) on plugin install time.

Andrew


On Mon, Dec 23, 2013 at 10:43 PM, Ross Gerbasi <rg...@gmail.com> wrote:

> Hello All,
>
> I have been working on Google Glass support for Cordova and hit a wall. I
> am looking for some guidance/advice on how to proceed. There are a couple
> things that I need to deal with but I will start with just creating the
> proper project. I have a feeling this will not only be about google glass
> but a issue we will come across later.
>
> Essentially in order to make this happen I need to modify
> AndroidManifest.xml and add some resources to the project. Ideally This
> would be a custom template of some kind for an android project. Possibly
> running a command like "cordova platform add android glass". The other
> option is to just modify the existing android project after it has been
> added, this seems messy though and a problem if the user trashes the
> android project they have to remember to run whatever command modifies the
> project for glass again.
>
> Once I am able to get a basic project together for Glass the next thing is
> events. In order to get touch pad events into the webview it requires a bit
> of tweaking, so I need some java code to handle this. I am not sure if this
> should be a plugin or not. It seems like it should not be a plugin as it
> really is essential for the project to even really work. I could then see
> voice as a plugin?
>
> Currently I am planning on making a 3rd party node package that you would
> run against your project. Something like "cordova-glass __VOICE_TRIGGER__",
> that would then check for an android project, create it if needed, then
> modify it for glass. It would add the voice trigger to start your app and
> such. If it already exists it will just make the tweaks needed. This will
> at least get the ball rolling and allow people to start building apps
> pretty easily, then maybe we can find a more efficient way to create the
> project for users?
>
> Anyways I would love for anyone to chime in, I will be cranking away on
> this but any ideas would be greatly appreciated.
>
> -ross
>