Developing Android on Windwos - Android Software/Hacking General [Developers Only]

Attached is what was my missing link to full Android development in Windows.
1. For Android Java or C++ cpde I use Win + Eclipse + Android SDK+NDK
2. For Android System.img editing and building Entire Android system I use the following:
Developemnt Overview and purpose of this utility
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a. You do not need to install anything on your windows
machine, if you like you can just copy it to a USB drive and
run it from there.
b. You can use this to build an entire android system and images,
or just modify system.img if you like.
1. Download QEMU for Windows. (google for it Aprox 3Mb)
2. Download QEMU Debian Image. (google for it Arox 150Mb)
3. Run QEMU and use aptitude to download g++, make and other
Android build requirements as mentioned on the dev site.
4. Build Android system or just edit system.img.
By transfering files to/from host windows system....
This is where this Utility is used as ftp'ing from
QEMU to the host system will not work with a regular
ftp server.
To transfer files from QEMU to Host do the following:
Windows: Run Ftpd.exe
QEMU: $ pftp 10.0.2.2 and log in as ian
Now you can use ftp command to send and recieve files to/from
QEMU and Windows.
5. Transfer system.img or entire adriod build image to Device and
follow device flashing procedure.

Related

[GUIDE] [15/12/11] How to run Ubuntu within Android on Desire S

