Hey All,
I'm curious about compiling a native Linux app for the Nexus One, and wondering what the best way is to go about it in Ubuntu. I found this link for the G1:
http://android-dls.com/wiki/index.php?title=Compiling_for_Android
Since the Snapdragon is also ARM I'm assuming this will work, but is there a decent way to do this on Ubuntu or is my best bet to install Debian in Virtualbox and compile it there?
Thanks,
-Dan
overridex said:
Hey All,
I'm curious about compiling a native Linux app for the Nexus One, and wondering what the best way is to go about it in Ubuntu. I found this link for the G1:
http://android-dls.com/wiki/index.php?title=Compiling_for_Android
Since the Snapdragon is also ARM I'm assuming this will work, but is there a decent way to do this on Ubuntu or is my best bet to install Debian in Virtualbox and compile it there?
Thanks,
-Dan
Click to expand...
Click to collapse
There's a certain amount of vagueness associated with your generalized request.
That said ... ubuntu is sooo very very closely related to debian in the linux fam!
Almost all things described in the link your reference will carry-over/hold-true in ubuntu as they are stated in debian.
But ... the real kicker is the specific app you're trying to compile.
Depending on what the app you want to build depends on ... will determine your overall success. While the reference posted link is insightful, you must understand the need to link against libraries being used. Many of these libraries (at least the basic 'c' ones) you'll find in the AOSP code in android's git repo.
I would suggest taking a look at the "external" projects found in the AOSP code to see how they utilize the makefile setup and build-environment and how they leverage bionic and others to build against.
The way those projects build out, would be essentially what you're looking for .. (I assume) again, I state this without knowing the specific app you have in mind.
Hope that helps.
~enom~
How well would a linux disto made for desktop PCs work with touch screen mouse inputs and no keboard support? (im assuming the Android VK doesnt work when you press on a textbox in a Linux Emulator)
enomther said:
There's a certain amount of vagueness associated with your generalized request.
Click to expand...
Click to collapse
Sorry, I should have been more specific - by Linux native I didn't mean any app in particular, I just meant not a java Android app. I'm really just looking to compile a HelloWorld in C and run it at the shell on the Nexus at this point.
My main concern with the link I posted is that although Ubuntu is based on Debian, Ubuntu does not maintain an ARM version, and the package mentioned in that tutorial is not included in Ubuntu because of this.
So I'm just wondering if anyone has come up with a good solution for compiling for the Nexus in Ubuntu, or if I'm better off installing Debian in a virtual machine.
Thanks,
-Dan
http://android-tricks.blogspot.com/2009/02/hello-world-c-program-on-using-android.html
I think this is more of what I was looking for, I'll build AOSP and try out the agcc script.
-Dan
Another idea: find the Android source wherever Google hides it, I have forgotten, sorry! But they give instructions for setting up a whole ARM cross-compiling environment on x86/x64 Ubuntu, and as I recall, it was really easy, quick and automatic! (so easy, I did it just so I could compile some ARM apps myself, I really didn't need to compile Android, I don't build phones! )
After that, you too should be able to compile your own apps into native ARM binaries.
overridex said:
Sorry, I should have been more specific - by Linux native I didn't mean any app in particular, I just meant not a java Android app. I'm really just looking to compile a HelloWorld in C and run it at the shell on the Nexus at this point.
Click to expand...
Click to collapse
To do this, you need a version of the ARM tools appropriate for your platform and then use them for building a static binary for Linux. You can find such tools at CodeSourcery (http://www.codesourcery.com/sgpp/lite/arm). Given that you sound like you have Ubuntu, then the Linux version from this page, http://www.codesourcery.com/sgpp/lite/arm/portal/[email protected]=lite, would be what you want. The key is to use the --static parm when you build the binary.
From there, just get your binary over onto the target and run it from the command shell.
Remember that static binaries are HUGE. They have to include all library functions linked in.
If you are looking for tiny binaries, look into the NDK and use the BUILD_EXECUTABLE rule for Android.mk.
A few more useful links, but not much that hasn't already been stated in previously referenced links:
http://benno.id.au/blog/2007/11/13/android-native-apps
http://honeypod.blogspot.com/2007/12/dynamically-linked-hello-world-for.html
http://honeypod.blogspot.com/2007/12/initialize-libc-for-android.html
I would like to post a general question about kernel development!
Background:
I've started to look into what it take so to develop a kernel of my own, and I'm guessing its no small undertaking even though everything is linux based... which means all the source exists already. I'm learning linux is awesome in that respect.
Question:
Any reason I can't use google's NDK to do development? I've learned it has the necessary cross compiler for the arm... or at least I think it does.
Ok, let me re-word the question.
I downloaded the kernel source from htc for the thunderbolt. The first thing I did was attempt to compile the source on my Ubuntu computer. After setting up the .config file for the thunderbolt, I soon found I needed an arm cross compiler. I also found NDK includes an arm cross compiler.
I downloaded it, modified the Makefile (I know... there are better ways instead of modifying the Makefile) to point to the NDK cross compiler and it compiled.
My question is... is there any reason I can't use the files that resulted (zImage --> boot.img) on my thunderbolt? Just trying to learn. Should I post this somewhere else?
toymachine115 said:
Ok, let me re-word the question.
I downloaded the kernel source from htc for the thunderbolt. The first thing I did was attempt to compile the source on my Ubuntu computer. After setting up the .config file for the thunderbolt, I soon found I needed an arm cross compiler. I also found NDK includes an arm cross compiler.
I downloaded it, modified the Makefile (I know... there are better ways instead of modifying the Makefile) to point to the NDK cross compiler and it compiled.
My question is... is there any reason I can't use the files that resulted (zImage --> boot.img) on my thunderbolt? Just trying to learn. Should I post this somewhere else?
Click to expand...
Click to collapse
Any ARM toolchain should work, though the android NDK is not always the easiest one to use. Best way to see if you compiled it correctly is to test it of course. Back up your current phone state first of course.
Thanks! I'll attempt it.
Main thing I was going for was to avoid the NO do not use the NDK cross-compiler... so looks like it is ok.
I used @viulian's port of PHP 5.3.8 and 5.4.2 of PHP and lighttpd on my Galaxy S2. It ran like a charm on Android 2.3.3.
But since I upgraded to ICS 4.0.3 the PHP didn't run anymore and reported it to @viulian. He discovered he used the wrong compiler switches and recompiled it and it ran again but some functions regarding directories (dir(), scandir() ) don't run properly due to a 64 bits filename problem. This is also described in https://bugs.php.net/bug.php?id=27792 . Thanks, @viulian for your effort ! He could not test it as he has no ICS test development yet.
Now I decided to compile PHP myself. I have downloaded the sources from php.net and installed the Android dev kit with cross compilers and installed the ARM cross compiler on Macports as well (I use a Mac running Lion 10.7, but I have Ubuntu 12.04 in a VMware session if that suits better) .
Can somebody tell me what to do to properly compile PHP myself to make a single PHP binary ?
I cannot find proper answers by googling around.
Hi,
I own a Galaxy Ace 2 running CyanogenMod, with the drivers/firmware from http://bcmon.blogspot.be/ I have working monitor mode/injection.
Included in the package are amongst other applications airodump-ng, aireplay-ng, ...
I wanted to be able to use mdk3 (http://homepages.tu-darmstadt.de/~p_larbig/wlan/) for testing purposes on my phone.
What is the easiest way to compile this (and in the future other) C applications for my phone?
1) Set up a cross-compiling toolchain for Android (Seems pretty difficult, need to re-write Makefiles,...)
2) Compile it on the phone itself (I saw you can chroot ubuntu on Android, so maybe compile it there, and copy the binaries over?)
3) Another way?
Thanks!
I also want one But I don't know how to compile
Hi,
I've been trying to solve an issue with my box Mecool KIII pro. It does not have the driver modules I need for my gamepads (want to make it retro emulation station). Anyways, my best bet is to learn how to compile the whole thing then add the bits I need. I found the buildroot images published by amlogic and found the one for my device. Here is the image for my device:
http://openlinux.amlogic.com:8000/download/ARM/filesystem/Linux_BSP/buildroot_openlinux_kernel_4.9_fbdev_20180211.tar.gz
It has kernel 4.9 which might be better than the current stock 3.4.
And here are the documentations for compiling:
http://openlinux.amlogic.com:8000/download/doc/Linux_BSP_Kernel4.9_Buildroot_OpenLinux_Release_Notes_V20180211.pdf
Now my issue is with gcc. When i install it in installs version 7 something and when I look for versions only 2 versions appear and both version 7. I tried to compile with this version, but after couple minutes it stops with an error.
From what i understand is if i want to get an older version I need to add the server that hosts them to my sources list which I don't have any clue how to do.
I have found the toolchain in question, but not sure how I can get it with "apt-get install":
https://releases.linaro.org/components/toolchain/binaries/6.3-2017.02/
I am at my wits end here and any help would be much appreciated
P.S: It's my first time using Ubuntu, so please bear up with me and be noob friendly as much as you can