Skip to content

Bost/bocko-android

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bocko for Android

A library for drawing with bocko on Android surface view.

Clojars Project

Usage

Open android/BockoAndroid in Android Studio and change android/BockoAndroid/app/src/main/java/com/nvbn/bockoandroid/BockoView.java:getUrl to file:///android_asset/index.html if you want to put compiled cljs in apk or to something like http://192.168.0.107:3449/ if you want to use figwheel.

Example usage:

(require '[bocko-android.core :refer [init])
(require '[bocko.core :as b])

(init)

(doseq [[c n] (map vector
                   [:black :red :dark-blue :purple
                    :dark-green :dark-gray :medium-blue :light-blue
                    :brown :orange :light-gray :pink
                    :light-green :yellow :aqua :white]
                   (range))]
  (b/color c)
  (let [x' (* 10 (rem n 4))
        y' (* 10 (quot n 4))]
    (doseq [x (range x' (+ 10 x'))
            y (range y' (+ 10 y'))]
      (b/plot x y))))

Result:

phone

For more information see examples and bocko for usage on cljs side.

License

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Bocko for Android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 53.9%
  • Java 43.7%
  • HTML 2.4%