I will no longer be updating this guide, to keep up to date with the project please see the App thread HERE. The Free app can be downloaded HERE and the Paid HERE
First and for most this guide has been created from a mixture of a few guides to get it all working on our phone, I do not take any credit for the methods all I have done is taken the time to work out how to get it working on our phone. This guide is for windows or can be done all on the phone. Anyway on with the guide
How To Install Ubuntu on the Desire S
Before we start you will need a ROM and kernel that supports loop devices.
This works best on lighter roms like cyanogenmod 7.1, however if you don't want to run a GUI it also works fine on sense ROMS. Please post any ROMS it doesn't work on.
It is also recommend that you have the Android SDK install so that you can access adb however all commands can be done on the phone via the terminal emulator
Also make sure that you have debugging mode enabled Go to Settings->Applications->Development and make sure USB Debugging is checked ON.
You will also need atleast 4GB of memory card space
Download and extract ubuntu.zip
Once you have a working ROM with loop support you must now download the special modified ubuntu image. I have hosted the file on my own server however if this is not quick enough feel free to mirror it or message me and I shall host else where as well.
There are now three versions to use as you wish, however the new 10.10 image has pretty much everything working, see change log at the bottom of the next post. the 11.10 image's UI does not work right and the 9.04 image is well rather old
[*]10.10 image V3 (Recommend)
[*]10.10 image V2 [*]10.10 image OLD
[*]11.10 image
[*]Old 9.04 image
Once you have downloaded this .zip file you will need to extract it to a folder on your sdcard name this folder "ubuntu".
Install and run Ubuntu!
If you do not have the android SDK install or wish to do all the commands via your phone please skip to step 7
1) Connect your Desire S to your computer via your USB cable and make sure USB mode is set to “Just Charge”.
2) Your Android device should be recognized as “ADB Device” under Device Manager. If not, install appropriate drivers.
For all HTC Android smartphones/tablets (such as G2 Phone, Nexus One), you can download Windows drivers here:
HTC Windows 64-bit driver download – Click Here to Download Driver
HTC Windows 32-bit driver download – Click Here to Download Driver
3) Now open a command window and navigate to the directory that you have installed the android SDK for example
Code:
cd c:\android-sdk
4) From here then navigate to the platform-tools directory
Code:
cd platform-tools
5) Now type “adb devices” to double-check your Android device is recognized. It should display something along the lines of
Code:
Lists of devices attached
HT09SR204261 device
If not then you have not installed the drivers for your phone or it is not in debugging mode.
6) Next type “adb shell” to enter the Android shell
7) Now type su to enter super user mode, then type cd /sdcard and then cd ubuntu to enter the directory on the SD card that you stored the ubuntu files.
Code:
su
cd /sdcard
cd ubuntu
8) Then type sh ubuntu.sh this will run the included script to ready your ubuntu image, do not worry about any error messages that are displayed!
Code:
sh ubuntu.sh
8.5) If running the 10.10 V2 image you should get this message 'please wait while booting the ubuntu img, please wait as this could take a while.' if you do get this then ubuntu is running and you just need to open vnc and connect to get into ubuntu. Please see the bug section on the third post for more information!
9) Now type bootubuntu to enter ubuntu (note in the future to start ubuntu simply type bootubuntu there is no need to run the script again)
Code:
bootubuntu
You should now see something along the lines of
Code:
[email protected]:/#
If you don't then its likely the ROM your using does not support loop devices and you will need to install one of the ROMs from the top of this guide to get it working.
And thats it you now have a working ubuntu command line running within android! however this isnt really much use so lets now get a more useful system running
How to Install TightVNCserver
This is by far the best program to install first off as it will let you access the GUI of Ubuntu as it run on your Desire S. (note this is already included in the 10.10 (V1 and V2) image there is no need to carry out this step)
0) Before you install any program first we need to update by typing
Code:
apt-get update
1) Now type “apt-get install tightvncserver” to install the VNC server.
it shall then as you if you wish to install the program etc etc say yes and it will install, simples.
How to Install LXDE (optional but recommended)
only need to carry out this step if you are using the 9.04 image
1) Type “apt-get install lxde” and ubuntu will do the rest
Set up TightVNCServer and fix keyboard issues
(note on the 10.10 image this step has been included already! so no need to carry it out)
Before we launch the TightVNCServer we much make changes the the xstartup file to change to it uses LXDE if we want this and also to fix a big issue with the android keyboard not being mapped correctly.
1) Start off by typing
Code:
cat > /root/.vnc/xstartup
To open the file we need to make changes in
2) Now type
Code:
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
export XKL_XMODMAP_DISABLE=1
icewm &
lxsession
The last two lines you will only want to type if you have installed LXDE if you want to use XFCE leave these lines off. The line above this (export XKL_XMODMAP_DISABLE=1) is what is needed to fix the keyboard mapping.
3) Now press ctrl+D twice and then press enter to the save the file, we are now ready to start up the VNCServer!
Start TightVNCServer
Now we are ready to start the server and connect our phone or windows computer to the Ubuntu running within our phone! (This step is not needed in the new 10.10 V2 image VNCserver now auto starts)
1) Start off by typing
Code:
export USER=root
vncserver -geometry 1024×800
you can change the resolution settings 1024×800 to the resolution of your liking. I find 800x480 does work well but limts your work space so its up to you.
2)TightVNCServer will then ask you for a password to connect to it, fill this in and your server will be then ready to accept any incoming connection from your phone or computer! (on the 10.10 image it will not ask for this, the password is set to ubuntu)
Connect to VNC on your phone
1) download the free app Android-VNC-viewer
2) open the app and set your IP address to 127.0.0.1 ( set this to localhost in 10.10 V2) and port number 5901 (5900 in 10.10 V2)and enter the password you set before (or ubuntu on 10.10 images) to then connect.
If all works right you will have a working GUI!!!
Connect to VNC on your computer
1)Start by downloading the desktop version of TightVNC Here
and install it
2) Open the TightVNC Viewer from the start menu it will ask for your phones IP address, to find this type ifconfig in your ubuntu terminal it will display your IP.
3)Type this into TightVNC and remember to add the port 5901 (5900 in 10.10 V2), it will then ask you for the password ('ubuntu' on 10.10 image) , enter this and you should then have a fully working GUI on your computer!
FAQ
How does Ubuntu look on our phone?
Ubuntu 9.04
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Ubuntu 10.10
What is Ubuntu? and why would I want it on my phone
Ubuntu is a linux based operating system normally for the computer, however with this port we can run it on our phone, this allows you to pretty much install any software available for linux and run it on your phone.
What are the best settings for Android VNC Viewer?
I find full 24-bit colour works very well and there is no need to down step this, also Input Mode is best set to touchpad as the GUI is not very touch screen friendly when its this small! using touchpad makes the touch screen act just like the touch pad on a laptop and I find this very easy to use.
Updates
[15/12/11]
New 10.10 image
Included all updates as of today
Image resolution set by default to 800x480
[12/12/11]
New 10.10 image update
New built in script in Ubuntu to start vncserver and other services on boot
SD card is accessible from within Ubuntu
Image changed to 3.5GB to fit if you have a 4GB SD Card
The ubuntu boot scripts are now on easy to use script!
More working programs (including software centre etc)
Default desktop changed back to LXDE
More apps for 'developing'
Firefox, Thunderbird, openoffice.org suite, GIMP Image Editor, Emacs Text Editor (geared towards programming), C and C++ build-essential, Java JDK, Python, TeXlive and TeXmaker LaTeX editor, Transmission BitTorrent Client, eVince PDF Viewer, File Manager, Terminal, Image Viewer, Leafpad Text Editor, Synaptic Package Manager and Ubuntu Software Center with all repositories enabled (Ubuntu Software Center is pretty and well organized - but bloated and slow), SSH server, Gnash (GNU flash player/plugin for Firefox - as there is no official generla flash pluging for armel CPUs)
[23/11/11]
New 10.10 image
vncserver and bug fixes included in 10.10 image
New light weight UI in 10.10 image
4GB image size for plenty of app space
More programs should be working in the 10.10 image please test!!
New image all icons in GUI don't load Fixed in 10.10 image
New Firefox crashes on start up now fixed in 10.10 image
+More that I cant remember
[05/11/11]
Old 9.04 image readded for those that want working GUI until new image is fixed
[24/10/11]
Java install guide added
[23/10/11]
New 11.10 ubuntu 4GB image
Changed guide for new image
+MUCH more (will add later)
Bugs
At the moment to use the new 10.10 V2 image you have to carry out steps 7 to 8.5 each time in order to get into the GUI, which means the only way to use terminal for ubuntu is within the GUI, this isnt to bad as the build is now very stable
At the moment once you start ubuntu it seems to prevent the sdcard being mounted and as there is no way to shut down the ubuntu session you must reboot if you wish to mount the sdcard via usb
Java might still not be working right please test!!
Other Programs to Install
Ok so as I start working on testing more programs I will post here how well they work and what does and dosnt work. Most programs that run from terminal and don't require any hardware like wifi etc seem to work well!
JAVA SE FOR EMBEDDED
To install the Java version for arm open up the terminal and type the following lines of code
Code:
wget http://android.zpwebsites.com/java.tar.gz
This will download the java package from my server!
Once downloaded type
Code:
gunzip java.tar.gz
Code:
tar xvf java.tar
This will extract the java package into a folder called ejre1.6.0_27
then type
Code:
export JAVA_HOME=ejre1.6.0_27
Code:
export PATH=$JAVA_HOME/bin:$PATH
Java should then be completely installed, please test by typing
Code:
which java
Tips
Some android terminal emulators (e.g. better terminal) allow you to specify an initial command that is run as soon as you launch the application. Multiple initial commands can be defined by pressing return between each command when you define it, so for example the initial command:
Code:
su <return>
cd /sdcard/ubuntu <return>
sh ubuntu.sh <return>
This way to load the new 10.10 V2 image simply open the terminal emulator
Help Needed
I would love for people to test there fav linux programs, also anyone that knows alot about ubuntu/linux to help getting the image to run faster etc etc
:O OMG this is special xD
superkid said:
:O OMG this is special xD
Click to expand...
Click to collapse
im guessing your being sarcastic in which case, yes its the same as many guides across the internet however I could not find one for our phone, and the main purpose of this guide is for user to beable to find out what ROMs do work with it and hopefully create a better more user friendly ubuntu experience, after all when we can have around 300MB free ram why not use it for something like this?
I was not being sarcastic! its really special! UBUNTU ON A PHONE! i am downloading right now!
superkid said:
I was not being sarcastic! its really special! UBUNTU ON A PHONE! i am downloading right now!
Click to expand...
Click to collapse
AH alright then I hope that maybe more kernels will be produced that have loop support so this will work on more ROMS
main download link now up!!
you can download ubuntu.zip here
will def check this out
What is Ubuntu? Linux?
(Sorry for the noobie question)
shrome99 said:
What is Ubuntu? Linux?
(Sorry for the noobie question)
Click to expand...
Click to collapse
an operative system,it is free
anyway
finally,i m waiting this for a long time
Can i use the xda kitchen with this??
or anyway is it possible to cook rom on this ubuntu?
thanks
shrome99 said:
What is Ubuntu? Linux?
(Sorry for the noobie question)
Click to expand...
Click to collapse
It is a linux distro see http://www.ubuntu.com/
However please note for the time being the ubuntu we can use is 9.10 I will look to upgrade this soon mind you!
So, it's an OS for a Computer, like Windows?
shrome99 said:
So, it's an OS for a Computer, like Windows?
Click to expand...
Click to collapse
indeed its a compete OS that we can run within android on our phones! lots of programs are included and you can install more, but the likes of firefox works very well
Is it worth installing this instead of normal ROM ? I mean, what special can be done that can't be done with normal ROM ?
Is it possible to use this for everyday usage ? Is it possible to call with it ?
adridu59 said:
Is it worth installing this instead of normal ROM ? I mean, what special can be done that can't be done with normal ROM ?
Is it possible to use this for everyday usage ? Is it possible to call with it ?
Click to expand...
Click to collapse
At the moment you have to still install a normal ROM as this runs within android, the only requirements for the ROM is for it to have loop device support which the roms listed in the first post have that i know of.
People in the HTC HD2 forum where able to get ubuntu running without android being installed, it has also been done on the nexus s, my next steps will be to try and port this.
But for now this just runs within android calling etc is still done in android
Is my servers (the main link) download speed ok? or would your rather i uploaded it to multiupload?
I am a long-standing Linux user, so this is good! Do you have a screenshot of Ubuntu running? I am trying to work out how the GUI will scale on our phones.
Doesn't work using Zulugen 1.1.3 with CM7 kernel... :/
i m having issue with keyboard
do i need tightvnc every boot?

