在Android应用程序中嵌入脚本国米preTER [英] Embedding Script Interpreter in Android app

查看:156
本文介绍了在Android应用程序中嵌入脚本国米preTER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个Android应用程序,它读取用Java编写语法一个txt文件,并通过其他语言的编译。

I am trying to build an Android app which read a txt file written in Java syntax and compile it via other language.

跳到Java的>剧本,我想知道我怎么可以嵌入脚本间preTER或一些会编译脚本code。

Skip java->script, I want to know how I can embed a script interpreter or something that would compile the script code.

所以基本功能是:读了剧本code,编译它,给结果。例如显示一个Hello World的屏幕。

So the basic functionality is: read the script code, compile it, give the result. e.g. show a Hello World screen.

我知道有一个官方SL4A的应用程序,但我只是想从它的编译片,并嵌入自己的应用程序。可能吗?

I know there is "official" sl4a app, but I just want the compiling piece from it and embedded in my own app. Is it possible?

顺便说一下有没有在Java code转换为一个Python code或其他语言的脚本解析器的?如果是的话我应该如何阅读在java code,从TXT字符串或HTML或?

Btw is there any parser that translate the java code to a Python code or other script language? If so how should i read in the java code, as a string from txt or html or?

非常感谢。

感谢大家有所帮助!
对不起,我不知道我应该怎么修改我的帖子所以只是像这样做。

Thanks to everyone helps! Sorry I don't know how I should edit my own post so just do it like this.

我为什么我试图做到这一点在我的下费米响应,因此您可以检查出详细解释。

I explained in details why I am trying to do this in my response to Femi below so you can check that out.

简单地说我只是想我的应用程序在Java code读取和编译。既然有Android的下没有Java跨preTER或编译器,我必须使用其他语言。不知道怎么办。

Briefly I just want my app to read in java code and compile it. Since there is no java interpreter or compiler under Android i have to use other language. Don't know how.

感谢您!

推荐答案

那么,它一个奇怪的选择的任务,但你总是可以嵌入前pression语言,如MVEL(HTTP://mvel.$c $ chaus.org /)到您的应用程序。我很好奇它是如何执行的,你会想用它来做什么。您是否在寻找模板,或者是你想做的事情钛,您可以在一个应用程序与脚本间preTER操控一切呢?

Well, its an odd choice of task, but you could always embed an expression language such as MVEL (http://mvel.codehaus.org/) into your app. I'd be VERY curious how it performs, and what you'd want to use it for. Are you looking for templating, or are you trying to do the Titanium thing where you can manipulate everything in an App with a script interpreter?

这篇关于在Android应用程序中嵌入脚本国米preTER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