Giter Site home page Giter Site logo

victordiaz / phonk Goto Github PK

View Code? Open in Web Editor NEW
456.0 15.0 27.0 74.64 MB

PHONK is a coding playground for new and old Android devices

Home Page: https://phonk.app

License: GNU General Public License v3.0

JavaScript 4.60% HTML 0.29% CSS 1.03% Java 85.44% Shell 0.15% Python 0.08% Vue 8.19% Less 0.19% C++ 0.04%
android prototyping framework javascript mqtt osc sensors

phonk's Introduction

PHONK

github version PRs welcome

PHONK is a coding playground for new and old Android devices.

Create scripts rapidly from your phone or using the remote Web Editor on your computer using Javascript. The API is simple and extensive. GUI, audio, graphics, Bluetooth BLE, Arduino, OSC, MIDI, and much more.

PHONK WebsiteTutorialForumDiscord

animation

Features

  • Takes 1 min to set up on your phone
  • No need to install anything on your computer
  • PHONK uses JavaScript but it calls native Java functions, getting close to native speed
  • Simplified API. Create custom interfaces and access on-device sensors in a couple of lines of code
  • Pseudo Live Coding (select your code and Control (or Cmd) + Enter to live execute)
  • Bluetooth and Arduino in a few lines of code
  • MQTT, HTTP requests, WebSockets, OSC, MIDI
  • Access to Processing.org API
  • Use your PureData skills thanks to the embedded LibPd
  • OpenStreetMaps and muuuch more!

How to install it

Get it from

If you have an Android phone with a version higher than 4.1 (that's from 2012!) then it should work! If you find a problem, please create an issue.

During the first install, the app will

  1. Ask you for a bunch of permissions. I recommend accepting all of them to be able to run the examples. You can always revoke them :)
  2. Install the examples in the device "sdcard" folder. Doing this we can easily access the examples and self-made scripts from any other app.

How to create your first script

Check the Getting started guide for a more detailed explanation

Run the PHONK app in your Android device. You can create your first script within the device, although it might be a bit cumbersome using the device virtual keyboard.

Instead, connect your computer and Android to the same Wi-Fi network. On your computer open the browser and type the IP address indicated on your phone after pressing "Start web editor". A web editor will load, allowing you to code on the phone.

You can create a new project and copy and paste this into the editor.

// ui elements need x, y, w, h normalized paramaters
ui.addButton('Start accelerometer', 0.1, 0.45, 0.8, 0.1).onClick(function () {
  sensors.accelerometer.start()
})

sensors.accelerometer.onChange(function (e) {
  console.log(e.x, e.y, e.z)
})

Now run the project. 🎉

You can explore the variety of examples included in PHONK and modify them in order to explore its capabilities.

Compile it yourself

PHONK depends on 3 subprojects contained in this repository.

  1. PHONK-android. The main PHONK Android project.
  2. PHONK-editor. The Web Editor written in an old version of Vue.js
  3. PHONK-examples. The examples

In order to compile PHONK you also need to:

  1. Copy the examples into the main app assets folder. In PHONK-examples run npm run cleanAndDeploy
  2. Build and copy the WebEditor into the main app assets folder. In PHONK-editor npm run cleanBuildAndDeploy
  3. Run the Android project using Android studio

Once you've done that, there is no necessity to do the first steps anymore unless you want to update the Web Editor or the examples.

Project structure

The PHONK app is divided into two modules: phonk_app and phonk_apprunner.

  • phonk_app is the app that you see when you start PHONK and it manages all the stuff to let you make projects.
  • phonk_apprunner is the part in charge of running the scripts and it contains all the API. If you want to add or improve the API you can go to the folder phonk/phonk_apprunner/src/main/java/io/phonk/runner/apprunner/api. All the methods you include there will automatically be exposed to JavaScript.

Get Involved

  • Write about it
  • Make something with PHONK.app and tell me about it. I would love to know how you use it. (GitHub, e-mail, etc.)
  • Have a look at the issues

Roadmap

  • Getting started guide
  • Improve documentation
  • How-to-contribute guide

License

This project is licensed under the terms of the GPL / LGPL v3 License. You can check out the full LICENSE description on the file LICENSE.txt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.