[tut]complete guide on installing linux on android [dual boot]

So , Hello everyone,
It will not remove or harm Android, it will just run Linux on top of android
This tutorial will guide you through installing Linux on mmx a116 with android side by side..
What is this all about?/Why put this on my device?
This projects aim is to bring a range of linux distros to your android device through a method known as 'chroot', see it has running a linux distro within a virtual machine on your phone (Although its not! its using native ARM ports and the Android kernel) . You can access this virtual machine and run it on your phone without causing any damage to your device, or having to overwrite anything. Why might you want this? well my apps are designed to make the install and set up process as easy as possible while still giving you some flexibility. Once you have the distro up and running then you can pretty much run and install any linux software you like (so long as there is a arm port or it is not architecturally dependent).
Wait this uses VNC why shouldn't I just VNC to a computer?
VNC is used to access the GUI as at the moment I have not yet implemented a native way of viewing the GUI. But the Linux distro itself is running within the phone and can be controlled via the terminal app so if your a seasoned Linux user you may never even want to use the GUI
What is Chroot?/How does this work?
"A chroot on Unix operating systems is an operation that changes the apparent root directory for the current running process and its children" - http://en.wikipedia.org/wiki/Chroot
This method of running linux distros with android has been around for some time. I have worked on my scripts to make the process more user friendly and give you far more options from the word go.
The scripts start by mounting the linux image file within the android file system and then mounts the sdcard and if you have it internal memory within the linux file system.
Chroot is then used to change the root directory to that of the mounted linux and a bash shell is then opened to allow you to control linux this is kind of like 'booting' the OS.
The likes of VNC and SSH are then set up when linux is 'booted' to allow you to connect to the GUI if you require it.
Note: This requires a lot of free space on sd cards(any)..atleast 2 GB ..
INSTRUCTIONS:
1-Go to play store and download 'Complete Linux Installer' and install it ..
2-if you have a custom or other kernel , you have to check wether it supports loop or not.So better be on Stock Kernel.
3- Now there are 2 ways to install and run distros(eg-linux,backtrack).One is easier but requires an internet connection on the phone.other is a bit difficult but can be done from PC also .
method 1 ( internet on smartphone )
Go to complete Linux Installer and select install guides and select the distro you want it will download and guide you further.(in the unzipping step , i recommend using a PC for it as its too slow on the phone.)
Method 2 ( using a PC )
Download the version and size of your preferable ubuntu from here -
http://sourceforge.net/projects/linuxonandroid/files/Ubuntu/
After that, download androidVNC and terminal emulator from play store
now extract ubuntu.zip and place it in a folder called ubuntu on root of your SD card.Now you are ready to boot too ubuntu. select the launch menu from complete linux installer.
you will be redirected to terminal emulator . press n if you are asked to check boot.img from md5 as it gets stuck there. set screen size to 1280x720 after few seconds you will see a message [email protected] . this means you are succesful.
go to android vnc type in port option 5900 and password and username as ubuntu an color settings as 24 bit..
congratulations! you have booted to Ubuntu!:highfive:
Hmmmm.
That's not dual boot.:sly:
It runs Linux in VM.
Thanks!
-Dracula
And i don't see why anyone would want to do this, it's just killing your phone by overloading it with a Desktop OS in a VM!
Also perhaps providing credit to the person that did all the hard work might be a good idea .......
Oh and its not a VM guys, it uses chroot which means native ARM linux running with the Android kernel, within Android.

