How to Compile C Programs from Terminal? - Android Software/Hacking General [Developers Only]

Is there a way to compile c programs using the terminal emulator? I know this should be possible because Android uses *nix and most *nix platforms come with gcc already installed. It doesn't need to be able to use all libraries, just stdio.h and things like that.
Anybody know anything about writing and compiling c programs using android's own terminal?
Thanks for any help you can give!

Related

Help with boot.img

Yeh I am trying to still learn the platform and all so bare with me and I am sorry about asking a noob question. How do I unpack a boot.img file so i can make modifications. I just want to catch up with everyone here and see if i can't help I have looked and only found tutorials for linux. Linux don't play well on my computer. I was wondering if anyone knew on how that I can extract and repack on a windows based computer. Sorry all. But any help would be greatly appreciated. Thank you for you patiance and your time.
i would also like to know this, I have installed linux on a spare drive and now i want to play
bonesy said:
i would also like to know this, I have installed linux on a spare drive and now i want to play
Click to expand...
Click to collapse
Look here http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images
Better use Alternative Method
For linux you need mkbootfs and mkbootimg
I uploaded the tools here http://onlinenovabg.com/voda_rom/mkboot/
happy packing
M9x3mos said:
Yeh I am trying to still learn the platform and all so bare with me and I am sorry about asking a noob question. How do I unpack a boot.img file so i can make modifications. I just want to catch up with everyone here and see if i can't help I have looked and only found tutorials for linux. Linux don't play well on my computer. I was wondering if anyone knew on how that I can extract and repack on a windows based computer. Sorry all. But any help would be greatly appreciated. Thank you for you patiance and your time.
Click to expand...
Click to collapse
Maybe try running Ubuntu or something in a virtual machine. I personally like VirtualBox. If you are looking into doing some of this ROM stuff you will be better off in a Unix environment.
This should help you get it installed.
http://lifehacker.com/5204434/the-beginners-guide-to-creating-virtual-machines-with-virtualbox
You will need VirtualBox (non OSE is better) from here: http://www.virtualbox.org/wiki/Downloads
Ubuntu (or something else): http://www.ubuntu.com/getubuntu/download
Good luck.

"Help" With Creating Rom.

