PHONK – A Hacker’s Fun Shortcut To Android Programming

As the common myth goes, the average human utilizes only about 10% of the true potential their smartphone is capable of. Especially when it comes to electronics projects, it seems that we often overlook how we can integrate and take advantage of their functionality here. Maybe that’s not a big surprise though — while it isn’t rocket science, getting into mobile development certainly has its hurdles and requires a bit of commitment. [Victor Diaz] figured there had to be a better way, so he went on and created PHONK, the self-contained creative scripting toolbox for Android.

PHONK is installed like any other app, and allows rapid prototyping on your Android device via JavaScript by abstracting away and simplifying the heavily boilerplated, native Java parts. So instead of setting up an app from scratch with all the resources defining, UI design, activity and application lifecycle management — not to mention the Android development environment itself — PHONK takes care of all that behind the curtain and significantly reduces the amount of code required to achieve the task you’re actually interested in. In case you’re worrying now that you have to actually program on your phone, well, you can, which can definitely come in handy, but you don’t have to.

Once the app is opened, a web server is started, and connecting to it from any modern browser within the same WiFi network presents you the PHONK development environment with everything you need: editor, file browser, console, and API documentation. You can write your code in the browser, and pressing the run button will execute it straight on the device then. As everything is self-contained within the app itself, no additional software is required, and you can start right away by exploring the set of provided examples that showcase everything supported so far: sensor interaction, BLE server and client, communication protocols like MQTT or WebSockets, OpenStreetMap maps, and even integration with Pure Data and Processing. Attach a USB OTG cable and you can program your Arduino, have serial communication, or interface a IOIO board. You can even connect a MIDI controller.

This is really impressive work done by [Victor], and a lot of attention to detail went into the development. If you have an old Android phone collecting dust somewhere, this would be a great opportunity to revive it and build something with it. And as [Victor] writes on the project’s GitHub page, he’s always curious what people will come up with. If you’re thinking about building a mobile sensor lab, or want to learn more about the sensors inside your phone, have a look at the 36C3 talk about phyphox.

RPi Video With Pygame

Adafruit has a new tutorial on creating video with an RPi and pygame. The goal is to create custom user interfaces on low cost hardware, powered by the easy to use pygame library. The tutorial walks through getting your RPi set up to run pygame, creating a basic pygame script that controls the framebuffer, and drawing an oscilloscope display on the screen.

This tutorial uses Adafruit’s WebIDE as a development environment. This is an excellent solution for working on video display, since you can develop the code on a networked computer and view the shell while running your graphical application. This is very useful for debugging, since you can just print information to your WebIDE console.

There’s a lot of potential for this setup. It would be ideal for creating any kiosk application. Maybe an announcement display, interactive kiosk, or even a programmable logic controller type user interface? What else could you build with a RPi attached to a LCD touchscreen?

Check out a video of Adafruit’s display in action after the break.

Continue reading “RPi Video With Pygame”

Web IDE For The Raspi

For this month’s release of Adafruit’s Raspberry Pi Linux distribution, [Limor], et al. decided to build a web-based IDE for the Raspberry Pi.

The Raspberry Pi WebIDE is a web server that runs on the Raspi. By connecting to your raspi in a web browser, you’re able to create your own Python programs that are able to interact with the GPIO pins. All the code is stored in the cloud with the help of bitbucket.

The WebIDE is in its early Alpha stage right now; there are a few bugs and minor issues, but in the video after the break, [Limor] shows us it’s possible to push code to a Raspi through the Internet and view the result in a web-based serial terminal.

For fear of editorializing, we have to point out that Adafruit’s web IDE – along with other Arduino web IDEs such as Codebender and the Wifino – work on the cloud. If you’re planning a long-term project that relies on a web-based IDE, you might be in for a world of hurt if only because you can’t host a cloud on a personal server. We’d love to see a package that allows us to have the same functionality as bitbucket on a personal server. If you can find a project that does something similar, or have written your own, send it in and we’ll spread the word.

Continue reading “Web IDE For The Raspi”