[racket] problems running moby from source
Hi Danny,
thanks a lot for the explanation,- it worked fine, and this is very cool!
But you know, the reason I wanted to look into the source was that as a new and proud I-never-thought-I'd-buy-something-like-that-in-my-life owner of an Android smartphone, I wanted to look into how Moby interfaces with Android and what one could do using racket to create an Android app.
Specifically, I wanted to see if there'd be some way to configure how (from what provider) and how often etc. to retrieve location updates (as described in the Android docs on the "obtaining user location" page, http://developer.android.com/guide/topics/location/obtaining-user-location.html).
I saw Moby has an on-location-change handler, but I was wondering whether it was possible to access the underlying Android methods somehow (or for starters, to find out with what parameters Moby might "call" them), if only for the purpose of saving battery...
Could you perhaps explain a little bit?
From your reply, I'm also not sure that you are going to keep / develop further the Android-related code? And just as an aside, if Android remained a main target... would there (still, or again, or whatever :-) ) help be welcome for Android-specific stuff (like the location thing)?
Ciao,
Sigrid
Am 25.10.2010 um 22:23 schrieb Danny Yoo:
> Hi Sigrid,
>
> I'm revamping Moby; it's being mostly subsumed by my js-vm PLaneT package.
>
>
> To install, evaluate the following at your DrRacket REPL:
>
> (require (planet dyoo/js-vm:1:2/info))
>
> This will install js-vm and the tools.
>
> Once that's installed, restart DrRacket.
>
> There should now be the following menu options under the Racket submenu:
>
> * Create Javascript Package
> * Run Javascript in Browser
>
>
> The first will create a .zip package at a specified place, and the
> latter will start up a web server and serve a page that runs the
> currently-edited program.
>
> As an example, enter the following as "test.rkt":
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> #lang planet dyoo/js-vm:1:2
>
> (printf "hello world\n")
> (check-expect (* 3 4 5) 60)
> (current-seconds)
> (image-url "http://racket-lang.org/logo.png")
> (check-expect
> (big-bang 0
> (on-tick add1 1)
> (stop-when (lambda (x) (= x 10))))
> 10)
> "last line"
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> Save the file, and then press Run. The interactions should evaluate
> up to the image-url expression, after which case the repl will error
> out with "Must be evaluated within Javascript". As long as your
> program is not accessing anything Javascript-specific, you should
> still be able to run and test your programs under DrRacket. (big-bang
> is currently a Javascript-specific function.)
>
> Next, choose "Run Javascript in Browser". DrRacket should bring up a
> status window, as well as opening up a web browser with the currently
> running program.
>
> Finally, choose "Create Javascript Package". DrRacket will prompt for
> a place to put the zip file, and then generate a .zip archive; its
> contents will be the files that were served under "Run Javascript in
> Browser."
>
>
>
> The falling ball example will be this:
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> #lang planet dyoo/js-vm:1:2
>
> (define-struct world (radius y))
>
> ;; The dimensions of the screen:
> (define WIDTH 320)
> (define HEIGHT 480)
>
> ;; The radius of the red circle.
> (define RADIUS 15)
>
> ;; The world is the distance from the top of the screen.
> (define INITIAL-WORLD (make-world RADIUS 0))
>
> ;; tick: world -> world
> ;; Moves the ball down.
> (define (tick w)
> (make-world RADIUS (+ (world-y w) 5)))
>
>
> ;; hits-floor?: world -> boolean
> ;; Returns true when the distance reaches the screen height.
> (define (hits-floor? w)
> (>= (world-y w) HEIGHT))
>
> ;; We have some simple test cases.
> (check-expect (hits-floor? (make-world RADIUS 0)) false)
> (check-expect (hits-floor? (make-world RADIUS HEIGHT)) true)
>
> ;; render: world -> scene
> ;; Produces a scene with the circle at a height described by the world.
> (define (render w)
> (place-image (circle RADIUS "solid" "red") (/ WIDTH 2) (world-y w)
> (empty-scene WIDTH HEIGHT)))
>
> ;; Start up a big bang, 15 frames a second.
> (check-expect (big-bang INITIAL-WORLD
> (on-tick tick 1/15)
> (to-draw render)
> (stop-when hits-floor?))
> (make-world 15 480))
>
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
>
> As you might notice, some of the names of symbols have changed from
> Moby 2. I'll be releasing documentation for the new system shortly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20101026/fe4f4650/attachment.html>