This is for the more skilled and more time than me hackers
who want NetRexx at least as an Interpreter on Android or somewhere. 1) Check out the NetRexx source code 2) Find the open source verion of RuntimeConstants.java I found one at : http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/tools/java/RuntimeConstants.java#RuntimeConstants 3) Place it in /trunk/src/org/netrexx/process Netrexx depends on it in a couple of places. 4) Modify it at package sun.tools.java; to package org.netrexx.process; Why? I am lazy and I do not want create another location or have android dx complain about it. 5) javac RuntimeConstants.java 6) Only need to change 3 NetRexx files Change RxClassImage.nrx import sun.tools.java.RuntimeConstants /** An object that processes class files (or file images). */ class RxClassImage binary- uses sun.tools.java.RuntimeConstants, RxField ##################################### to ##################################### ##### We made our own. ##### /*import sun.tools.java.RuntimeConstants*/ /** An object that processes class files (or file images). */ class RxClassImage binary- uses RuntimeConstants, RxField Change RxProxy.nrx import sun.tools.java.RuntimeConstants class RxProxy uses RuntimeConstants, RxField ##################################### to ##################################### ##### We made our own. ##### /*import sun.tools.java.RuntimeConstants*/ class RxProxy uses RuntimeConstants, RxField Change RxTranslator.nrx near line 620 : javacok=sun.tools.javac.Main(System.out, 'javac').compile(args) end when compilerChoice == "ecj" then do if program.flag.diag then say '# compiling' program.programname 'using eclipse batch compiler' javacok=org.eclipse.jdt.core.compiler.batch.BatchCompiler.compile(args, PrintWriter(System.out), PrintWriter(System.err), null) ##################################### to ##################################### ##### We just want some working junk so Android will not pull these in. ##### javacok=1 end when compilerChoice == "ecj" then do if program.flag.diag then say '# compiling' program.programname 'using eclipse batch compiler' javacok=1 Change RxTranslator.nrx near line 140 : /* [or shared + per-language] */ imports=[String 'netrexx.lang',- 'java.lang', 'java.io', 'java.net',- 'java.util', 'java.awt', 'java.applet'] return ##################################### to ##################################### ##### Android does not have all these anyway. ##### /* [or shared + per-language] */ imports=[String 'netrexx.lang'] return 7) In trunk; make - IT WILL FAIL FIRST TIME. 8) Copy our RuntimeConstants.class to /trunk/build/classes/org/netrexx/process so NetRexx can find it. I know!!! Lazy Hacker 9) Run make again. WORKS THIS TIME. 10) We now have a NetRexxC.jar in /trunk/build/lib for our test project. Create an Android project in Eclipse and add our special NetRexxC.jar to it. Design a gui; add two textView's and a button. Here is my testing nrx code : (Cutting from Potato - You can grow your own now ) package com.agrellum.annetrexx import android.os.Bundle import android.app.Activity import android.view.View import android.view.Menu import android.widget.Button import android.widget.TextView import org.netrexx. trace all class MainActivity public extends Activity implements - android.view.View.OnClickListener method onCreate( savedInstanceState=Bundle ) super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) editText1 = TextView this.findViewById( R.id.editText1 ) textView1 = TextView this.findViewById( R.id.textView1 ) button1 = Button this.findViewById( R.id.button1 ) button1.setOnClickListener( android.view.View.OnClickListener this ) method onCreateOptionsMenu( menu=Menu ) returns boolean getMenuInflater().inflate(R.menu.activity_main, menu) return 1 method onClick(v=View) select case v.getId() when R.id.button1 then this.run_code() otherwise nop end method run_code() programstring="say 'hello from an interpreted memory string';say 5/4 " /*NetRexxC.main("-exec -nocompile -nocrossref -nokeep -nokeepasjava -nologo -verbose0 myprogram",programstring)*/ /*flags=['exec', 'nocompile', 'nojava', 'nocrossref', 'nokeep', 'nokeepasjava', 'nologo', 'verbose0' ]*/ flags="-nojava -nocrossref -nologo -verbose0" /*NetRexxA().interpret("myprogram", programstring, "", "-exec -nocompile -nocrossref -nokeep -nokeepasjava -nologo -verbose0")*/ NetRexxA().interpret("myprogram", programstring, "", flags) #################### Compile;Run; a long time; Crash ###### It is close ####### ########## But like the calendar - stack overflow - time ends ################# ####### Need to understand Android OS internal design ################## _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
And the keys to the kingdom is probably in RxClasser.nrx
Classpath and classes.zip On Android it probably needs to look at the jars in /system/framework/ _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
Hi Jason -
1) Did you have any goal other than proving that the NetRexx interpreter could run on Android? 2) Do you recommend that we add the RuntimeConstants module to the NetRexx source so that the interpreter will run on Android out-of-the-box? (The other changes are not needed, I think.) -- Kermit On 10/26/2012 3:00 PM, Jason Martin
wrote:
This is for the more skilled and more time than me hackers _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
I am just a tired old man that has nothing better to do at the moment.
I see it will work now with ease for someone with the time on Android. I do not think NetRexx itself needs the file. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
Some of the changes I did because Android will pull in a lot of stuff it does not need. ( tools.jar - I think from past attempts.)
I do not think compiling would be useful on the device and parts of Android compile tools are not there anyway. (I think) _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
On Sat, Oct 27, 2012 at 1:57 AM, Jason Martin <[hidden email]> wrote:
I´m not familiar with Android. But why isn´t there an OpenJDK (true JVM) port to Android? is it not feasible?. Does Google not allow third party runtimes like Apple? FC _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
I do not know about another JVM but probably because what they have there already would be duplicated again.
I think the same concept could be applied to the JavaMe phones or some device that could run one of the small vm's like Jam or Sable _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
What I mean is: NetRexx was designed so well that you can put it just about anywhere.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
As far as vision, like Rexx is to OS/2.
I have my device. I have access to most all the API without hacks and adding all the time. And I script away and rule the world from the palm of my hand. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
Later builds of NetRexx (not trunk) use reflection to access the
compilers, so they are not loaded unless used. That was actually
changed to allow the compiler to build on systems without tools.jar
(jdk) or ecj.jar present.
On 10/26/2012 7:03 PM, Jason Martin
wrote:
Some of the changes I did because Android will pull in a lot of stuff it does not need. ( tools.jar - I think from past attempts.) _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
That is great news. I will checkout and retry it when I have the time.
On Sat, Oct 27, 2012 at 1:39 AM, Kermit Kiser <[hidden email]> wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
Hello Jason,
*my personal thanks* for sharing this information here :-) I will definitely need that for an ANDROID Project we are starting 1.1.2013! Rene, may I suggest that you do extract the body of Jason's message and put it on the www.netrexx.org side, please!. Also, I would suggest to open a new *category* on the website named Using NetRexx to program, the ANDROID Handies and Tablets (or so). Therel both the work of Kermit Kiser and Tips and Tricks as Joson's one, below, shall be available *centralized* for the ibnfo of all *NetRexx Users*, I think! Have a nice weekend, all, anyway! Thomas Schneider. ================================================================= Am 27.10.2012 03:00, schrieb Jason Martin: This is for the more skilled and more time than me hackers --
Thomas Schneider CEO ThSITC IT Consulting KG Erdbergstr. 52-60/1/13 1030 Wien http://www.thsitc.com Austria, Europe Skype ID: Thomas.Schneider.Wien Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
In reply to this post by Kermit Kiser
Kermit, Jason:
I would *beg* (for the whole community) to *add the RunTimeConstants to NetRexx. As has been well denoted some time ago, by others, Focusing NetRexx as the primary Language to develop ANDROID Applications might be a good marketing point, for NetRexx, as well. I'm just coming back from the CMG-AE meeting here in Vienna, focussing on Mobile Applications, amongst others: Google is selling 250.000 Android Licences *by DAY*, worldwide, nowadays! Got that info on Tuesday on a speech there :-) Will forward this particular Presentation to the group, when published on the CMG HomePage. CMG is the *Computer measurement* Group, where I'm a member of, since years. Have a nice weekend, Cracy Uncle Thomas. ==================================================================== Am 27.10.2012 06:54, schrieb Kermit Kiser: Hi Jason - --
Thomas Schneider CEO ThSITC IT Consulting KG Erdbergstr. 52-60/1/13 1030 Wien http://www.thsitc.com Austria, Europe Skype ID: Thomas.Schneider.Wien Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
In reply to this post by Jason Martin
Kermit you are right and great work, the after 3.0.1 takes care of Android pulling in extra stuff.
I did not have to make all the changes but what I found is this .... say System.getProperty('java.class.path') returns . say System.getProperty('java.home') returns /system say System.getProperty('user.dir') returns / ************** Here is my problem ************* Running with -diag I get PACKDIRFIND working the whole system and just giving out. I did have to change lib=home||fsep'lib'fsep to lib=home||fsep'framework'fsep in RxClasser for my testing. Android does not have the lib, jre\lib or ext directories as Java knows them. To get the user directory (for your APP only -- security ) in Android I know there some API calls for that. I will play with that some. I also know there is a special 'asset' directory (for your APP only -- security ) you can use too. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Something like this code will fix the PACKDIRFIND loop problem:
if home==String "/system" then do -- try fixup to allow interpret on Android lib=home||fsep'framework'fsep if path=="." then path="/skip/this" end else lib=home||fsep'lib'fsep Unfortunately that will not make it work as NetRexx actually reads the jar files containing the core Java classes in order to analyze program code and those jar files do not seem to exist on Android. You would have to create some kind of replacement jar file to allow NetRexx to find java.lang.Object and whatever else it needs. -- Kermit On 10/27/2012 9:07 PM, Jason Martin
wrote:
Kermit you are right and great work, the after 3.0.1 takes care of Android pulling in extra stuff. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
Most of those classes are there in framework.jar and core.jar and what I found in testing was they are in classes.dex.
Hacking a little and Android refuses to load them again the way NetRexx would want to. You then say hey, life is to short. Go list the files in some platform version of android jar; grep the 3217 class names; replace the $ with . ; write a Netrexx class; bypass most of RxClasser and Android dex stuff; Go feed the one chicken you have left; come back watch the News; and say hey, all that work and they never got pass the 1's and 0's stuff. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Just kidding!
NetRexx WILL DO dex and command it fully. It just involves the one thing users of human oriented languages despise the most. Reading. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
Certainly a version of NetRexx that runs on Android would be worthwhile.
I know very little about Android internals, but based on this Wikipedia entry http://en.wikipedia.org/wiki/Comparison_of_Java_and_Android_API and apparently part of the google/oracle war: http://en.wikipedia.org/wiki/Oracle_v._Google the Dalvic VM was developed, and it is incompatible with the standard Java VM. It seems to me that a separate project for NetRexx Android should be established at the NetRexx archive. There will, of course, be significant similarity for the two projects, but since the executables are .dex files rather than class files I think trying to have a single version may not be the best way to go. The alternative would be to try to have an option which specifies that the dx compiler be used, but I don't think that would be workable. (Of course, I may be wrong - I may be victim of "a little knowledge is a dangerous thing" :) This applies to a version of the NetRexx translator / compiler that runs on Android. Android applications written in NetRexx are no problem since part of the existing Android application development process is the conversion of class files to .dex files. Bill Original Message: ----------------- From: Jason Martin [hidden email] Date: Sun, 28 Oct 2012 15:51:23 -0400 To: [hidden email] Subject: Re: [Ibm-netrexx] NetRexx, Potatoes and the Mayan Calendar Most of those classes are there in framework.jar and core.jar and what I found in testing was they are in classes.dex. Hacking a little and Android refuses to load them again the way NetRexx would want to. You then say hey, life is to short. Go list the files in some platform version of android jar; grep the 3217 class names; replace the $ with . ; write a Netrexx class; bypass most of RxClasser and Android dex stuff; Go feed the one chicken you have left; come back watch the News; and say hey, all that work and they never got pass the 1's and 0's stuff. -------------------------------------------------------------------- mail2web.com - Microsoft® Exchange solutions from a leading provider - http://link.mail2web.com/Business/Exchange _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
NetRexx itself is flexible enough that it does not have to be separate.
It might involve doing some of the work inside the main app and passing it back through with few changes to NetRexx itself. My motive is that when all these devices are being discarded some years from now they can put to use by the average person to keep doing something useful. Pump water, teach the kid and whatever. I do not even own a cell phone or DTV. (I watch free over the air TV with a tuner card and rabbit ears on a junk PC, sometimes without a hard drive) I am really not concerned with "Can you hear me now" or "Plus one" or "LIke this" or whatever the trend is. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
Jason,
I'm talking about a version of NetRexx which is implemented in the Android environment, like running Android on an Android device, or running Android on a PC using VirtualBox running Android-X86 or something like that. The tricky part will be the initial bootstrap process. Certainly the Android version can share many source files with the pc version, but it doesn't make sense to me to have any of the operating system (i.e. Java VM versus Dalvic VM) related nrx/Java class files to be shared. As I said, other views may be valid. Original Message: ----------------- From: Jason Martin [hidden email] Date: Sun, 28 Oct 2012 19:55:20 -0400 To: [hidden email] Subject: Re: [Ibm-netrexx] NetRexx, Potatoes and the Mayan Calendar NetRexx itself is flexible enough that it does not have to be separate. It might involve doing some of the work inside the main app and passing it back through with few changes to NetRexx itself. My motive is that when all these devices are being discarded some years from now they can put to use by the average person to keep doing something useful. Pump water, teach the kid and whatever. I do not even own a cell phone or DTV. (I watch free over the air TV with a tuner card and rabbit ears on a junk PC, sometimes without a hard drive) I am really not concerned with "Can you hear me now" or "Plus one" or "LIke this" or whatever the trend is. -------------------------------------------------------------------- mail2web - Check your email from the web at http://link.mail2web.com/mail2web _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Free forum by Nabble | Edit this page |