Install an OS on your PC using Drivedroid

Are you trying to install a new OS on your PC?
Don't have access to a USB or a CD-ROM?
Never fear, drivedroid is here!
In this tutorial I will use Ubuntu 16.04 LTS as an example.
[size=+8]Requirements[/size]
USB cable
Root access
[size=+5]Steps To Install[/size]
Step 1: Download the OS .iso disk image ubuntu-16.04-desktop-amd64.iso
Step 2: Copy the file into the /sdcard/Download/images/ (if it doesn't exist, create it)
Step 3: Download Drivedroid
Step 4: Grant Drivedroid root access
Step 5: Host image. A list of all the iso/img files in the/sdcard/Download/images directory will be displayed click on your .iso image and then pick read/write/CD-ROM the choices available depend on your kernel (Don't worry about this).
Step 6: Reboot yor PC and go to UEFI/BIOS settings and change boot order (if you don't have an operating system installed, it should automatically boot from your phone. Now configure and install your OS.

Guide to creating a Windows XP .img file on Windows 7 / 10 to emulate on Android 6.0

I created a guide on how to create a Windows XP (or indeed any operating system Linux or Windows) image .img file ready to copy to an Android phone to be emulated. Part 2 of how to run the created file on Android is coming soon so subscribe to see that one. This has been tested on Windows 10 and Android 6.0 and is just an updated guide with the latest tools.

Can Linux Android Imgs which built from source run in Windows Android Emulator ?

At the beginning I am new to android building from source.
I successfully built android for android emulator
useing android 4.0.1 AOSP source
(useing Ubuntu 14.04 64bit)
but when I run $emulator
I get errors
so I decided to run my imgs in windows sdk .
I moved the generated files
system.img
ramdisk.img
userdata.img
to android sdk path in windows
to the following path
....../android-sdk/platforms/android-15/images
but when I start android emulator it's stuck in black screen
but when I use the default android sdk files in the above
path the emulator started successful
.
the question is
can I run my system.img which I built useing Linux in windows?
is android system.img (x86)
system independent?

Categories

Resources