Answered
Public

For a small Android project i’m trying to run a simple Zebra application using a webview in which a html page is loaded. This requires Zebra to run locally, without a webserver.
I have tried it using the suggestions mentioned in this question without success.
Have anyone succeeded in running Zebra without webserver (does not need to be on Android, on PC is fine too for the moment)? If so, how?
 

<!DOCTYPE html>
<html>
    <head>
        <script src='http://repo.zebkit.org/latest/zebra.min.js'
                type='text/javascript'></script>
        <script type='text/javascript'>
            zebra.ready(function() {
                // import classes and variables from "ui" and "layout" packages in local space
                eval(zebra.Import("ui", "layout"));
                // create Canvas
                var root = (new zCanvas()).root;
                // define layout
                root.setLayout(new BorderLayout());
                // add button to center
                root.add(CENTER, new Button("Ok"));
                ...
            });
        </script>
    </head>
    <body></body>
</html>


 

  1. PS: The code in above post is from the GitHob page, if I get that to run locally that would get me started.

1 answer

you need to base64 encode all the assets and make your zebra.json file into a zebra.js file and load everything as javascript and make sure you dont do any ajax calls.  Its currently a bit of a pain.

#1

Please login or Register to Submit Answer