[Galaxy 3 Android Development] sekhargreen:
[What is it?]

What are Stock Roms and Custom Roms?

What is a Rom?

ROM – Read Only Memory is that memory which stores the system files of your Device. Those files which make up the basic Operating System, be is Windows Mobile Phone OS, Android, Symbian, Windows OS, etc. Every electronic device has a Read only Memory which stores the basic programming of the functions that the Electronic equipment is to perform. ROM in terms of our Android Devices the basic set of programming applications and files of functions which your device performs Out of the Box. Without a Rom no electronic device exists.

What are Stock ROMs?

Those ROMs which come pre installed are called Stock ROMs. Stock ROMs are the ones that come Box packed with your Device preinstalled. These are official Software that are provided by the Manufacturer or the OEM.

Is it possible to Edit/Customize/Alter Stock ROMs?

Yes it is. For a lot of Operating Systems be it Windows Mobile Phone OS, Android, Symbian, etc, it is possible to Customize these stock ROMs and install them to our devices.

What are Custom ROMs?

They are Custom ROMs are based on Stock ROMs but customized by the user in terms of additions in applications, improvements, removal of unnecessary application, etc. A customized ROM may be an minor improvement to Stock Rom or can even be a complete makeover of Stock Rom even changing the drivers of the Rom with that of other compatible devices providing better performance.

Why do we need Custom Rom?

Customization is making things personal. That is one main reason why we customize a Stock Rom. A stock Rom no matter what will have a lot of unnecessary applications, files, images, settings that are pre set by the Manufactures but are not at all important to us and uses a lot of space for no reason. No matter what there has to be one or the other Bug in a Stock Rom. To get rid of these issues we customize a stock ROM by either adding useful applications, settings, removed crap, fixing bugs and on getting a Top Notch easy to use and completely customized Device.

What about the warranty?

This is decision that you need to make personally. Yes, Custom ROMs will take away your precious warranty. But that to only if your device stops working while you are using Custom Rom on your device and you have to take it to the company. If you want you can revert back to Stock ROMs and then take your device to the Service Center and they won’t even know about it. But you need to consider reverting back to Original Stock Rom.

su

Also referred to as substitute user - a command for changing the account in the current terminal (usually black screen with blinking cursor). Default account is root account. So if you insert into terminal 'su' and hit enter, you will become root user.

root

Root alias superuser or poweruser is special user account for system administration. Similar to windows having its administrator account, unix-like systems have a root account. With this, you can do anything and if you run a command to delete the whole system, unix will just do it! No asking, no confirming. So, watch your steps!

rooting

Rooting is just enabling power of root for applications and other purposes.

Superuser app

After rooting is done, you will see a new app called superuser in app drawer. This app can delegate applications to use su (root) feature. When an app asks this from first use, a popup window will appear asking if the application should be allowed to use root permission.

sh, bash

is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems. So simply, it is some interface, which can execute command(s), which you have entered. Many shells exist, but in scope of android you can (as far as I know) use only sh (standard - Bourne-shell) or bash (compiled in BusyBox or separately on XDA). Both are basically same, but bash has much more features and it is more comfortable.

user/root shell

How do I know if I'm root or normal user? It's simple. Root's shell is ended with # (usually it's shell looks like "bash-3.2# _") and user's ends with $ (usually bash-3.2$ _). In terminal emulator you also can have only [path]($|#) (for root for example "/etc # _")

BusyBox

also called "The Swiss Army Knife of Embedded Linux" is a tool which brings into Android basic tools known from unix system, but is much more smaller than standard tools is. But this "packing" has limited functions in comparison to standard tools in unix-system (missing special modes of tool, color output and so on). Many application use this. For example busybox grep (filtering of text) is needed for application called Market enabler.

BusyBox commands

list of commands is really wide, so it's not possible explain all, so I pickup only top few. (hint: if you want what some command do, just search on google for "man <command_name>" for example man mv or enter command here

cd - change directory - same like in windows. You can switch directory. example: cd /sdcard

