Compile and execute programs on Android 2.2 - Android Software/Hacking General [Developers Only]

Hello friends,
I am in need of an installation of gcc such that I can execute the gcc command in the terminal emulator.
My aim is to be successful in writing and compiling programs on my Android (LG Optimus One P500) during travelling and other wasted time.
Thanks.

Probably not exactly what you want but here's the closest I've got for you, http://code.google.com/p/android-scripting/

I'm looking at the same thing on my debian machine and from what i gather the android sdk devel tools along with nvidia's tegra addon give you an arm cross compiler and the include files and kernel headers you'd need.

d0ugie said:
Probably not exactly what you want but here's the closest I've got for you, LINK
Click to expand...
Click to collapse
Thanks for the link. I am trying them out tonight.
gitorious.org/android-toolchain > Someone please try this out and tell me if it works (I will try it out by myself this weekend anyway... So if you have time )

touchqode - mobile code editor and SL4A
I'm not sure if I can post links, but you can search the Internet and/or market to find it. I've played with it for a minute, but plan to use it along with SL4A since they both support Javascript. I don't think Sl4A supports PHP at the moment, but I'm pretty sure it'll be added at some point. I hope this helps.

Topcheese said:
I'm not sure if I can post links, but you can search the Internet and/or market to find it. I've played with it for a minute, but plan to use it along with SL4A since they both support Javascript. I don't think Sl4A supports PHP at the moment, but I'm pretty sure it'll be added at some point. I hope this helps.
Click to expand...
Click to collapse
I am quite satisfied with the range of languages I have. Python + Lua + Perl
My goal was to make g++ and gcc run on Android, but I think I am done for now. Next would be making Debian work for my LG

Related

crazy request - C language compiler in browser?

If this doesn't exist, just tell me but I'd figure this was the best place to ask...
I'm looking for something like a C compiler for Android (please note I mean a C Compiler running ON android, not to compile FOR android). If there's a website that will run on android and will run C code like for learning purposes that would be great too.
Basically I'm learning C by reading on the train, and would love to be able to try my examples rather than just reading them. Appreciate any advice you might have. Worst case I just buy a netbook.
http://www.dignus.com/dcxx/compileit.html
I found this but it only outputs assembly language, which doesn't really tell me if my code is doing what I was hoping for. anything else along these lines?
Thanks again
There's a few websites that let you paste code and compile and run it. One such site is www.codepad.org. They're running in some virtual machine type environment for security purposes.
Another option would be to use something like ConnectBot to ssh to a computer somewhere and run gcc there.
On my Palm I fiddled a bit with OnBoard C. Would be great to get that one ported to Android.
http://onboardc.sourceforge.net/
Or an onboard version of Java for that matter.
[email protected] said:
There's a few websites that let you paste code and compile and run it. One such site is www.codepad.org. They're running in some virtual machine type environment for security purposes.
Another option would be to use something like ConnectBot to ssh to a computer somewhere and run gcc there.
Click to expand...
Click to collapse
Yeah I've considered the remote option, I can always do that. I guess I'm not really going to get a good experience no matter what when I'm on a tiny phone screen without a keyboard, right?
I really do appreciate that site though, that will be nice for playing around at work with.
christine600 said:
On my Palm I fiddled a bit with OnBoard C. Would be great to get that one ported to Android.
http://onboardc.sourceforge.net/
Or an onboard version of Java for that matter.
Click to expand...
Click to collapse
That looks sweet
Hi !
As far as I know, the Palm Pascal Compiler designer (PP and also PIAF and BIRD used by some onboardC users) is coding an onboard compiler for Android. It generates ARM executable code directly.
At this time, the application is not fully functionnal, but it nicely compiles some pieces of ISO Pascal code. It will also include an assembler (the disassembler is working well).
Once functionnal, I think it would be easy to create a C compiler (as it has been done with IZBasic)
Probably a bit late but for any others looking for something similar
berardi said:
If this doesn't exist, just tell me but I'd figure this was the best place to ask...
I'm looking for something like a C compiler for Android (please note I mean a C Compiler running ON android, not to compile FOR android). If there's a website that will run on android and will run C code like for learning purposes that would be great too.
Basically I'm learning C by reading on the train, and would love to be able to try my examples rather than just reading them. Appreciate any advice you might have. Worst case I just buy a netbook.
Click to expand...
Click to collapse
I just found this, it may not be 100% free but give it a look eitherway
https://compilr.com

programming on g tab

