Giter VIP home page Giter VIP logo

firestick-mandelbrot's Introduction

firestick-mandelbrot

Description

This is an Android TV application, for visualizing the Mandelbrot set, intended to be run on an Amazon FireStick 2.

Screen Capture

screen shot from adb

Motivation

Inspired by Sverrir Berg's go example. https://github.com/sverrirab/mandelbrot-go

Weekend effort to get a basic application onto my new Amazon FireStick 2.

High Level Build Instructions

Clone the git repo.
Import the mandelbrot-firestick project into Android Studio.
Allow Android Studio to update any files to match your local Gradle, SDK tools and Platform versions, which will most likely be newer than the source version specifies.
Build the APK file.
Note the FULL_PATH_OF_THE_APK_FILE.apk

_These instructions were last tested with the following configuration:
Android Studio 3.5.2

sign_and_send_pubkey: signing failed: agent refused operation

Installation

Assumes the development machine and Amazon FireStick are on the same local subnet.

On the Amazon FireStick make sure that from the Settings you have enabled both developer options "ADB debugging" and "Allow from Unknown Sources"
From the Network settings, make a note of the IP_ADDRESS_OF_THE_FIRESTICK

From the development machine, open a command prompt in the platform-tools directory of the Android SDK.
Execute the following three commands:
adb start-server
adb connect IP_ADDRESS_OF_THE_FIRESTICK
adb install FULL_PATH_OF_THE_APK_FILE.apk

This will copy the APK file across onto the FireStick.

These instructions were last tested with the following configuration:
Android Debug Bridge version 1.0.39

Usage

The application requires a BlueTooth mouse be paired to the FireStick.
This should provide a white circle (pseudo-touch) cursor.

Launch the Mandelbrot application from the FireStick launcher using the FireStick remote. It can be found in the Your Applications sub-page.

Clicking the mouse will zoom the view, by a factor of two, re-centered at the cursor location.
The application permits zooming in approximately fifty times, before it runs out of precision.

Known Issues

The application is hard-coded to TVs (Android devices) running landscape orientation at 1920 x 1080 resolution.

The application does not utilize the FireStick remote for navigation.

Sideloading the APK onto the FireStick will result in the incorrect app icon being displayed. The correct icon will only be used if the app is installed from the app store.

Future Improvements

Horrendous Performance

The FireStick is almost a hundred times slower than an Android emulator running on a 3.3GHz Intel i5. All of the time is being spent in the basic calculation loops, i.e. floating point unit performance.

The application uses only one worker thread, whereas the FireStick 2 has four cores that could be used. Note the MT8173 has mismatched cores, so two are faster.

We need to investigate whether floats would be possibly faster than doubles, without introducing too much imprecision.

Credits

The basic mathematical equation and Escape Time Algorithm are described on the Wikipedia page https://en.wikipedia.org/wiki/Mandelbrot_set.

Periodicity checking and border edge checking (the more advanced version of interpolation) are also described, in brief, there.

License

MIT license.

firestick-mandelbrot's People

Stargazers

 avatar

Watchers

 avatar  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.