Hello Guys,, Im Going 2 Install Linux " Ubuntu 9.10 " And i wanted 2 know if is that ( operating system ) the 1 i need for making rom's and such.
And if so then could anyone help me with the steps on how to create a rom.
im really getting serious about this soo please help.
and i have a cdma hero "sprint"
Rooted
Recovery Img 1.5.2
Rom: [Rom-dev] (2-18-10) AOSP 2.1 | Sensors Now Work by darchstar
Thankx In Advance
lonnie23 said:
Hello Guys,, Im Going 2 Install Linux " Ubuntu 9.10 " And i wanted 2 know if is that ( operating system ) the 1 i need for making rom's and such.
And if so then could anyone help me with the steps on how to create a rom.
im really getting serious about this soo please help.
and i have a cdma hero "sprint"
Rooted
Recovery Img 1.5.2
Rom: [Rom-dev] (2-18-10) AOSP 2.1 | Sensors Now Work by darchstar
Thankx In Advance
Click to expand...
Click to collapse
You should be okay using Ubuntu 9.10. I currently have that installed, but haven't done anything yet with it. Although, I actually plan on switching to Fedora 12 -- since I'm more familiar with the Red Hat distro's.
If you need help getting started, you should look into these tutorials below, provided and documented by Gbhil from Android Central.
How to create custom Icons:
http://forum.androidcentral.com/htc-hero-roms-hacks/6070-changing-hero-application-icons.html
ROM FAQ/How to Build ROMS:
http://forum.androidcentral.com/hacking/6037-general-rom-faq.html
How to setup Ubuntu for the Android SDK:
http://forum.androidcentral.com/hac...ramming-envrionment-using-ubuntu-windows.html
OR here:
http://www.futuredesktop.org/developing_android_apps_on_ubuntu.html
Gbhil does an excellent job explaining how things work and how to begin your journey with Android development, hope that helps.
I've used the links above to begin making a custom icon pack, and hopefully soon enough another AOSP ROM.
I use Ubuntu 9.10 for everything I do. Make sure you're root user in that by doing these commands in the terminal:
Code:
sudo passwd
*your root password here*
*repeat root password*
Then, log out of that user, and click "other" to log in. Type root for username, and the password you set with sudo passwd for password. Note, Ubuntu 9.10 is also referred to as Ubuntu Karmic or Karmic Koala, so those are the same as 9.10.
Thankx But could you help with more?
When i try to install the Sun's Java Runtime Engine (JRE) and Java Development Kit (JDK) thier both .bin files + i dont understand on how to make them work.
could you help?
lonnie23 said:
Thankx But could you help with more?
When i try to install the Sun's Java Runtime Engine (JRE) and Java Development Kit (JDK) thier both .bin files + i dont understand on how to make them work.
could you help?
Click to expand...
Click to collapse
I don't know about that, I just use the java built into ubuntu.
How did you set up yours then?
Doo you make roms and stuff??
Because i have a dual boot with my win7 and ubuntu
lonnie23 said:
How did you set up yours then?
Doo you make roms and stuff??
Because i have a dual boot with my win7 and ubuntu
Click to expand...
Click to collapse
All the links I gave you will give you the information to get started. Again, follow this think, it even says what its going to help you install:
We are now going to install these programs
• The Ubuntu Linux Desktop.
• Sun's Java Runtime (JRE) and Development Kit (JDK).
Java Runtime is only needed to run the Eclipse IDE. Android has its own optimized Java VM (Dalvik).
• The Eclipse IDE.
• The Android Software Developer's Kit (SDK).
• The Android Developer Tool (ADT), a special Eclipse plugin.
http://www.futuredesktop.org/developing_android_apps_on_ubuntu.html
If you want to test if Java works -- you can run the commands java --version, which java and echo $JAVA_HOME (which java and echo $JAVA_HOME should correctly state where you chose to set your environment variables when you run them). Otherwise you could open a text editor (I use VIM) and write the universal "hello world" in Java and test Java that way to make sure the program runs.
Lastly, everyone here is more than willing to help you -- but try to search for the information via Google, here on XDA, or other Android forums yourself first -- you'd be surprised that they probably already have your answer.
HeroMeng said:
I use Ubuntu 9.10 for everything I do.
Click to expand...
Click to collapse
I don't think Ubuntu 9.10 is bad -- but I've always worked with Red Hat/CentOS and at work we use RHEL servers, so Fedora is an easy switch for me.

[Q] Version control on Android

So, I was thinking about this...
As a Linux distro, any Linux binary application should work (just needs recompiling AFAIK, and some bit of hacking), so why not have some version control stuff on our phone? Let's say, SVN, CVS, Git, or even the google Repo manager!
Would it be possible? Is there anyone who compiled these tools for Android?
Also I am interested in any other tool what is used on Linux, and is compiled for our phones (already found wget, and no, busybox does not count )

[Q] Gb Source Code/ Kernel developers who can work?

Has the source code for the att gingerbread kernel been released yet? And who can maybe work on compiling the new kernel? Ive contacted a few people but no answer... Does anyone have an old computer with ubuntu on it so maybe they can learn how to do it?
a not to my knowledge. Samsung is sometimes late with source code. they were doing good foe a while though.
check opensource.samsung.com
also Ubuntu is such an easy install why would someone give you a PC to get it? its easier than windows. infact you can install it in windows as if it was an application(wubi installer) but if you don't know terminal I suggest a vertual machine. ( sun/oracle virtual box is best IMHO) stumtzy has a ready made virtual environment based on debian somewhere in the i9000 section. plus it'll keep your system cleaner. it doesn't have a GUI but you can apt-get fluxbox or xfce or gnome or whatever.

[Q] How Android kernel and Virtual Machine work

Dear all,
I'm trying to reconstruct the Andriod on my phone. So far i managed to download source code for Linux core including files like "mount, cp, modprobe,...", however I notices thete are other files in /system/bin like "am, pm, ..." which control the other layer of Android OS. How can I download the source code for these kind of files. Also in framework we have "am.jar" which seems to have direct relation to Java VM. Maybe it is better to also ask how Java VM works on Android. I do not ask about general knowledge because more or less I know how it works. Basicly I need to know which files are related to the process of running Apps on Android and what they do.
Best wishes.

Categories

Resources