 I had about 60 slides and can everyone hear me? Is that alright? Yeah. I had about 60 slides and it was a bit much. So today I actually don't have any slides. So it's really good. So can you just put the last one? Yeah, no, no, no, no, no, no, no. I do have a demo though. We go and I was going to talk today about Android scripting engine. Has anyone here used scripting engine on Android phones? We've got one. That's good. If you want to go to Android scripting engine, it is code.google.com. Can everyone see that? Yeah. Everything you need to know is actually on this website. So I actually started doing presentation and I thought I'd bugger it. It's all on here. Android scripting engine is basically a way that you can play with scripting languages on the Android phone. If you want to do a bit of development, you can install Eclipse, Mesobarra, Java, C++. You've got a little language you want to play with. It supports all these languages, JRuby, Lua, Perl, Python, JavaScript via Rhino, BeanShell. I don't really like BeanShell. Has anyone ever used it? I don't know why they even have it on there. It's pretty cool actually. The API reference, if you have a look through there, you can play with pretty much everything within Android via your scripts. They have some great little example programs, which I had open in the window. I don't have now. If I go to my phone, which I should have here, start that one up, I did actually have it right here. This menu, probably not. I had a nice little example of it running on my phone here and I was broadcasting it back to the screen. I'll try to see if I can quickly get it going on the emulator for you. Everyone know about the Android emulator? Who's used Android? It usually doesn't picture the same sentence. Sorry? It usually doesn't picture the same sentence. No, that's why I started it first and then started talking. Well, that's starting up. It works really nice on the phone anyway. We can't use the document thing, can we? That doesn't work. Okay, no. Don't do it. Actually, I can do it if I... Oh, how do you open it? Is it not? No? That's it. Anyway, just to talk about the scripting engine, why all that stuff fires up. I program groovy most of the time and they don't actually have groovy on here, so I'll do a bit of mucking back with Lua, which seems to work quite nicely. There's quite a lot of examples in Lua. If you want to have a look through, if you click on the Lua one, if you want to install it, you can just go there to the IPK, install it, or you can use the little code. And on the actual phone, if this has worked, if you want to install it, you get the choice of all the little scripts and little scripts that come with it. There's a little script called Shut Up, which I was going to show you, which I can show you on here. You see that all right? There's only one little program on this emulator. Oh no, I've got the other ones, yep. There's this one here called Shut Up.Lua, and if I was actually running it on the real phone, I could actually run it for you, but because it's in the emulator. This is just a little script that detects if your phone is facing that way or that way. If you turn it over, it mutes it. It turns the ringer off if you turn it that way. It turns it back on. As you can see here, you can get into the Android API into events. The guy who was on here talking about events, you can hook into all of that stuff. You can get a little event check where the phone is up or down. It gives a little vibrate there. See? A little short vibration to say it's in silent mode, and then it toggles the ringer. If it's the other way around, it does the opposite, and then it sleeps. This thing runs as a little service that just runs in the background. If I actually run this, it won't do anything on the emulator, but I can show you how it actually runs and how the scripts actually sit there. If I go back to home again, you get this little thing at the top here. It just says you've got little services running. You can drag that down. Think? Anyway, on the real phone, you can stop the number of services running, and you can stop and start, and you can stop in there if I want to stop it. And then there are some other ones which are more interactive. So if I go... I'm so used to using the phone. It's funny, clunky, using this thing. You can go and do the standard Hello world. There's one called Hello User, which have a quick look at it. It just asks for your name, and does this... This is my favourite Android command, make toast, which is just great. It reminds me of my student days where I just lived on toast all the time. Toast and smash. You get smash in this country. Packet, mash, potato. Yeah, it's toast and smash sometimes as well. So I can save and run this. And it's gone the other way around. Steve. Okay. Hello Steve. Having a bit of identity crisis there. And there's heaps more you can do with it. If you go back to the site there that I was on before, there's a nice little video down the bottom. They talk about some stuff they did with rockets where they were sending Android phones at. I think they only had a day to like a sort of flight window, and they knew they could send this stuff in these rockets. So they did some stuff with the scripting engine, mocked it up quickly, I think they had an Arduino and some other things in there, and send it up in this rocket and they did it all in 24 hours. So scripting engine sort of got them going really quickly without having to sort of go crazy with all the ideas and all that stuff. And the right support for the languages apparently you can hook in your other scripting languages. Most of those ones you see there on the right are basically brought to us by some of the stuff I talked about yesterday, the alternative JVM languages. So I presume you can probably put PHP on there and other things because they've got things like Resin and Groovy, there's some problem with Groovy apparently that it won't work, but I think fair amount of people doing Perl and Python and things like that. So on that note I think I'll open it up into questions if anyone's got any, I'll attempt to answer them as long as they're not about Linux and projectors. Well all that stuff I showed you there before in the API reference you can get into. So if you have a look down there, they've got there's lots of things to do with logging notifying, they've got Bluetooth you can access the GPS. Sorry? Yes, yes. And the other thing I didn't mention about the scripts is you can actually I'll go back here and do ADB shell They're all actually just stored on the SD card as script files. So you can if you want to pull them off the phone, edit them in a different editor and muck about with them there if you don't want to actually type into the actual device which is not very nice. On the actual editor there's a little Rapple thing, it's a good way to describe it actually there's a little API browser in there, you can browse through all the API calls but it doesn't actually tell you what they do or anything in the API browser so it's not particularly useful but it's really great for just mucking about if you want to write little scripts it'll hook into if you there's a little thing called lapel I don't know if anyone's used that, there's a few that's a paid app but there's a few free ones as well which will run scripts based on your GPS location time of the day and things like that so you can write little scripts that will fire off at different times of the day or when you go to the office it puts your ringer on and things like that so it's a good fun little environment to muck about with. Any other questions? On the good code? Yeah, on the scripting site. Yeah, there's a bit of stuff in there in the examples but I don't know if there's an actual repo there's a mailing list I'm not particularly active on it at the moment I did this talk about six months ago and then just pulled it out so there may be something on there now that would be a good idea just to have a little sort of code site but yeah, there's quite a few in there in the examples but most of them one seems to have a lot more examples but some of them just have hello world and you have to sort of work out the rest yourself but it's pretty easy to tinker around with anything else Thank you