Giter VIP home page Giter VIP logo

kivy_service_osc's Introduction

Purpose

CircleCI

This code aims at demonstrating an use of services in python-for-android, and communication between services and a kivy front end.

That examples uses the OSC protocol for simplicity and historical reasons, (since an implementation was shipped with kivy historically, and a better one is now found in oscpy). The OSC protocol makes things simple because it's unconnected, you just send a message, and can forget about it. You bind functions to messages you receive. It's simple enough for a lot of things, and avoids the burden of maintaining a connection when both the service and front end can be restarted any time.

The app is composed of the front-end, defined in src/main.py, and the back-end defined in src/service.py.

The service (back-end):

  • is defined in buildozer.spec, in the services line. Following the example syntax
  • is started by the application at startup time, and can be stopped/restarted from the UI.
  • sends the current date, as a string, every tenth of a second to the UI, on a '/date' address.
  • answers with a random string on the '/message' address when a message is sent to the '/ping' address on its side.

The UI (front-end):

  • is defined in main.py
  • allows stopping/restarting the backend.
  • displays the last received messages from the backend in a RecycleView
  • allow to sent a '/ping' message to the backend, which will trigger a new message.

Building:

  • The package is built using CircleCI, you should be able to download the latest debug apk by clicking on the "Artifacts" tab on the latest build.
  • This project is a template repository, so you can create your own project from it, and setup CircleCI to build your version of it.
  • You can also just run the kivy/buildozer docker image to build your project from any Linux computer.
docker run -v $PWD:/project/ -w /project/ kivy/buildozer android debug

Once it's completed, you should have a bin/ directory with the apk inside.

kivy_service_osc's People

Contributors

tshirtman avatar lucomsky avatar loan-mgt avatar true-learner avatar

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.