GithubHelp home page GithubHelp logo

rhino-android's Introduction

rhino-android's People

Contributors

f43nd1r avatar hugogresse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rhino-android's Issues

Reuse compiled dexes

Hello F43nd1r, this is more like a question rather than an issue, but here it goes. I have implemented a similar solution like yours in my Rhino implementation. If i'm not wrong, Rhino emits java bytecode again every time it runs an script, even if it ran it previously, then your library dexes it, then it is loaded with android's dex classloaders.

Would it be possible to store those compiled dexes, and run them directly the next time the same script is run?

I'm looking to squeeze performance by persisting those compiled scripts, so even if the app dies and restarts, it doesn't need to compile them again. Do you think this is feasible?

got an error (Duplicate entry name: adapter1.class)

java.util.zip.ZipException: Duplicate entry name: adapter1.class
at java.util.zip.ZipFile.readCentralDir(ZipFile.java:452)
at java.util.zip.ZipFile.(ZipFile.java:175)
at java.util.zip.ZipFile.(ZipFile.java:131)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:672)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.faendir.rhino_android.AndroidClassLoader.dexJar(AndroidClassLoader.java:103)
at com.faendir.rhino_android.AndroidClassLoader.defineClass(AndroidClassLoader.java:64)
at org.mozilla.javascript.JavaAdapter.loadAdapterClass(JavaAdapter.java:535)
at org.mozilla.javascript.JavaAdapter.getAdapterClass(JavaAdapter.java:333)
at org.mozilla.javascript.JavaAdapter.js_createAdapter(JavaAdapter.java:173)
......

Hello! first, thx your project!

I'm making a game and using JS to create game UI, when I enter (RhinoAndroidHelper.enter()) the context and create the first JavaAdapter, it works, but when I exit() the context and sometimes re-enter context and create another JavaAdapter, it's throw an Exception like above.

And this script on desktop-java is works.

PS: I created first JavaAdapter and it extend A.class, and second JavaAdapter extend B.class, when I creating second JavaAdapter(B.class), it's seem like still create an Adapter extend A.class, just like somethings not clear after first create. (im sorry for my bad English...)

memory leak in android kitkat

i have a memory leak when i load a file around 500kb to rhino in android kitkat
do you have tested rhino with big files in android kitkat?

Rhino closes automatically

Hello. I am using Rhino into an android service. I use an activity to start the service and it all works, but as soon as i exit the activity the Rhino script closes.

I have uploaded the script that I'm using and the app sources

rhinotest.zip

xml node attribute name is always โ€œ*โ€

The following javascript code works well and get "id" as expected on JVM. But when I run it on android with this library, I always get "*". Is it caused by the diffs between JVM and android? How can I get the expected result ? Or any other ways to get the attribute name of xml node?

(<xml id="foo"></xml>).attributes()[0].name()

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.