This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
n1ghtk1ng's profile picture

Computer Craft iOS/Android Emulator

Started by n1ghtk1ng, 07 November 2012 - 04:07 AM
n1ghtk1ng #1
Posted 07 November 2012 - 05:07 AM
I can barely get on my computer and program on the weekdays due to school work, so I was wondering, could anyone make a CC emulator App for iOS/Android? I have no experience with languages other than Lua, so I couldn't do this. Is anyone else willing to? You could set redstone inputs on/off, and see if a redstone output is on. It would have all of the CC API, etc
EDIT: If we aren't allowed to make an app, you could make a online (in browser) emulator and make smartphones able to use it.
n1ghtk1ng #2
Posted 07 November 2012 - 05:09 AM
Don't know why it multi-posted. Can someone delete the other two unfinished ones?(Won't let me on my iPhone)
PixelToast #3
Posted 07 November 2012 - 05:20 AM
Don't know why it multi-posted. Can someone delete the other two unfinished ones?(Won't let me on my iPhone)
ill report them

this has been suggested and there are lua emulators for phones but that dosent give you any of CC's APIS
porting it to a phone is verry hard to do and its hard to learn how to make apps for iphone because everything is closed source >_>

EDIT:
im not sure if iphones support in browser applets, i know they finally got java script in
Tiin57 #4
Posted 07 November 2012 - 05:58 AM
I am working on making a Lua emulator with CC APIs for Android.
n1ghtk1ng #5
Posted 07 November 2012 - 09:02 AM
I am working on making a Lua emulator with CC APIs for Android.
What about for iOS? :P/>/>
kazagistar #6
Posted 07 November 2012 - 09:07 AM
What about for iOS? :P/>/>
iOS requires that you learn ObjectiveC. Nuff said.
AfterLifeLochie #7
Posted 07 November 2012 - 09:24 AM
What about for iOS? :D/>/>
iOS requires that you learn ObjectiveC. Nuff said.
Getting Lua (which is already based in C) to run in Objective-C isn't something I'd like to think about; Objective-C is a monster I'd like to leave in the closet. :P/>/>

EDIT: If we aren't allowed to make an app, you could make a online (in browser) emulator and make smartphones able to use it.
iOS doesn't run Java applets, and I don't know if Android does (presumably, yes). And on the same side, iOS doesn't support Flash. (Unless you have a jailbroken device; in which case, you can install Java. Don't ask how though.)

The best you could do is possibly JavaScript level emulation, but that's going to be incredibly messy and clunky. The other alternative is server-side Lua (non-interactive programs) that just return the result to the browser. The Lua website actually has a HTML form you can paste and execute code in (and get the printed result). It doesn't support most things, but it's another idea.
rhyleymaster #8
Posted 07 November 2012 - 05:16 PM
There is not BUT there is an app on iOS that allows the use of Lua call "ILuabox".
ElvishJerricco #9
Posted 07 November 2012 - 05:59 PM
What about for iOS? :P/>/>
iOS requires that you learn ObjectiveC. Nuff said.