First of all, when I searched for doing programming on an android device, I got a kazillion results on programming an android app. I don't want that. Currently, what are the languages that I can write and compile on an android device? Is java one of these?
I've always wondered why noone has posted a static gcc build for android. gcc g++ gcj, they all should cross compile. You might have to enable swap to use them though.
Android basically runs Java. That's the simple answer.
You might find some interesting reading on Eclipse with the google plugins.
If WYSIWYG/RAD environments are more to your liking, check out the "google app inventor."
goodintentions said:
First of all, when I searched for doing programming on an android device, I got a kazillion results on programming an android app. I don't want that. Currently, what are the languages that I can write and compile on an android device? Is java one of these?
Click to expand...
Click to collapse
http://forum.xda-developers.com/forumdisplay.php?f=613
Um, guys, I said I don't care about building apps. I wanted to know if I could write and compile java on an android tablet.
Not quite java...
First, Android doesn't *quite* run Java. It runs Dalvik. That's a tweaked version of Java to help google not use the lawsuit with Sun/Oracle. There's a preprocessor you have to run over he Java bytecodes to get Dalvik code. This is why you can't simply port (or rather, build, given that there's a Linux under there) gcj and use it as is - you need the jvm->Dalvik translator.
The good news is - that runs on Android. There's a Clojure (a JVM/.net language) port for android that uses that translator to run code. While it's not up to building production code, it's fine for writing/testing code on android. I assume the JRuby port also uses it.
If all you're interested in is programming on a g tab, there's lots of options, most notably Google SL4A package (python, ruby, beanshell, sh - I think). But you can find Scheme, BrainF*ck, Pascal, Basic, etc. No Java, but I found at least three languages that run on the Dalvik VM (Clojure, JRuby, and Frink) that let you access some or all of the Android APIs. If you want to explore the Android APIs, one of these will probably work.
Finally, there's IDEDroid. That runs locally, but looks like it exports the compile and execution to their web server. It has support for lots (and lots and lots) of languages - including Java. If you just want edit/run small programs to play with the language, this might be just the ticket. I think I'm going to install it so I can play with haskell....
I wonder. Why in the world hasn't anyone developed a way to write and compile java code on android?
GNU has gcj, I'm fairly certain the same tools you use to compile a kernel would work to make an ARM/Android version.
muqali said:
GNU has gcj, I'm fairly certain the same tools you use to compile a kernel would work to make an ARM/Android version.
Click to expand...
Click to collapse
Could you please clarify? I guess I'm seeing the potential to incorporate the gtab into my work at the lab. Let just say we're a bunch of engineers trying to act like IT programmers. Why hire an honest to god programmer when you could have your engineers lose sleep over trying to program the machines?
So, please could you stop giving me single sentence answers? If I get the gtab will I be able to use it to write, debug, compile, etc. java codes? We've been doing our own things with java and it's too late to switch to something else. I'm sure it's possible, I'm just having trouble finding the answer in search as it seems noone has ever brought this up before. Ever.
Would the following be what I'm looking for?
http://www.getjar.com/mobile/38541/java-programming-for-android-os-all/
So, I take it that it is not possible to write, debug, and compile java code on an android tablet?
goodintentions said:
So, I take it that it is not possible to write, debug, and compile java code on an android tablet?
Click to expand...
Click to collapse
I did mis-understand you initial post on my first reply.
Now that I understand you question, I'm a bit baffled as to 'Why?'
A tablet just doesn't seem to be a very conducive platform to entering and compiling code.
I don't know about any development tools meant to run on android directly. But there are people running ubuntu on their tablets.
Zaphod-Beeblebrox said:
I did mis-understand you initial post on my first reply.
Click to expand...
Click to collapse
I don't understand how you could have misunderstood my original post. Here it is.
I said, and I quote:
First of all, when I searched for doing programming on an android device, I got a kazillion results on programming an android app. I don't want that. Currently, what are the languages that I can write and compile on an android device? Is java one of these?
Click to expand...
Click to collapse
I don't how else I can make it clearer. I'm an engineer, not an idiot. A simple google search turned up millions of links to how to manage android projects on a pc. Why in the world would I be asking this? And I even said I google searched and it turned up nothing.
Now that I understand you question, I'm a bit baffled as to 'Why?'
Click to expand...
Click to collapse
For the sake of convienience... and to baffle my colleagues.
I don't know about any development tools meant to run on android directly. But there are people running ubuntu on their tablets.
Click to expand...
Click to collapse
The whole point of having a tablet is its light weight and the touch screen. I'd like to be able to take it to meetings, take notes with a stylus, show colleagues basic autocad drawings, write and debug java codes for some of our projects, etc. This is not to say I want to use it as my main device. I will still be using either my laptop or my desktop for my projects, but having something like the viewsonic gtab to carry around and do these things seem cool to me.
I'm just baffled why there hasn't been an app development to run/compile java code on the android OS.
Here is a Online IDE that works pretty good (not for java): http://www.coderun.com/ide/
Or
This one will let you compile and run just about anything including java: http://ideone.com/
Sure glad I tried to help.
Prick.
Zaphod-Beeblebrox said:
Sure glad I tried to help.
Prick.
Click to expand...
Click to collapse
Yes, I'm a prick. I fully admit this. This attitude came from years of experience with 1337s online. When I first started getting into linux, and this was back in the days when there was no visual interface for installation and you had to type in a dozen commands for every step of the way while it asks you for the specific models of your peripherals, I searched for several days on solutions pertaining to a problem I ran into. After being fairly confident that there was no answer to it, I signed into a linux forum and asked about it. I got a couple one-liner answers that made no sense, a couple answers that assumed I was an idiot so they answered the wrong thing, and half a dozen "you're an idiot, go away" answers.
My first rule of thumb is if you could interpret a person's question at least 2 ways, then without further info assume the interpretation that doesn't include assuming the other person is an idiot. And this is for an obscure question. My original post clearly stated I was talking about debuging and compiling java on the android tablet itself. I specifically worded my question like that because I knew people were going to assume I was talking about the thing you assumed.
This 1337 attitude online is getting old.
the3dman said:
Here is a Online IDE that works pretty good (not for java): http://www.coderun.com/ide/
Or
This one will let you compile and run just about anything including java: http://ideone.com/
Click to expand...
Click to collapse
Thanks. I guess this is what I will have to go with for now. I'm sure I'm not the only one who has thought of this before. Surely, if you could run it on a linux distro such as ubuntu, then I'm sure it's possible to do the same thing on a different OS that runs on the same processor. Why in the world hasn't anyone come up with this yet?
goodintentions said:
Why in the world hasn't anyone come up with this yet?
Click to expand...
Click to collapse
Sounds like its up to you to save the day!
adampdx said:
Sounds like its up to you to save the day!
Click to expand...
Click to collapse
I'm a materials/structural engineer who's an amateur programmer. I practically live in my lab. Sure, the other engineers often look at my programming work with oohs and aahs, but I assure you they look like something put together by an idiot if you're a software engineer. Something like this is several miles above my head. Most of my work look like spaghetti code anyway.
goodintentions said:
I'm just baffled why there hasn't been an app development to run/compile java code on the android OS.
Click to expand...
Click to collapse
B/c any real programmer would probably blow a hole in his head trying to write/debug code on a tablet.
HKChad said:
B/c any real programmer would probably blow a hole in his head trying to write/debug code on a tablet.
Click to expand...
Click to collapse
The same could be said about autocad, and yet there is an autocad app for it, given that the capabilities are limited.

c++ compiler for android?

hi, guys i know that i can compile c++ on android and even test it, but i cant find the right app, so help me, in market theres a c4droid compiler but it costs, so anyone can help me find free c4droid app or find other good comiler of c++?
well.... I've seen the app that sends file to server and compile there, so you need internet access. Few weeks ago wanna to download such app but can't find app that use libraries from SDcard and compile on phone...
I was searching for a c++ complier but i didn't fine one. I needed it for school.
sourceLair?
nedosas said:
hi, guys i know that i can compile c++ on android and even test it, but i cant find the right app, so help me, in market theres a c4droid compiler but it costs, so anyone can help me find free c4droid app or find other good comiler of c++?
Click to expand...
Click to collapse
Use a DOS emulator like aDosBox. There's just some problems with some special characters (like < and >) while using the onscreen keyboard but the compiler for Windows/DOS runs well. I just edit the source codes with other text editors.
Theo's idea is pretty sound. Sounds like your best shot at the moment. I was going to provide you pretty much the same information
nedosas said:
hi, guys i know that i can compile c++ on android and even test it, but i cant find the right app, so help me, in market theres a c4droid compiler but it costs, so anyone can help me find free c4droid app or find other good comiler of c++?
Click to expand...
Click to collapse
me too. i need a c++ compiler for studying, however i have a question: if we have a c++ compiler, does it work well.
Hi, the gnu tools provide full source code for most architectures with c++, you could try cross-compiling them and automake for your platform (most probably arm7 abei). also read this thread http://forum.xda-developers.com/archive/index.php/t-623976.html. Also there are tutorials scattered all around the web for cross-compiling, which unless you want to write your own C++ compiler in dalvik VM would be the best direction to go in at the moment.
SlideR270295 said:
I was searching for a c++ complier but i didn't fine one. I needed it for school.
Click to expand...
Click to collapse
If you are in college you can get visual studio for free.
Sent from my PG86100 using XDA App

GCC make for Android?

Hello everyone. I'm looking for a way to use gcc make natively on Android. I know would supposedly be slow and heat up my cpu, but I don't get enough time on my computer to develop via a cross compiler.
Something like this would be ideal:
http://forum.xda-developers.com/showthread.php?t=1645182
I'd post there asking about a download link but the forums won't let me until I've made ten posts.
If anyone has any ideas how to get this working I'd love to hear them!
I found a gcc binary here:
rwiki.sciviews.org/doku.php?id=getting-started:installation:android
I don't know what version it us but it seems to run. I think I will try compiling gcc from scratch.
Can bionic libc be replaced with the full version of libc? Or would that break things?
Next up I think I'll try to get bash on this phone.
I'll post an update when I have gcc fully working.
I've found an app that does most of what I needed, called Terminal IDE on the play store. I now have a mostly functional development environment on my phone.
Next up, some of the open source software I want to port uses autoreconf, which is part of automake. Unfortunately, automake needs access to /tmp/ during configure, which doesn't exist. I guess I'll just have to edit the configure file on my PC and point it to a path that's accessible.
Does anyone know of an automake binary for Android?

Java (jre) on Surface RT

So I have a question?
Is there a way to enable java on the surface rt.
Because for my remote access to work I need JRE.
Thanks
I wanna know this too. Need to be able to play Yahoo Games when I'm bored ?
Not yet but Java exists on everything pretty much... I'm sure at some point someone will recompile it for Windows RT
There's two ways I could see this happening.
The simplest would be for somebody to take the Java source code, build it for Windows but target ARM, then sign it and tell people to go through the hoops needed to run third-party desktop-mode apps on RT. This would probably actually be pretty easy, if Java has a target for "use ARM instructions" in its JIT. If not, it would have to interpret the bytecode, which is very slow (although usable).
The second way is for the JRE to be built as a Metro-style app. It would probably have to hook a bunch of native APIs that aren't allowed in Store apps, so it would remain as homebrew, but it could be packaged as an APPX and would be easy enough to install. It would be both more difficult to port and possibly more of a hassle to use, though. With care and luck, it might even be possible to get it submitted to the Store, though, which (combined with setting it up as a file handler for .JAR) would make it widely usable. I doubt MS would approve it, though.
GoodDayToDie said:
There's two ways I could see this happening.
The simplest would be for somebody to take the Java source code, build it for Windows but target ARM, then sign it and tell people to go through the hoops needed to run third-party desktop-mode apps on RT. This would probably actually be pretty easy, if Java has a target for "use ARM instructions" in its JIT. If not, it would have to interpret the bytecode, which is very slow (although usable).
The second way is for the JRE to be built as a Metro-style app. It would probably have to hook a bunch of native APIs that aren't allowed in Store apps, so it would remain as homebrew, but it could be packaged as an APPX and would be easy enough to install. It would be both more difficult to port and possibly more of a hassle to use, though. With care and luck, it might even be possible to get it submitted to the Store, though, which (combined with setting it up as a file handler for .JAR) would make it widely usable. I doubt MS would approve it, though.
Click to expand...
Click to collapse
I guess that the source isent available. And the open source version for Linux would be quite hard to port right?
filfat said:
I guess that the source isent available. And the open source version for Linux would be quite hard to port right?
Click to expand...
Click to collapse
Actually, it is available.
---------- Post added at 10:42 AM ---------- Previous post was at 10:38 AM ----------
GoodDayToDie said:
There's two ways I could see this happening.
The simplest would be for somebody to take the Java source code, build it for Windows but target ARM, then sign it and tell people to go through the hoops needed to run third-party desktop-mode apps on RT. This would probably actually be pretty easy, if Java has a target for "use ARM instructions" in its JIT. If not, it would have to interpret the bytecode, which is very slow (although usable).
The second way is for the JRE to be built as a Metro-style app. It would probably have to hook a bunch of native APIs that aren't allowed in Store apps, so it would remain as homebrew, but it could be packaged as an APPX and would be easy enough to install. It would be both more difficult to port and possibly more of a hassle to use, though. With care and luck, it might even be possible to get it submitted to the Store, though, which (combined with setting it up as a file handler for .JAR) would make it widely usable. I doubt MS would approve it, though.
Click to expand...
Click to collapse
Oracle do now offer ARMv6 hard float (which is then compatible with ARMv7) as a JIT option, it is standard software in raspbian on the raspberry pi as of a few weeks ago, in fact that is why they added that support. Now if only regular ARMv7 code worked on RT instead of THUMB_2. Don't know if java will actually build under visual studio either, funnily enough googling for any combination of "compile" "java" and "visual studio" gets you results for compiling java source code to the JRE under visual studio rather than compiling the JRE itself
---------- Post added at 10:45 AM ---------- Previous post was at 10:42 AM ----------
binnym said:
So I have a question?
Is there a way to enable java on the surface rt.
Because for my remote access to work I need JRE.
Thanks
Click to expand...
Click to collapse
You would need a jailbroken RT, that isn't hard (look in windows RT development and hacking, pinned thread right up top).
Then you would need the JRE which doesn't exist.
Its slow and incompatible with a fair amount of software but if you get as far as jailbreaking your RT you could *try* IKVM, its a java virtual machine running ontop of .NET and does work on RT. It can't be used as a browser plugin though so your remote access would need to be a standalone .jar rather than a web applet.
SixSixSevenSeven said:
Actually, it is available..
Click to expand...
Click to collapse
Well, Do You Have Any Links? Want to test if I can get it to compile... yes I know, im giving away freedom
Why yes, I have a link:
http://letmebingthatforyou.com/search?q=get+jre+source+code
Rule number one of the forum, please follow it!
GoodDayToDie said:
Why yes, I have a link:
http://letmebingthatforyou.com/search?q=get+jre+source+code
Rule number one of the forum, please follow it!
Click to expand...
Click to collapse
Let me bing that... lol, seen the google version before but not the bing one.
GoodDayToDie said:
Why yes, I have a link:
http://letmebingthatforyou.com/search?q=get+jre+source+code
Rule number one of the forum, please follow it!
Click to expand...
Click to collapse
I cant find it, that's why I asked. I have ofcourse already searched
SixSixSevenSeven said:
... you could *try* IKVM ....
Click to expand...
Click to collapse
He is right. I was suprised, how well that works
I run the Jdownloader with IKVM and only the initial loading time is long (about 2-3min). After that it runs very smooth.
Its def. worth a try, bro :good:
I wonder if IKVM would be fast enough to run Minecraft on the SRT or S2...
It would be ironic if the only major tablet platform that Mojang refuses to support ended up being the only platform with the complete game.
I wonder if people will *ever* learn to do even a cursory search before posting? People have been talking about that literally since the first release of the jailbreak. The forums are littered with it.
Speed is the least of many problems (although I suppose the OpenGL issue has sort-of been resolved, albeit with yet another hit to performance).
GoodDayToDie said:
I wonder if people will *ever* learn to do even a cursory search before posting? People have been talking about that literally since the first release of the jailbreak. The forums are littered with it.
Speed is the least of many problems (although I suppose the OpenGL issue has sort-of been resolved, albeit with yet another hit to performance).
Click to expand...
Click to collapse
LWJGL doesnt load in IKVM on x86 though.
Hey everyone,
There is already a version of Java for ARM-based architectures. I don't know if it will run with Windows, but
as soon as i'm gonna get the RT, i'm gonna try it
TheRinseM said:
Hey everyone,
There is already a version of Java for ARM-based architectures. I don't know if it will run with Windows, but
as soon as i'm gonna get the RT, i'm gonna try it
Click to expand...
Click to collapse
Just because there is java for ARM based architectures doesnt mean its for windows, it specifically has to be for windows actually (which it isn't).
Not to mention it's compiled for the ARM instruction set, rather than the THUMB2 instruction set that RT actually uses. The CPU can run both, but RT will make non-THUMB code crash.
GoodDayToDie said:
Not to mention it's compiled for the ARM instruction set, rather than the TUMB2 instruction set that RT actually uses. The CPU can run both, but BT will make non-THUMB code crash.
Click to expand...
Click to collapse
Icedtea has a thumb2 JIT, but its for linux of course
Huh. That's still a bit promising. We would still need to recompile it for Win32/NT, but at least we wouldn't have to re-write the whole JIT.
Major project anyhow. Even if somebody with the requisite knowledge stepped up to start this right now, it would be a while before it bore fruit. Doesn't mean it shouldn't be attempted, but don't hold your breath. In fact, don't expect anything at all, unless somebody says they're able to take this on.
Anyone here wants to team up and try?
i would really love Java on my Surface.
edit: http://icedtea.classpath.org/hg/icedtea6/rev/748156804502

Categories

Resources