I've been following threads on here for a few months, and now I think I want to try to learn more about how Android actually works. I'm familiar with IDEs and coding in general(not my strong point), so I think I could pick up some things pretty quickly. Where would you guys recommend I look for learning to code/tweak Android code*?
I kind of want to be able to say I'm running my own cooked up version of Android.
*please ignore this redundant word choice, please.
rougegoat,
There is a fork in the road right at your starting point, strangely enough. You could choose to study Android application development, or you could choose to look at ROM "development". They are almost worlds apart in both nomenclature, toolsets, and skills; and because of the breadth of skills that are needed in both domains, I have no doubt that there are people that are simultaneously geniuses in one of those areas of expertise, and a numb-skull in the other: that's how far apart they are.
The former is all about Java, Android API's, the "SDK", and an IDE such as Eclipse, and emulators and the device bridge; the latter has a distinct "Unix jock" nature to it: Android "NDK", (or CodeSourcery) toolchains, gcc, make, command-line and shell scripting, understanding dynamic linking and execution environments, and use of configuration management tools (git and repo).
When "code" comes up in the former, it's Java; in the latter, ANSI C (or any other native-compiler language, but C is most typical). In the latter case, if you are building source trees from public repositories, (say Cyanogen or AOSP) initially you won't spend any time at all with C - you'll be spending 95% of your time struggling with with the build environment(s) and trying to wrap your head around the mysteries of "git" and "repo" - and also deciphering Unix shell scripts (typically written in the "Bourne" or "Bash" shell dialect) when things go wrong or are poorly documented. And yes, they will go wrong; effectively diagnosing what happened when things go wrong requires solid Unix/Linux skills.
Your question as posed suggests that you are more interested in the OS/ROM side of things than App development; if that is the case I would suggest you:
-brush up or learn from scratch basic Unix/Linux skill sets (they map over to Android almost 1-to-1).
-If you are a Windows user, download VirtualBox, and create a VM with Ubuntu (8.0.4 or 10x); use developer.android.com as a reference for dependencies and setup. Make sure the virtual disk is plenty big: at least 30-40 Gb. Don't attempt to set up a native development enviroment in Windows/cygwin. ( Windows is a great place for the Android SDK and Android App development, but decidedly not for native code development for Android "ROMs"** ).
-Install both the CodeSourcery and the Android "NDK" (Native Development Kit) in your Linux VM, and try and build a smallish, but multi-file C source-code project that uses Makefiles using both of those toolchains. (Sounds easy, right? Wait till you try anything involving the standard I/O library with the NDK).
-Get your simple project code to run correctly on a real phone device.
- Then, download and build an HTC kernel from their (standalone) source tree - try and do it with both toolchains (CodeSourcery and Android NDK) - simply for the experience of setting up the environments correctly.
- Then, learn the basics of dealing with repo, download an Android source tree and compile it - using both toolchains (CodeSourcery and Android NDK)
- After succeeding with the above, try pulling code from someone else's "git" repository and merging it into an Android build tree - and getting it to build correctly.
The above looks like a pretty short list - but it represents many, many hours of effort. Good luck.
bftb0
** There might be folks that take issue with that statement about ROM-building and Windows. They might tell you, "just download so-and-so's kitchen, and start building ROMs", it works fine under Windows." There's nothing wrong with that, especially because it can be satisfying seeing something of your creation actually running on a phone in a short period of time - but you probably won't learn very much, and when things go wrong, you'll be stumped about how to go about fixing things. The difference between a "chef" and a "developer" is that the former merely assembles together pre-built executable programs and libraries - whereas the latter understands not only how to go about building those things when the sources are available, but also has the opportunity to change them.
Lucky for me that I'm a Slackware guy. I'd much rather learn the system then just have a pretty GUI that does it all for me. That's half the fun of it.
Thanks for the advice, I'll have to try that whole bit out and see where it gets me. A weekend project awaits!
Hey gus i needed a bit of help.I am a computer science engineering studentFor my final year I am doing an android app where you write java code it sends the code to cloud gets executed and output is returned back.Can anyone give an overview on how to implement this?
just a thought.
android already uses java so if the java apps are not very complex you could do local processing. Else, the way i see it, you would need java compiler web services (some linux scripting and php should to the trick) and an android upload app for .java files.
i hope this gives you an overview into the minimal functionality involved into the project.
Hi,
I'm trying to build the default Email app from source.
Using the CM10.2 as base: https://github.com/CyanogenMod/android_packages_apps_Email
I used some patches, which I successfully applied, as this is the main reason of doing this whole thing
At first I tried using apktool but that didn't work out.
Currently I'm struggling with importing the necessary libs in eclipse (adt-bundle-windows-x86_64-20130917; target API 18 aka 4.3.x).
First issue is that even though I am using Google APIs i'm still missing com.google.common. Without google APIs i'm missing the whole com.google...
apparently the app has it's own libs com.android.emailcommon which are provided with the application.
I had to add emailcommon/src in the buildpath because the rest of the app was referencing it.
Problem here is under com.android.emailcommon.service.EmailServiceProxy: IEmailService cannot be resolved to a type. I'm seeing though that IEmailService.aidl exists so why isn't it seeing that interface?
I'd be gratefull for any help here.
Thanks!
bump
please help
any some hint would be nice!
bump?
Hi!
Some guys and me are working on Android now for long time. Most times we had clear different parts we where working on, so two guys working on kernels, one on adaption of Android, one was testing and keeping contact to the community.
Now, cloning a kernel and merging some changes on drivers is a simple thing. And even changing a file on android, putting it into a git or simply on an ftp is easy too...
Well, now things have changed. Android is getting more complex and kernel work is mostly done.So we do more and more work in Android with more and more people.
Ok, one would say, take a plain android by using repo sync. Add your vendor parts for kernel and android and add them as a separate git. Ready you are...
Unfortunately that may work if you build your own device, based on plain naked android and a well supported mainlined kernel... But reality is different and chinese reality is even different^2. Hacking andoid devices where you do not have access to the OEM gits, kernels, not even datasheets or schematics is a hell of work... and all of these OEMs just checked out the complete android, put it in their own git and modified 1000 parts 'n pieces of it.
This isn't only a problem of bandwidth to upload such a monster, but all your friends supporting you have to clone that monster again. And after a while a new android version comes and you have great mess:
You cannot find differences from your old version to the new google version as many files have been changed by the OEM.
But you cant just "repo upload" cause google or CM might not be very eager to get dumb chinese deep down below android changes in their repos.
How do you team up with others and sync your android changes? Is there a good tutorial that handles not only the way it should be, but covers all these real-life issues?
I'd really appreciate your tips
Astralix
Hi guys,
My first time here so if this is the wrong place (I have a strong feeling that this might be true) feel free to move/remove it.
I was trying to build a simple app for android. I'm suing Qt5.4 with qtcreator. This app is meant to calculate some properties of steam (engineering stuff). This app links to a library called freesteam, which in terms links to the GNU Scientifc Library I believe. It runs fine when build for desktop but when using the android for armeabi-v7a it fails with an error saying: "#error Bionic header ctype.h does not define either _U nor _CTYPE_U" .
I was told that this problem is not related to Qt so I started digging around the internet and found out that this might have something to do with some ctype_base.h and ctpye.h from NDK not being in sync (?) with the bionic version of ctype.h.
Any ideas of how I might go about solving this issue?
Thank you for your time and/or any replies.
Have you built the GNU SL with NDK for Android?