ls - list of files in actual directory (have few switches like for example: ls -l /sdcard/*.png (detailed listing)

cat - print file into standard output (like more in windows) Example: cat /sdcard/data.txt

vi - editing of file. But on limited phone keyboard (no keyboard) it is little harder Read more about vi

cp - copy of one or more file. Example: cp /sdcard/bike.jpg /sdcard/media/bike-wallpaper.jpg

mv - moving/rename files, Example: mv /sdcard/bike.jpg /sdcard/media/renamed-moved-bike.jpg

rm - delete file (rm -R for recursive, or for delete whole folder), Example: rm -R /sdcard/wallpaper-bad/*

find - search for files, Example find / -name "best-chopper-ever.avi"

mkdir - make directory - creates directory, Example: mkdir mynewdir

chmod - changes access of files

less - similar like cat, but you can scroll in it and it doesn't produce any output. Example: less /sdcard/funnytext.txt

For BusyBox's tool help, just enter BusyBox <command_name> -h.

ADB (shell)

ADB - Android Debug Bridge is a versatile tool that lets you manage the state of an emulator instance or Android-powered device. It is a client-server program that includes three components:

* A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.

* A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.

* A daemon, which runs as a background process on each emulator or device instance.

Generally, it can be compared with standard cmd prompt in windows (you can write commands which will be executed locally, for example in Terminal Emulator) or it can be just like SSH in unix-like system (you connect to terminal through adb client (in Android SDK) and commands will be run remotely.

Android SDK

Android software development kit is a complex set of tools for developing apps on Android. It includes a fully usable emulator of Android OS on your PC, where you can do everything. You can install/delete apps, browse web page in embedded web browser, play games or make your own application in Eclipse (widely used IDE for development). Of course, with emulator you can use also GPS or camera.

Android SDK tools

* Fully emulated Android device

* Android Development Tools Plugin (Eclipse IDE)

* Android Virtual Devices (AVDs)

* Hierarchy Viewer

* layoutopt

* Draw 9-patch

* Dalvik Debug Monitor Service (ddms)

* Android Debug Bridge (adb)

* Android Asset Packaging Tool (aapt)

* Android Interface Description Language (aidl)

* sqlite3

* Traceview

* mksdcard

* dx

* UI/Application Exerciser Monkey

* monkeyrunner

* Android

* zipalign

Tools for work with Android adb shell

You have two ways to connect into ADB service - locally and remotely.

Locally - for local access you will need some application which can connect to local adb shell.

Terminal Emulator (free) - probably most commonly used app from market, which works and looks like standard unix shell.

ConnectBot (free) - same as Terminal Emulator, but it can be also used for connecting via SSH or telnet

Remotely- For remote connection you need phone configuration adjustment:

Home desktop -> [menu button] -> Settings -> Applications -> Development -> USB debugging [ON].

Also you need connect your phone via USB (or finds on market some widget/app, witch enable using ADB also via wi-fi)

adb tool from Android SDK

After downloading Android SDK, extract the archive anywhere (in example I extracted it in c:/AndroidSDK). Then follow instructions on developer.android.com for installation of SDK Platform-tools (contains adb). After installation click on start menu and in Run... (in Windows7 in search bar) enter 'cmd' and press Ok or [enter]. Then write in cmd line:

Quote:

cd c:\AndroidSDK\android-sdk-windows\tools [enter]

now you can enter following command to connect to phone's adb shell if you don't have more connected device (virtual or real-one)

Quote:

adb shell

If you have more then one, you need explicitly say which one should be used for connection. So list connected devices with

Quote:

adb devices

which shows you serial number of connected devices. Than use

Quote:

adb -s <serial-number> shell

3. Custom recovery

* What is custom recovery

* Tools which custom recovery provide - NAND backup/restore, formatting of SDcard, partitioning (ext1,ext2, ext3), wiping, flashing of Custom ROM, ...

* Is it safe to install? - potential problems, backup/restore of original recovery

* How this whole thing works - installation description (not how-to install, just explanation of what is done during installation)

What is custom recovery

Recovery is an image (binary data) stored in internal memory. This image contains something like a "program" or "tool", which can boot-up independently from the Android system. This tool is part of phone system, and in PC terminology recovery can by compared to BIOS with some added features. This recovery state can be reached on all phones, but if you don't have a custom recovery, it will do a so-called HW reset and automatically restart itself into standard boot mode.

Tools which custom recovery provides

* USB-MS Toggle :mounts sdcard as mass storage

It just mounts your phone as USB-mass storage (USB disk) so you can access it through your PC

* Backup/Restore:

Absolutely GREAT feature. With NAND you can copy an image of your actual system (phone's memory). It means that you can backup the whole system with all configuration, customization, wallpapers, system's tweaks... just everything. This image will be written to your SD card which you are then free to copy around and back up on your computer

* Flash Zip From Sdcard

This tool is designed for installation of custom ROMs or tweaks. If you are instructed to install via custom recovery, then you should use this menu. Never unzip the file because it contains meta-information about itself with some validate-checks so if you edit it, or unpack and pack back, it won't work. And remember to place the file in the root (main folder) of your sdcard.

* Wipe Menu:

Wipe data/factory reset: wipes data & cache

- wipes user data (contacts, apps, configuration, ...) and cache (caches of applications)

Wipe cache

- wipes cache only

Wipe Dalvik cache : Wipes Dalvik cache in all possible locations if moved by apps2sd

- wipes Dalvik cache

Wipe SD:ext : Wipes Apps2sd ext partition

- if you used Partition SDcard option, you can wipe it here

Wipe Battery Stats (remember to fully charge your phone before doing this)

- If you think, that your battery life is too short, you can try delete battery stats. Than let phone fully charge. (more)

Wipe rotate settings

- wipe sensor settings (acceleration, ...)

Wipe .android secure : Wipes froyo native .android_secure on sdcard

- wipe information about moved apps

* Partition Sdcard:

Partition SD: Partitions sdcard for apps2sd (this formats card so all data will be lost)

- will create ext2 partition (you will be asked for size of ext2 and cache)

Repair Sd:ext

SD:ext2 to ext3 : converts apps2sd ext2 partition to ext3 (requires kernel support for ext3)

SD:ext3 to ext4 : same as above but ext3 to ext4 (requires kernel support for ext4)

ext2 - file system for the Linux kernel (no journal, fast but not recovery of I/O error)

ext3 - file system for the Linux kernel (journal, slower than ext2 because of journal, but provides recovery on I/O error)

ext4 - file system for the Linux kernel (journal, enhanced version of ext3)

* Mounts:

Gui automatically mounts folders

png-optimized -

png files takes less memory, are loads faster

JIT -

just-in-time compilation also known as dynamic translation, is a method to improve the runtime performance of computer programs, but it takes some time to convert into it on start.

HW:acceleration -

using of HW acceleration for rendering GUI. Increases battery consumption.

VM.Heap Size -

maximum memory an application can consume

stagefright -

In Android 2.2 new media framework that supports local file playback and HTTP progressive streaming