newbie questions on multiple threads, sound recording and the GWT

27 views
Skip to first unread message

Anil

unread,
Sep 26, 2007, 7:52:16 AM9/26/07
to Google Web Toolkit
Hello,
My application needed to be ported to Javascript to run in the browser
and run offline. There was nothing that could do it.
GWT and Gears came after a long wait - so it seems like my prayers
were answered!
However, I would like to know:
1) How can I create threads? I need to run tasks in parallel
2) How can I record audio from the microphone? As far as I know, Java
Sound API isnt supported.

thanks,
Anil

mon3y

unread,
Sep 26, 2007, 8:27:28 AM9/26/07
to Google Web Toolkit
Hi

1).....dunno

2)Applet-You can embbed an applet in your AJAX application. Take a
look at the JMF API. Your applet will need to be signed....google
search: signed applets

HTH
:)

Ryan Dewsbury

unread,
Sep 26, 2007, 9:07:31 AM9/26/07
to Google Web Toolkit
1) GWT compiles to JavaScript and JavaScript can only run on one
thread in a web browser. If you need to perform long processing and
don't want the interface to slow down you should look at
IncrementalCommand. It lets you break up a long process into parts.
(http://code.google.com/webtoolkit/documentation/
com.google.gwt.user.client.IncrementalCommand.html)

2) You'll need to use a browser plugin. Either Java or flash. For
flash check out: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Microphone.html

Ryan
http://www.gwtapps.com

abickford

unread,
Sep 26, 2007, 9:25:08 AM9/26/07
to Google Web Toolkit
IMO, GWT is not a good solution for you app.

1) You don't get multi threading in GWT. Incremental command helps w/
slow script warning and what not, but it isn't comparable to having
threads.

2) You can't record w/javascript (and therefore GWT). About the time
you are using flash or applets for this, what is GWT buying you over
a webstart or full flash app?

On Sep 26, 7:52 am, Anil <anil.r...@gmail.com> wrote:

Anil

unread,
Sep 26, 2007, 2:36:03 PM9/26/07
to Google Web Toolkit
Thanks for replying!
My current version runs using web start. No one wants to even run the
demos even though they say the idea is interesting.
Hence I realized it must run in the browser.
thanks,
Anil

> > Anil- Hide quoted text -
>
> - Show quoted text -

Anil

unread,
Sep 26, 2007, 2:45:33 PM9/26/07
to Google Web Toolkit
I need to have sound playing in parallel with web links opening up in
a browser and video playing.
As abickford said Incremental Command wont work, Can I accomplish this
instead by running each task in a browser and spawning off these new
browsers? (minimized to avoid clutter).
Just wondering.
thanks,
Anil


On Sep 26, 8:07 am, Ryan Dewsbury <dewsb...@gmail.com> wrote:
> 1) GWT compiles to JavaScript and JavaScript can only run on one
> thread in a web browser. If you need to perform long processing and
> don't want the interface to slow down you should look at
> IncrementalCommand. It lets you break up a long process into parts.
> (http://code.google.com/webtoolkit/documentation/
> com.google.gwt.user.client.IncrementalCommand.html)
>
> 2) You'll need to use a browser plugin. Either Java or flash. For

> flash check out:http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media...
>
> Ryanhttp://www.gwtapps.com


>
> On Sep 26, 7:52 am, Anil <anil.r...@gmail.com> wrote:
>
>
>
> > Hello,
> > My application needed to be ported to Javascript to run in the browser
> > and run offline. There was nothing that could do it.
> > GWT and Gears came after a long wait - so it seems like my prayers
> > were answered!
> > However, I would like to know:
> > 1) How can I create threads? I need to run tasks in parallel
> > 2) How can I record audio from the microphone? As far as I know, Java
> > Sound API isnt supported.
>
> > thanks,

Fred Sauer

unread,
Sep 26, 2007, 3:30:59 PM9/26/07
to Google-We...@googlegroups.com
Anil,

Google Gears does provide a worker pool (although it may be too restricted for what you are trying to do) for background tasks:
 http://code.google.com/apis/gears/api_workerpool.html

You can play sound using gwt-voices:
  http://code.google.com/p/gwt-voices/

Fred

Anil

unread,
Sep 26, 2007, 4:00:11 PM9/26/07
to Google Web Toolkit
Yes, I just read about it before I saw your post and posted a question
there!
I am very interested in using Google voices. Shall email you a link to
my demos if you are interested.
thanks,
Anil


On Sep 26, 2:30 pm, "Fred Sauer" <f...@allen-sauer.com> wrote:
> Anil,
>
> Google Gears does provide a worker pool (although it may be too restricted
> for what you are trying to do) for background tasks:
> http://code.google.com/apis/gears/api_workerpool.html
>
> You can play sound using gwt-voices:
> http://code.google.com/p/gwt-voices/
>
> Fred

> --
> Fred Sauer
> f...@allen-sauer.com- Hide quoted text -

Anil

unread,
Sep 26, 2007, 4:19:43 PM9/26/07
to Google Web Toolkit
Anyone interested in joining me to rewrite juwo to Google Web Toolkit/
Gears?
thanks,
Anil
http://juwo.com

Ben Lisbakken

unread,
Sep 27, 2007, 12:38:38 PM9/27/07
to Google Web Toolkit
Anil -

Google Web Toolkit has an API Library that has support for Google
Gears here:
http://code.google.com/p/gwt-google-apis/

However, at this time the WorkerPool is unsupported and has a few
issues. The Google Web Toolkit team is aware of this and will be
working on it in future versions of the API library.

Thanks, Fred, for showing him the gwt-voices ;)

Good luck Anil!

-Ben

Anil

unread,
Sep 28, 2007, 4:38:52 AM9/28/07
to Google Web Toolkit
Ben,
I appreciate your pointing me to the API library. Since Gears has to
be installed on the desktop,
I presume that Gears is Java, not Javascript. So that Worker Pool is a
genuine Java thread pool.
thanks,
Anil

> > thanks,Anilhttp://juwo.com- Hide quoted text -

Ben Lisbakken

unread,
Sep 28, 2007, 1:34:11 PM9/28/07
to Google Web Toolkit
Anil -

Gears is a JavaScript API. The Google Web Toolkit actually wraps this
JavaScript API so that you can use the different Gears modules
directly in your GWT code. If you would like to use the WorkerPool
module in your GWT application, you'll want to check out this thread
where Sumit goes into the details on the different techniques
available to incorporate this module in your GWT code:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/658f6665e5b09bed/4aec89cb494e56ce?lnk=gst&q=WorkerPool&rnum=4#4aec89cb494e56ce

One of the options is to use JSNI code. Although this option is
currently discouraged in the current version of the Gears for GWT API,
if you decide to use JSNI to write your Worker code you may want to
read up more about using JSNI in GWT here:
http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.JavaScriptNativeInterface.html

I hope this works out for you!
-Ben

> > > thanks,Anilhttp://juwo.com-Hide quoted text -

Reply all
Reply to author
Forward
0 new messages