ObjectiveC has become one of my favorite languages. I learned C before anything else (that was a mistake i'm glad i made) and started into Objective C. I realized I was in over my head and went to Java. After that I came back to learn Objective C and wow it's incredible. Favorite language by far.

EDIT: But yes it is very very different from most languages and not so easy to get the hang of.
PixelToast #10
Posted 07 November 2012 - 07:18 PM
What about for iOS? :P/>/>
iOS requires that you learn ObjectiveC. Nuff said.

ObjectiveC has become one of my favorite languages. I learned C before anything else (that was a mistake i'm glad i made) and started into Objective C. I realized I was in over my head and went to Java. After that I came back to learn Objective C and wow it's incredible. Favorite language by far.

EDIT: But yes it is very very different from most languages and not so easy to get the hang of.
i hate both java and objective C
TOO MUCH COMPILING >_>
y u no like lua with its verry simple compile and load system
ElvishJerricco #11
Posted 08 November 2012 - 11:13 AM
What about for iOS? :P/>/>
iOS requires that you learn ObjectiveC. Nuff said.

ObjectiveC has become one of my favorite languages. I learned C before anything else (that was a mistake i'm glad i made) and started into Objective C. I realized I was in over my head and went to Java. After that I came back to learn Objective C and wow it's incredible. Favorite language by far.

EDIT: But yes it is very very different from most languages and not so easy to get the hang of.
i hate both java and objective C
TOO MUCH COMPILING >_>
y u no like lua with its verry simple compile and load system

Because then people can steal your code if you're selling commercial software. Decompiling isn't possible for most languages and for those where it is, obfuscating usually does the trick. (Nor for minecraft though because of the enormous modding community). Anyways compiling's not really that bad a thing. On a small project it usually won't take but a few seconds. On larger things it can take a while but those are pretty big.
PixelToast #12
Posted 08 November 2012 - 11:16 AM
Because then people can steal your code if you're selling commercial software. Decompiling isn't possible for most languages and for those where it is, obfuscating usually does the trick. (Nor for minecraft though because of the enormous modding community). Anyways compiling's not really that bad a thing. On a small project it usually won't take but a few seconds. On larger things it can take a while but those are pretty big.
sorry i just dont like things that arent open source >_>
Tiin57 #13
Posted 08 November 2012 - 11:17 AM
sorry i just dont like things that arent open source >_>
Nor I, but companies need their money, neh?
ElvishJerricco #14
Posted 08 November 2012 - 11:20 AM
Because then people can steal your code if you're selling commercial software. Decompiling isn't possible for most languages and for those where it is, obfuscating usually does the trick. (Nor for minecraft though because of the enormous modding community). Anyways compiling's not really that bad a thing. On a small project it usually won't take but a few seconds. On larger things it can take a while but those are pretty big.
sorry i just dont like things that arent open source >_>

I understand liking getting free stuff but not liking a quality product because it isn't open source? That's a little crazy.
PixelToast #15
Posted 08 November 2012 - 11:21 AM
sorry i just dont like things that arent open source >_>
Nor I, but companies need their money, neh?
dosent mean they cant give their source code to people that buy it

I understand liking getting free stuff but not liking a quality product because it isn't open source? That's a little crazy.
its not that i dont like the actual product its that i dont like that it cant be decompiled and messed around with

dont be like valve pl0x
ETHANATOR360 #16
Posted 11 November 2012 - 06:42 AM
What about for iOS? :unsure:/>/>
iOS requires that you learn ObjectiveC. Nuff said.
you can also use c, c++ and Lua (yes lua)
n1ghtk1ng #17
Posted 13 November 2012 - 05:44 AM
It looks like porting Lua(and the CC API) is difficulty, why not make a in-browser emulator that also works on the iPhone & Android?
Cranium #18
Posted 13 November 2012 - 05:53 AM
As far as I know, all it would need is a C compiler to make a Lua emulator…but I'm not a programmer, just a lowly scripter, so I don't know for sure. Can't that be put onto either iPhone or Android? From there, it's a simple matter of coding the APIs and other built in programs on the device, right?
matejdro #19
Posted 13 November 2012 - 11:13 AM
Android runs on java, ComputerCraft runs on java. So theoretically, emulator for android would be easiest and more accurate.

But of course that would require author of the app to have access to CC source.


On the other hand, there is not really much you can do without actual block, so project may be as easy as creating (or finding on the internet) basic lua interpreter and then just add CC libraries to it.
prasselpikachu #20
Posted 26 November 2012 - 03:33 AM
Well, there are apps to run Lua on the iPhone (my Favourite: TouchLua) and if there isn't anything what is implemented in ComputerCraft java, it would be theoretically portable.
AfterLifeLochie #21
Posted 26 November 2012 - 09:31 AM
Android runs on java, ComputerCraft runs on java. So theoretically, emulator for android would be easiest and more accurate. But of course that would require author of the app to have access to CC source. On the other hand, there is not really much you can do without actual block, so project may be as easy as creating (or finding on the internet) basic lua interpreter and then just add CC libraries to it.

Indeed: having a mobile emulator for Android would be easy.

In recent weeks, I've created, in conjunction with Tomas1996, a web-based port of CC-Emulator. The possibility that it will, in it's current state, run on an Android device is very low, as it natively targets JRE 1.6 and 1.7 and it makes use of paths and systems that don't exist inside Android phones. Making it work on Android wouldn't be too much of an arduous task, but I don't have one to test with. We are actually having issues with Mac and their versions of AWT in the JRE 7 series, which is putting us behind.

The other problem is that the emulator is designed to run inside an Applet context, and not an application for Android context. The reason we use an Applet context is because it's the easiest (?) way to run LWJGL inside a "framed" (eg, with the menu bar) scenario. I'll dig on a method of wrapping applets inside applications for Android, or alternatively, I'll setup a culture-specific branch of the web port to try and see if it even works inside a browser.
Xtansia #22
Posted 26 November 2012 - 01:30 PM
Indeed: having a mobile emulator for Android would be easy. In recent weeks, I've created, in conjunction with Tomas1996, a web-based port of CC-Emulator. The possibility that it will, in it's current state, run on an Android device is very low, as it natively targets JRE 1.6 and 1.7 and it makes use of paths and systems that don't exist inside Android phones. Making it work on Android wouldn't be too much of an arduous task, but I don't have one to test with. We are actually having issues with Mac and their versions of AWT in the JRE 7 series, which is putting us behind. The other problem is that the emulator is designed to run inside an Applet context, and not an application for Android context. The reason we use an Applet context is because it's the easiest (?) way to run LWJGL inside a "framed" (eg, with the menu bar) scenario. I'll dig on a method of wrapping applets inside applications for Android, or alternatively, I'll setup a culture-specific branch of the web port to try and see if it even works inside a browser.
You spelt my name wrong :P/>/>
The reason using an applet base was because it made it easy to have it in browser.
Porting to android is definitely easier than porting iDevice, for the pure fact of being Java, but there are some major differences between the Android GL library and LWJGL and LWJGL isn't specifically compatible with Android. As well as the differences in 'keyboard and mouse', Not only it could require having to reimplement computercraft to work with Android
AfterLifeLochie #23
Posted 27 November 2012 - 12:12 AM
/snip/
You spelt my name wrong :P/>/>/> The reason using an applet base was because it made it easy to have it in browser. Porting to android is definitely easier than porting iDevice, for the pure fact of being Java, but there are some major differences between the Android GL library and LWJGL and LWJGL isn't specifically compatible with Android. As well as the differences in 'keyboard and mouse', Not only it could require having to reimplement computercraft to work with Android

Yeah, I realize now I spelt your name wrong. At least you found your way here anyway. :P/>

And yeah, I suspect those problems, not just the fact the graphics would need to be re-written, but the potentially hell-spawn code someone would have to write to get everything working.
Jasonfran #24
Posted 27 November 2012 - 05:55 AM
You can't run Java apps directly on an android device they have to be packaged in an APK file. Though they are still partly coded in Java so it is possible. You can swap mouse click events with touch screen events. There are also many Java libraries for android which are based on LWJGL.
Cranium #25
Posted 27 November 2012 - 06:05 AM
Would it be possible to maybe throw out mouse events, and just use a virtual or physical keyboard? I know that touchscreens are not the most accurate of mediums for pointer input.
Jasonfran #26
Posted 27 November 2012 - 06:22 AM
Would it be possible to maybe throw out mouse events, and just use a virtual or physical keyboard? I know that touchscreens are not the most accurate of mediums for pointer input.
If you use touchscreens for a long time you can pretty much click anything, I am quite used to them. I also know that Android devices with a USB port allow the use of an actual mouse and physical keyboard. So you could pretty much port CC or CCEmu over to android quite easily. The way android handles strings and values is very very weird. It doesn't use Java strings it uses a separate XML file to store strings and other values in. That would be one thing that could take a while.
AfterLifeLochie #27
Posted 27 November 2012 - 08:55 AM
Would it be possible to maybe throw out mouse events, and just use a virtual or physical keyboard? I know that touchscreens are not the most accurate of mediums for pointer input.
If you use touchscreens for a long time you can pretty much click anything, I am quite used to them. I also know that Android devices with a USB port allow the use of an actual mouse and physical keyboard. So you could pretty much port CC or CCEmu over to android quite easily. The way android handles strings and values is very very weird. It doesn't use Java strings it uses a separate XML file to store strings and other values in. That would be one thing that could take a while.

The other issue is that we'd also have to re-code most of ComputerCraft as a dependency in order to actually get it to run on Android, and somehow I don't see this happening in too much of a hurry.
snoble2022 #28
Posted 04 January 2013 - 08:40 PM
Or you guys could make computercraft as a mod for minecraft poratble edition
Mads #29
Posted 05 January 2013 - 11:35 PM
Please, tell me more about how you NEED to use OpenGL for this.

You could just write the damn thing in Lua, see Gideros Studio, and just write some extra functions.
GravityScore #30
Posted 06 January 2013 - 02:38 AM
In regard to running Lua in Objective-C, after a quick Google search, this looked interesting - albiet rather simple compared to LuaJ, it looks like it could work, and you would be able to push in the Term API drawing functions using NSStringFromSelector and NSSelectorFromString (example here).

Imma do some testing with this…
jewelshisen #31
Posted 10 January 2013 - 05:16 AM
Have you looked at perhaps using tools like the appinventor by MIT and Google? It MASSIVELY simplifies things and even builds the code for you. Then all you have to do is build the GUI and program how you interact with it. You can even set it up so it scales things based on the size of your android's screen.
nutcase84 #32
Posted 10 January 2013 - 07:17 AM
Anyone made something for this yet?
tesla1889 #33
Posted 07 February 2013 - 01:11 PM
decompiling is always possible. it just might not make it back to the language it was programmed in. All programs that work can at least be decompiled to assembly or higher
ElvishJerricco #34
Posted 08 February 2013 - 11:25 AM
decompiling is always possible. it just might not make it back to the language it was programmed in. All programs that work can at least be decompiled to assembly or higher

Most compiled languages can't be decompiled past assembly. And assembly's pretty useless if you want to see how someone coded something.
Thib0704 #35
Posted 08 February 2013 - 11:27 AM
Well I know that we need to learn objectiveC to develop .ipa , iPhone
Application . But if you're iPhone/ipad is jailbroken wouldn't it be easier ?
Cause IOS is Debian based I think .
ElvishJerricco #36
Posted 08 February 2013 - 12:02 PM
Well I know that we need to learn objectiveC to develop .ipa , iPhone
Application . But if you're iPhone/ipad is jailbroken wouldn't it be easier ?
Cause IOS is Debian based I think .

iOS runs a kernel Apple develops called Darwin. It's based on FreeBSD UNIX, so It's very similar to a stripped down Debian. And when you jailbreak iOS, Cydia adds most of the stuff needed to practically be Debian.
tesla1889 #37
Posted 08 February 2013 - 04:22 PM
–snip–
Most compiled languages can't be decompiled past assembly. And assembly's pretty useless if you want to see how someone coded something.

languages are compiled through common libraries, so if you have the libraries, you can reverse the process

besides, if you know assembly, it is more than enough to know what's going on
1vannn #38
Posted 11 February 2013 - 05:26 PM
If someone would tell how to compile Lua on Mac, I'd love you forever. Sincerely, the person who codes in game.
GravityScore #39
Posted 11 February 2013 - 09:21 PM
If someone would tell how to compile Lua on Mac, I'd love you forever. Sincerely, the person who codes in game.

You have to install Xcode/the iPhone SDK to get the program "make" available in terminal I think. Then you are able to run make on the Lua make file, which generates an executable, which you can run.

If you want to code out of game, I would install a good code editor (Sublime Text 2 is the one I use), then just load your program into CCEmu, then test in that.
1lann #40
Posted 12 February 2013 - 12:01 AM
If someone would tell how to compile Lua on Mac, I'd love you forever. Sincerely, the person who codes in game.
Also note that Lua in the command line doesn't have the fs, shell, term, os and many other apis.
1vannn #41
Posted 12 February 2013 - 12:35 AM
I know, because CC has certain API's. however, I have Xcode, but no 'make' command……… How might this be done on windows then? (Specifically Vistia)
1lann #42
Posted 12 February 2013 - 02:01 AM
I know, because CC has certain API's. however, I have Xcode, but no 'make' command……… How might this be done on windows then? (Specifically Vistia)
There is a windows executable for installing Lua and lots of other languages (ikr, so unfair) but you need xcode's command line tools, which you can get from apple's developer center.
1vannn #43
Posted 12 February 2013 - 09:25 AM
I know, because CC has certain API's. however, I have Xcode, but no 'make' command……… How might this be done on windows then? (Specifically Vistia)
There is a windows executable for installing Lua and lots of other languages (ikr, so unfair) but you need xcode's command line tools, which you can get from apple's developer center.

What have I done! :o/>
theoriginalbit #44
Posted 12 February 2013 - 09:36 AM
just because you have installed Xcode doesn't mean that it will work…

look at answer #2 and/or #3

http://stackoverflow.com/questions/6767481/where-can-i-find-make-program-for-mac-os-x-lion
Sxw #45
Posted 12 February 2013 - 12:06 PM
ios… PSST PSST *cough*codea*cough*
Tiin57 #46
Posted 12 February 2013 - 01:15 PM
ios… PSST PSST *cough*codea*cough*
Codea?
1lann #47
Posted 12 February 2013 - 02:28 PM
Apple developer center: https://developer.apple.com/downloads/
Mads #48
Posted 12 February 2013 - 09:21 PM
Just download gcc and g++, and you will be able to compile it. Very easy, just gather information about wether Lua uses any additional libraries. And if I remember correctly, Lua comes with a Code::Blocks project, which you can just compile with the press of a button.
superaxander #49
Posted 13 February 2013 - 12:32 AM
Well If someone could make a flash one I can use it on iPad with an app called puffin.
nutcase84 #50
Posted 26 February 2013 - 06:54 AM
Is anyone working on something like this? I need this badly so I can test my programs with my Nexus 7.
Skullblade #51
Posted 26 February 2013 - 12:42 PM
Is anyone working on something like this? I need this badly so I can test my programs with my Nexus 7.
no…. i don't think so
FuuuAInfiniteLoop(F.A.I.L) #52
Posted 26 February 2013 - 02:11 PM
And somebody for Blackberry, it runs java natively(version 5 and 6)