So, what i’m working on might not even be possible, but i’m hoping it is. I’ve got a few java files that I really want to add to my xojo project. I’ve tried to import them by dragging them into the interactive shell, but all it does is puts a named alias styled file in the shell, and leaves me with a few questions…
When compiled, does this file get included in its full glory into the xojo program? (i’m hoping so!)
How can I go about targeting this file? I can’t seem to even get the absolute path from it!
I’ve tried a few things, but haven’t had much luck getting anything to work. Again, I know this might not be possible to begin with, but i’m hoping. I really want to keep the java components incorporated into the program.
things dragged into the project like this behave like constants
thats probably not going to behave the way you want
you’d have to write that out to a file on disk then use a shell or something like that to run it (and hope that the JRE is installed etc)
Okay, that’s… somewhat cool! i didn’t realize they behaved like constants. i’m guessing a simple outputstream would be best for dumping them into the hard-drive. Still, mildly disappointing, i was hoping I could keep the java script away from prying eyes.
I know it’s possible on the mac to just drop it into the contents of the .app, and I have a class file to access it, so on a mac, it’s totally do-able, even without tossing it in the application, just not sure how to pull it off inside windows.
… so, to sum up, what im wanting to do is impossible, right? just wanting to know for sure.
the other alternative is to use a copy file step
this eaves them as external resources that you can call via a shell or whatever without having t writ them out
there’s more than one way of getting there from here
not impossible to make it so you can use them
BUT you can’t just drag them into the project & have them be executable
the constant route makes it so they are not just laying around on disk where eye can see them
so that might work best
if its java SOMEHOW it has to get from the app you built into the java run time
And there are means to make that relatively hidden from via - or I think MBS has a plugin that might let you run java from a “string” inside an app
Based on your last reply about wanting to keep things sort of hidden I would juts pull them into the project then figure out how to run those dirtily without having to write them to disk if you can so prying eyes won’t see them
I have absolutely no knowledge of Java, so it may be impossible. But what about placing the file as invisible in a somewhat cryptic folder deep inside the file system when needed, and delete it immediately after usage ?
Son of a… How did I forget virtual volumes!?! /facepalm. Well, your right about mac not being able to protect it, but on that one i kinda just wanted the java file to be inside the app. One of those if they don’t know about doing it that way, they woln’t look things.
Will look into the MBS classes, but if I could accomplish this without using additional modules, etc, i’d really rather do that.
[quote=119572:@David Coffey]Son of a… How did I forget virtual volumes!?! /facepalm. Well, your right about mac not being able to protect it, but on that one i kinda just wanted the java file to be inside the app. One of those if they don’t know about doing it that way, they woln’t look things.
Will look into the MBS classes, but if I could accomplish this without using additional modules, etc, i’d really rather do that.[/quote]
I believe a VirtualVolume is only available within a Xojo app. So the MBS classes seem the only solution.
The disk option is not out, though. If you save your file with a preceding dot, it is invisible.
On Mac at least it is possible to address an invisible file so you could very well do it that way :
There must be ways to hide files in Windows just the same ; I do not know if they can be executed via shell, though. But it is possible you could place them in an invisible folder and still shell to it.
I’m sorry, Christian, i’m not sure what was said to give you the idea that i’m using java to encrypt or decrypt something. Maybe this explanation will help more with why and what i’m trying to do:
I started a few years back trying to write this program, and to do what I wanted it to do, I needed to visually capture and compare elements of a picture to elements of a desktop screen, or program. Now, I did manage to get it running via Xojo (before the namechange that is…) up until the mac os depreciated a function that made it possible. I walked away from the project for a while, and when i returned to the newly dubbed software, the problem still existed, my program wouldn’t run even now.
I looked high and low for an alternative, and found it in the form of a java script. While it is very useful, the simple scripting nature of it prevents me from optimizing and doing multiple scripts at once. I loved Xojo’s ability for multi-threading, and am pretty much wanting to create a program that will allow me to store the java scripts inside the application, and be able to run them, or have access to them. I admit this is more for personal use than anything else, but i’m still of the mindset i’d like to have it included and accessible somehow.
I can’t just re-write the java script into xojo… for one, i don’t understand the java language well enough, and two, it is well above my caliber of programming. However, finding i can call the java scripts via a shell command was fantastic news, so it is something I can use. I do think that virtualvolume might help, but that would be with the MBS java software most likely included.
I do apologize for any confusion I might have caused by not being clearer in the beginning, and I hope this clears things up a bit. I really do appreciate all the help i’ve received so far, you all have been marvelous! Thank you!
Thank you, Michael, that does help. I’ll still try to tinker around with the virtual volumes for storing the files securely, and then if i need to dump them to the hard-drive as needed.