I'm aware of the android-x86 project and as far as the end result (bootable live/install iso), I am looking to do the same thing. The difference is, I'm looking to do this with the ice cream sandwich branch from android master repo. Ice cream sandwich adds full support for x86 hardware and even sports a build target specifically for running the OS in virtualbox. So my question is, is anyone aware of any documentation for building and deploying to that target?
Just in case it's not clear, I'm not just using the android-x86 project because they haven't yet put up a build for anything later than android 3.
Okay so I was going to just delete my question because a few minutes after posting it, I found a tutorial! So, I figured I'd share this info here rather than just deleting, since that's a bit of a waste. Here is a link, plus an excerpt from the tutorial in case the link is ever lost:
http://ricston.com/blog/?p=1705
The second approach gives you direct access to the latest Android
code. However, it’s barely documented due to the fact that previously
you couldn’t build ‘out of the box’ an Android VDI (Virtual Disk
Image) with the AOSP. To build the Android VDI and install it in your
VM, follow these steps:
Get the Android source code from the AOSP site and follow the online
instructions to setup the environment.
When you are ready to build the project, execute the following command to set the environment variables for Make: “lunch vbox_x86-eng”.
Run “make installer_vdi” to
build the project. Make will build the project and produce a VDI named
“installer.vdi” located in “out/target/product/vbox_x86″. This VDI
contains Android plus its installer.
Create a Linux VM and add the
“installer.vdi” as an extra HD to the VM.
Start the VM and press “F12”
during bootup.
Select the HD which represents the “installer.vdi”.
Choose the first option, that is, “Android Install to /dev/sda from
/dev/sdb”.
When installation is complete, enter the command “reboot”.
After that, you should be able to launch Android from your VM.
I want to expand on this approach and end up producing a live CD rather than a VDI so I'm going to post this answer as a community wiki so it can be expanded by myself and others in the future.
Edit Nov 26/11
The above method of building right from the source alone is lacking features like proper keyboard and mouse support. Here is a link to an article (in Japanese but you can use google translate) of an individual who has compile the ICS sources with added in keyboard, mouse and network support. http://d.hatena.ne.jp/td2sk/20111125/1322192772
The precompiled VDI disk can be downloaded from here:
http://kie.nu/26G
Related
I am currently building custom images using the Android Open Source Project. I would like to send these custom images (system.img, ramdisk.img, cache.img, etc.) to a friend so that he/she can run them without having to compile the entire AOSP branch. Note that they "do" have the latest official Android SDK (not AOSP).
Is there a way to do this? Ideally, I was hoping for some make target that already exists where I can simply run it (make avd-package) and an "avd" (or something close to it) would pop out so that I can just send it to my friend and have them type:
emulator -avd
Also, from my research, the fact that I want these images to be runnable by the normal Android SDK (not AOSP) might present a problem since the tools in the Android SDK are different than the ones in AOSP (e.g. qemu versions, etc.). Would I also need to send my friend the emulator binaries as well?
Thanks!
Yes, it is doable. You need to create some metadata and upload it to a public server so that your users can get the URL. This is the URL they can then enter in Android Studio for using it with the SDK Manager tool.
For full instructions follow the official docs here: https://source.android.com/setup/create/avd
I followed the instructions in the cyanogenmod wiki page to build a custom ROM for grouper (Nexus 7 wifi only model). However, the CM-DATE-UNOFFICIAL.zip file is not created. I get this error message --
No private recovery resources for TARGET_DEVICE grouper.
I followed the answer in this link to add below line
TARGET_KERNEL_CONFIG := cyanogenmod_grouper_defconfig
to ~/android/system/device/asus/grouper/BoardConfig.mk and did "make modules" and "make grouper_defconfig", "make grouper" to no avail.
From further research, I found that I might be missing the kernel. I followed the android documentation on building the kernel. However, this also did not solve the issue (I might have not placed the kernel at the right location). Can someone tell me what I am missing?
I was able to generate the zip file. The main issue was that Ubuntu by default uses OpenJDK while Cyanogenmod needs Oracle JDK. Downloading and using Oracle JDK and following rest of the steps mention in this xda-developers forum thread generated the zip file. Also make sure that you have plenty of swap space (atleast as much as your ram or twice of that if possible)
Another thing that is not mentioned in the wiki for building Cyanogenmod is that the kernel has to be built first. I followed this link to build the Android kernel.
I have been working with standard android for some time. Recently I have been building android sdk for windows and find some interesting things in Android build env. There is a command called lunch which can be used to list all available targets to build. However, it does not list sdk and its variants,even though they are valid options.
Does anyone know why is that the case?
Also can I build any specific module in Android sdk without building the whole sdk. (It could be a great help as I dont wanna build the whole sdk, if I gonna do a small change in one component.)
Thanks
Under the hood, lunch uses make, so if some pieces of SDK do not change, they won't be rebuilt.
My speculation about your first question: rebuilding SDK was never considered a major task of lunch. It is most often used to port or mod the system and produce an installable system image, and receive the ADK as by-product. Later, people realized that often (with root access to the device) you can iterate over one component without need to reinstall the whole system image.
I've been using eclipse to develop Android apps with phonegap until, a few weeks ago, I decided to try Sublime Text 2. I found it to be so much better than the eclipse editor so I would like to keep using it. Only thing I'm missing is a quick way to test the app on the device inside Sublime.
Luckily, someone else also had the same idea and developed a plugin for this:
https://github.com/Korcholis/Andrew
Sadly, I cannot get it to work, I installed ant and pointed the plugin to adb but then nothing happens when I try to create a new project (and there is no error message in the console).
I also found this other plugin:
https://bitbucket.org/ucomesdag/sublime-android
But I have no idea on how to install and run it.
Did someone else found a way to do this?
A quick update into 2014.
As of PhoneGap Cordova 3.0, it is no longer required to develop Android apps via eclipse. You are free to use any code editor or IDE you wish as app building is done independently from eclipse via a simple command line.
cordova run android to package the .apk and install on any active devices detected by adb or
cordova build android to package the .apk only.
In your case, you can keep using Sublime and pop in the cordova run android command whenever you ready to go on a test run.
While I agree with Insane Coder that you should stick with supported IDEs to develop for Android, according to this link and existing Sublime Text 2 Ant support, you could build and develop your android project with this IDE (It will just take some time to set it all up... as opposed to using a supported IDE like IntelliJ or Eclipse).
Using PackageControl, look for "Ant". That will install syntax highlighting for Ant. Another plugin that enables the build command (ctrl+b) to work for Ant files, "Super Ant". You should be able to code for android in sublime text 2 with those installed.
On another note... Do you use windows? The Andrew project you link to, seems to have Windows compatibility issues. Apparently related to locating the "SDK" (he says sdk in Andrew's github page but, probably he means JDK?) in your hard drive. Which is probably a hassle because Windows typically installs stuff to "Program Files" and in code, that turns into "Progra~1" because of the space. In the link I give you there is another approach to it, so when you install the JDK set a folder that has no spaces in its name, like c:\java\jdk1.6.0_02 or something else that strikes your fancy. The problem you could be having with Andrew is that it isn't finding the jdk in your hard disk.
the Java sources for the Android framework are available at source.android.com. Can I download and feed them to Eclipse so that I can step into framework methods while debugging? Better yet, does anyone know of an Eclipse plug-in that would get them from Android Git automatically as needed?
EDIT: during debugging, I can step through the framework code; I can see local variables by their declared names, and line numbers as well. It seems like the debug info is already there - only the source file is missing. While I can open it in parallel and watch the execution unfold, the question of version matching remains. Of many versions of the class file in Git, how do I pick one that matches whatever is running on the device (or emulator)? This is more of a Git navigation question - how do I pick up the very version of the file that went into Android release, say, 2.2?
EDIT much later: now sources come prepackaged with Android SDK. This question is somewhat obsolete.
This article nicely explains how to accomplish this: http://android.opensourceror.org/2010/01/18/android-source/