Tuesday, 30 October 2012

Building an Android CUSTOM ROM


Building an Android ROM


Maybe it’s in the wrong place , it’s not really a tutorial what you’re about to read. It’s more a simple explanation on how an Android ROM is built. I’m going to discuss several parts that can’t be absent if you want a fully functional Android phone, from the software point of view that is.
Here’s a brief summary :
·         Kernel
·         Libraries (and modules)
·         Bootloader
·         Recovery
·         Radio
·         Apps, framework, core, android-runtime, etc…



Kernel
A kernel is a critical component of every Operating System. It can be seen as a sort of bridge between the applications and the actual hardware of a device. Usually the data processing part is done at hardware level, furthermore the kernel is the most low-level abstraction layer for the resources.
There exist several types of kernels, but I am only discussing the one that is important for the Android ROM. The kernel for the Android ROM is a hybrid kernel, it is based on the Linux kernel. Devices can differ in RAM memory, ROM memory, hardware parts and so on. So it’s really important you have a kernel for your type of device, an HTC Wildfire kernel won’t work on a Nexus One for example.
It is possible to overclock a kernel. What the hell is overclocking you may wonder? Every CPU is designed to work at a certain clock speed. For the HTC Wildfire the Qualcomm ARMv6 processor operates at 528 mHz; This is a limit that is coded in to the kernel because they can’t guarantee a good cooling if you go over this limit. My Wildfire runs at 652.8 mHz, it can go till 768 mHz but it can cause freezes. When you overclock the kernel , the CPU will be instructed to do more calculations per second and will so increase the performance. When you overclock the CPU of your desktop machine it needs extra cooling, it’s not necessary for a smartphone. However keep in mind this will degenerate your CPU more quickly. To overclock an Android phone you must root first, and than install SetCPU from the market , it is a paid app but it’s worth it. Further you have to flash an overclockable kernel , I prefer the OC Kernel of HCDR.Jacob, at XDA-forums (see links right). If you have done these 3 things you’re ready to OC!


Libraries
Imagine you want to program an application for your phone that uses the camera. It can take a picture and turn on the flash LED on. These are things not only your own application will use, there can be tons of applications that have a button , that when you press it , it will take a photo. So think about if they always have to write the machine code for the phone , that it instructs the phone to put on the camera. It would be a lot of code duplication and would make an application slow. Instead for functions like the camera, or loudspeakers, they developped libraries. These are chunk of codes that can be executed by calling them trough a call-method (in java : import somelibrarie.someclass;), these are already pre-written and ready to use. It saves a lot of coding work and keeps the source code small. Libraries in the Windows OS for example are the so called .dll files (Dynamic Linked Libraries) , on your Android ROM or Linux OS these are the .so files (Shared Object), when coding in Java you import .jar libraries before the class signature. On your Android phone you have particular libraries that can’t be absent, or else your ROM won’t even boot.


Bootloader
A bootloader in general is the first bytes of code that a machine executes that will tell the bootsequence and will load the operating system into the RAM. On an Android phone this is the so called HBoot, from here you can go to the recovery partition, the system or data partition,.. If you simple press the power button Hboot will load the OS into your RAM. But if you want to access these partitions it is possible by pressing, if you have a Wildfire, the volume-down button and simultaneously the power button. This will bring up the Hboot menu. The bootloader is used as exploit for rooting an Android phone. Once rooted you can flash custom roms , like ImPrOS, or just edit system files. (for a how-to , check tutorials under Android).

Recovery
When you use a one-click-root application, like Unrevoked3 , it will install a modded recovery. With this modded recovery it is possible to flash a new kernel, radio image (see below), custom rom, install applications (not the best way though),nandroid backup,.. The modded recovery that is flashed by Unrevoked3 is called ClockworkMod.


Radio
The lowest part of software layer is the radio, this is the very first thing that boots even before the bootloader. This handles the GPS-antenna,GSM antenna ,fires up the CPU, everything what Hboot needs to load the OS. This is also upgradeable by flashing a new radio image trough ClockworkMod. However this is not recommended : flashing a new ROM can’t brick your phone but if anything goes wrong when you flash a ROM with a new radio image this can brick your phone. So unless you experience bad reception or battery drainage, don’t touch the radio!!


Applications, framework, android-runtime,..
Now we have the fundamental software layers, we have to decorate our ROM, it has to have some interface trough where it can communicate with the user. We can install applications like a keyboard, a phone application, a calculator. And last but not least the android-runtime. This is a package of code that represents the Android Virtual Machine. The Android programming language is based on xml and Java (mostly Java) , like every programming language has some sort of virtual machine, (Java has JVM = Java Virtual Machine) Android has android-runtime.

Thursday, 25 October 2012

What is cyanogen(mod) ?





CyanogenMod - CyanogenMod Android Rom



CyanogenMod (pronounced /saɪ.'æn.oʊ.dʒɛn.mɒd/sigh-AN-oh-jen-mod) is an open source replacement firmware for smart phones and tablet computers based on the Android mobile operating system. It offers features and options not found in the official firmware distributed by vendors of these devices.
Features supported by CyanogenMod include native theming support, FLAC audio codec support, a large Access Point Name list, an OpenVPNclient, an enhanced reboot menu, support for Wi-Fi, Bluetooth, and USB tethering, CPU overclocking and other performance enhancements, soft buttons and other "tablet tweaks", toggles in the notification pull-down (such as Wi-FiBluetooth and GPS), app permissions management, as well as other interface enhancements. According to its developers, CyanogenMod does not contain spyware or bloatware.[3][4] CyanogenMod is also stated to increase performance and reliability compared with official firmware releases.[5]
CyanogenMod is developed as free and open source software based on the official releases of Android by Google, with added original and third-party code.
Although only a subset of total CyanogenMod users elect to report their use of the firmware,[6] as of 24 August 2012, CyanogenMod has recorded over 3.1 million installs on a multitude of devices.

About


CyanogenMod (pronounced sigh-AN-oh-jen-mod), is a customized, aftermarket firmware distribution for several Android devices (See above for supported devices & how to install CyanogenMod on said devices). Based on the Android Open Source Project, CyanogenMod is designed to increase performance and reliability over Android-based ROMs released by vendors and carriers such as Google, T-Mobile, HTC, etc. CyanogenMod also offers a variety of features & enhancements that are not currently found in these versions of Android.

History and development

Soon after the introduction of the HTC Dream (named the "T-Mobile G1" in the United States) mobile phone in September 2008, a method was discovered to attain privileged control (termed "root access") within Android's Linux-based subsystem.[9] Having root access, combined with theopen source nature of the Android operating system, allowed the phone's stock firmware to be modified and re-installed onto the phone.
In the following year, several modified firmwares for the Dream were developed and distributed by Android enthusiasts. One, maintained by a developer named JesusFreke, quickly became popular among Dream owners. In August, 2009, JesusFreke stopped work on his firmware, and suggested users switch to a version of his ROM that had been further enhanced by developer Cyanogen (Steve Kondik) called "CyanogenMod".[10]
CyanogenMod quickly grew in popularity, and a small community of developers, called the CyanogenMod Team (and informally, "Team Douche"[11]) made contributions. Within a few months, the number of devices and features supported by CyanogenMod blossomed, and CyanogenMod quickly became one of the most popular Android firmware distributions.
Like many open source projects, CyanogenMod is developed using a distributed revision control system with the official repositories being hosted on GitHub.[12] Contributors submit new feature or bug fix changes using Google's source code review system, Gerrit.[13] Contributions may be tested by anyone, voted up or down by registered users, and ultimately accepted into the code by one of a handful of CyanogenMod developers.
A version of ADW.Launcher, an alternative launcher (home screen) for the Android operating system, became the default launcher onCyanogenmod 5.0.8. The launcher provides additional features not provided by the default Android launcher, including more customization abilities (including icon themes, effects, and behavior), the ability to backup and restore configuration settings, and other features.


List of devices supported by CyanogenModList of devices supported by CyanogenMod.


CyanogenMod
















Wednesday, 24 October 2012

How to flash ClockworkMod Touch Recovery 6.0.1.2 for the Galaxy S3 I9300


How to flash ClockworkMod Touch Recovery 6.0.1.2 for the Galaxy S3 I9300







Can you believe it’s been a few months since ClockworkMod Touch Recovery reached version 6.0? We gave you a guide on how to flash ClockworkMod Touch Recovery 6.0.1.0 to your Samsung Galaxy S3, but if you’re the type of person who always wants to have the latest improvements at the tips of your fingers, you’ll definitely want to take some time to flash version 6.0.1.2. But, why should you, when you’re already nice and comfy with 6.0.1.0?
ClockworkMod Touch Recovery 6.0.1.2 has a few tricks up its sleeve. This update gives you a few new helpful features, such as the ability to flash ZIPs from the external SD card. The update also endows you with the power to Choose Backup Format so you can choose between the new.dup method with the blobs folder or the original .tar method where everything is in the date/time-stamped folder. You can also Create an Image ZIP from a NANDroid Backup.
This guide shows you how to flash ClockworkMod Touch Recovery 6.0.1.2 for the Galaxy S3 I9300.

Warning

  • The instructions in this guide are intended for use with the Samsung Galaxy S3, model number GT-I9300. Applying these instructions on another device or model may produce undesired outcomes.
  • The information in this guide is provided for instructional and educational purposes only. There is no guarantee that these instructions will work under your specific and unique circumstances.
  • Use these instructions at your own risk. We shall not hold any responsibility or liability for whatever happens to you or your device arising from your use of the info in this guide.
  • Read and understand the whole guide first before actually performing the instructions.

Requirements

  • Samsung Galaxy S3 GT-I9300
  • Download the following to your computer:
  • A Windows PC
  • Handset USB drivers installed on the PC. You may install the drivers by installing Samsung Kies.
  • Enable USB debugging on your handset.
  • Disable antivirus, firewall, and other security software. Also disable Samsung Kies and other software that accesses your phone. Such software can interfere with the procedure in this guide.
  • Make sure your device’s battery still has at least 70% power. You don’t want the device to shut down in the middle of the procedure.
  • Backup all personal data on your phone to make sure you have a copy of your personal data (e.g., contacts, SMS, MMS, Internet settings, Wi-Fi passwords, and the like) in case the procedure in this guide erases such data.

Instructions

  1. Extract the contents of the Odin v3.04 ZIP file to your computer to get Odin3_v3.04.exe.
  2. Turn off your Galaxy S3.
  3. Boot into Download Mode by pressing and holding down the Home, Volume Down, and Power buttons. Press the Volume Up button to continue into Download Mode.
  4. On your computer, double-click the Odin3_v3.04.exe file to launch it.
  5. Connect your phone to your computer using the USB cable. You should see an “ADDED!” message in the message box in the lower left of the Odin window.
  6. In Odin, make sure that only Auto Reboot and F. Reset Time are ticked.
  7. Click on the PDA button and select the recovery-cwm-touch-6.0.1.2-i9300.tar file.
  8. Click on Start in Odin to begin flashing ClockworkMod Recovery to your Galaxy S3.
  9. When ClockworkMod Touch Recovery has been flashed to your Galaxy S3, your phone should reboot. You can unplug your device when you see the Samsung logo and when you see a PASSED message in Odin.
  10. To make sure that ClockworkMod Touch Recovery has been successfully installed on your Galaxy S3, boot into Recovery Mode. You can do this by pressing and holding down the Home, Volume Up, and Power buttons.
Hurrah! You’ve just flashed the latest ClockworkMod Touch Recovery 6.0.1.2. Have fun flashing with the power of your fingertips.




What Is ClockworkMod Recovery And How To Use It On Android [Complete Guide]


What Is ClockworkMod Recovery And How To Use It On Android [Complete Guide]





ClockworkMod, abbreviated as CWM, is a popular custom recovery for Android phones and tablets developed by Koushik Dutta (Koush), a well-known name in the Android dev community. ClockworkMod recovery allows you to perform several advanced recovery, restoration, installation and maintenance operations on your Android device that aren’t possible with the stock recovery, and is one of the most common ways used to gain root access, back up device data, install a custom ROMs, kernels, themes, mods and more. However, for anyone new to Android customization and hacking, some of its options might prove to be a tad confusing. In what follows, we will cover all that this recovery is capable of doing, and how to do it.





Here is what we shall be covering in this guide:
  1. About Android recovery
  2. Introduction to ClockworkMod
  3. Installing ClockworkMod
  4. Booting into ClockworkMod
  5. Feature tour
  6. Using ClockworkMod for ROM, kernel, apps, theme or mod installation.
Now let’s take a look at each of these topics in detail.


About Android Recovery

All Android devices ship with a recovery console that is basically a partition on the device’s internal memory and can be booted into. The stock recovery of almost all Android devices provides a few basic yet handy options that allow you to factory reset your device and also to recover its operating system using an official ROM in zip format, but that’s all you can do with it. That’s where a custom recovery comes handy.
A custom Android recovery basically replaces the stock recovery with one that lets you do all you can do with the stock recovery, plus a plethora of more options to give you a lot more control on your device. With a custom recovery, you can install official and unofficial ROMs as well as other updates including apps, themes, kernels etc. using zip files, wipe not just user data but pretty much every partition on your device, mount the storage card for USB mass storage access without leaving recovery, partition your SD card, wipe Dalvik cache and battery stats, fix permissions, perform, manage and restore backups and so on.

Introduction To ClockworkMod

ClockworkMod recovery is one of the most widely used custom Android recoveries that is available for most mainstream Android devices. It is our custom recovery of choice here at AddictiveTips and almost every custom ROM that we install on our devices is done using this recovery.
ClockworkMod recovery has been developed by Koushik Dutta (also known as Koush) – the same guy who brought us the Android ROM Manager. He can be found at his blog hacking away at Android devices and at Twitter.

Installing ClockworkMod

What sets ClockworkMod recovery apart from most other custom Android recoveries is its dead simple installation process on most devices. It does require you to fully root your device in order to be installed but once rooted, installing it is as simple as installing ROM Manager from Market, launching it and using its first option i.e. the one that says ‘Flash ClockworkMod recovery’. We have this method covered in detail in our guide on how to install ClockworkMod recovery to your Android device.
However, in certain cases, this ROM Manager method will not work. The following scenarios will require alternative installation methods:
  • Your device doesn’t have an official version of ClockworkMod recovery released yet but you have found a custom version built by someone else using the ClockworkMod recovery source code.
  • Your device does have an official version of ClockworkMod recovery released but there is either a yet-unreleased official version or an unofficial version that you want or need to install instead.
  • Your device has some added protection enabled by the manufacturer preventing the automatic ROM Manager method for installing the recovery, as with some Samsung Galaxy S series devices.
  • Your device isn’t a native Android device but Android has been ported to run on it and it therefore requires a specialized method for installing ClockworkMod recovery, as with the HTC HD2.
We have most of these scenarios already covered and you can use the following guides to install ClockworkMod recovery if the automatic ROM Manager method fails for you.
Multiple devices:

Specific devices:

Booting Into ClockworkMod

Once you have ClockworkMod recovery installed on your Android device, booting into it is quite simple. All you have to do is launch ROM Manager and tap ‘Reboot into Recovery’.
Also, if you have ADB installed on your computer, you can simply enable USB debugging mode on your device from Settings > Applications > Development, connect it to your computer via USB, launch a Command Prompt / Terminal window on your computer and enter this command:
adb reboot recovery
The above methods will not work in certain cases though, for instance if you can’t boot into Android in the first place due to some issue, or if you are using a device like the HTC HD2 that doesn’t natively support an Android recovery. Many solutions are available in these cases.
  • Using hardware button combination on most Android devices:
    On most Android devices including ones by HTC, you can enter recovery by powering your device off and then powering it back on while keeping either the ‘Volume Down’ or the ‘Volume-Up’ button pressed, depending on the device. This will enter the bootloader from where you can select the ‘RECOVERY’ option by navigating to it with the Volume key and entering it with the ‘Power’ key.
    On most Samsung devices specifically Samsung Galaxy S series devices, you must keep both the ‘Volume-Up’ and ‘Home’ keys pressed while powering on the device, to directly enter recovery.
  • Using MAGLDR on HTC HD2:
    Entering ClockworkMod recovery on the HTC HD2 can’t be done via ROM Manager or any hardware button combination but that doesn’t mean it is difficult in any way. All you have to do is power the device off, power it on by keeping the Power key pressed till you see the MAGLDR bootloader’s menu and finally selecting the ‘AD Recovery’ option.

Feature Tour

Now that you have ClockworkMod recovery up and running on your phone or tablet, let’s take a look at all the options it offers you to manage your Android device. We are using a Nexus S running ClockworkMod recovery 3.0.0.5 but the details should apply to other devices and other 3+ versions of the recovery as well, while versions prior to 3 will have some very minor changes that shouldn’t be an issue.
This is what you see when you reboot your device into ClockworkMod recovery:
ClockworkMod Recovery 3
You can navigate these options by using the Volume-Up and Volume-Down keys to highlight an option and the ‘Power’ key to enter/launch the highlighted option on most Android devices. On devices equipped with a trackball or an optical track pad such as G1, G2, Nexus One, HTC Desire etc., the trackball or track pad can be used for navigation and clicking it can be used to enter/launch the selected option. Let’s review each of these options and their sub-menu options in detail.
  1. reboot system now
    This one is self-explanatory.
  2. apply update from sdcard
    This can be used for installation of any official or unofficial update, ROM, kernel, theme etc. that is in a zip format installable from recovery, as long as the file is named update.zip and it has been placed on the root of your SD card (i.e. not in any sub-folder). Selecting this option (and most of the options featured below) will bring up a rather annoying confirmation prompt but this has saved us on multiple occasions from a lot of trouble we would have been into due to accidental key presses. This is what we are talking about:
    ClockworkMod Recovery 3 Confirmation
  3. wipe data/factory reset
    This option wipes all user data on the device as well as cache. Doing this will leave your phone in the state it was in when you bought it or when any custom ROM was first installed. It will also wipe any sd-ext partition that you might have setup (more on this later).
  4. wipe cache partition
    Wipes the cache partition of the device to clear all the data accumulated there over use. This is often used before installing a new ROM, app, kernel or any similar mod via recovery.
  5. install zip from sdcard
    This option brings up the following sub-menu:
    ClockworkMod Recovery 3 Apply Update
    1. apply /sdcard/update.zip
      This one is essentially the same as the ‘apply update from sdcard’ option of the main menu.
    2. choose zip from sdcard
      Lets you install any zip file (with any name) from any location on your SD card. The file can be for a ROM, a kernel, an application, a theme or any mod as long as it is in recovery-flashable zip format. This is the most widely used option for installing a ROM that you have downloaded and copied to your SD card. Entering this option will bring up a screen that will allow you to browse your SD card for the zip file and select it for installation as in this screenshot:
      ClockworkMod Recovery 3 Browse
    3. toggle signature verification
      Turns the signature verification on and off. When signature verification is on, you will not be able to install any custom ROMs that haven’t been signed by the developers (most custom ROMs aren’t signed). Switching it off skips the signature verification check and proceeds with the installation.
    4. toggle script asserts
      Seldom-used option for a vast majority of users. It simply turns script asserts on or off. If you don’t know about these (we don’t), it’s best not to change this option.
    5. +++++Go Back+++++
      Takes you back to the main recovery menu, obviously!
  6. backup and restore Undoubtedly one of the most important features provided by a custom recovery, the backup and restore feature – also known as Nandroid backup – allows you to take a snapshot of your phone’s entire internal memory including all partitions, and save it on the SD card. Here is how it looks:
    ClockworkMod Recovery 3 Nandroid
    1. Backup
      Takes a Nandroid backup, as explained above.
    2. Restore
      Lets you restore a previously taken backup. Entering this option presents you with a list of existing backups from the SD card that you can choose from for restoration.
    3. Advanced Restore
      This option is similar to the Restore option but once a backup has been selected to be restored, this option allows you to choose what parts of it to restore. You can choose to restore the boot, system, data, cache and sd-ext partitions, as shown here:
      ClockworkMod Recovery 3 Advanced Restore
  7. mounts and storage
    Allows you to perform maintenance tasks on all the internal and external partitions of your android device
    ClockworkMod Recovery 3 Mounts
    1. mount/unmount /system, /data, /cache, /sdcard or /sd-ext
      These options let you toggle between mounting or unmounting these respective partitions. Most users don’t need to change these options.
    2. format boot, system, data, cache, sdcard or sd-ext
      These let you directly format any of these partitions. Take extreme care with this option as formatting any of these partitions will result in losing all data on them, especially the boot and system partitions. Formatting the system partition will remove your ROM and leave your phone without an operating system while wiping the boot partition may brick your phone unless you restore or flash another one before rebooting your device. To learn more about the contents of all these partitions, see our guide to Android partitions.
    3. mount USB storage
      Lets you enable USB mass storage mode for your SD card right from recovery so that you can connect it to your computer via USB and transfer any files to/from it without having to leave recovery.
  8. advanced
    This section contains a few options most users will not require, though these can come handy quite often, especially wiping Dalvik cache, which is required before most ROM installations. Here are the options from this section:
    ClockworkMod Recovery 3 Advanced
    1. Reboot Recovery
      Lets you directly and very conveniently reboot from recovery right back into recovery. This is useful option for certain back-to-back installations that require the device to at least boot once between them.
    2. Wipe Dalvik Cache
      Allows you to wipe the cache for the Dalvik virtual machine (the custom-built Java virtual machine for Android).This is required before most ROM installations and at other occasions too, for fixing some problems.
    3. Wipe Battery Stats
      Wipes the saved battery usage statistics and effectively recalibrates the battery. Useful in various scenarios when Android isn’t showing correct battery levels.
    4. Report Error
      In case of errors, this feature can be used to save a log of recent ClockworkMod recovery operations on the SD card that you can later report from Android using ROM Manager.
    5. Key Test
      Lets you press any of the hardware keys to see if they are properly functioning, and to see their key codes.
    6. Partition SD Card
      This option gives you a no-frills way to partition your SD card properly for use with ROMs that support data2ext (a very handy hack for low internal memory devices that enables an /sd-ext partition on the SD card to be used as the internal user data storage i.e. as the /data partition). Once this option is selected, you will be given options to choose the sizes for the /sd-ext partition as well as an optional /swap partition on the SD card, and will then automatically format it for you, leaving the remaining space for normal SD card usage. This option will wipe all data from your SD card so use it with caution!
    7. Fix Permissions
      Fixes the file permissions for the internal memory partitions back to default. This is very useful as a fix for several errors and Force-Closes that start appearing after you or an application you installed and provided root access end up messing up the permissions of important files.

Using ClockworkMod For ROM, Kernel, Apps, Theme Or Mod Installation

While in the complete feature tour we have already shown you how to install a ROM, kernel, app, theme or any similar mod from a recovery-flashable zip file using the recovery options, those of you who jumped straight to this section expecting to get just this information quickly are at the right place!
This guide is primary focused on a full feature tour of ClockworkMod recovery but in our previously written guide on how to flash a ROM or app from a zip to an Android device file from recovery, we have already covered in detail how to use ClockworkMod for installing any ROM, kernel, app, theme or mod using a recovery-flashable zip file. While that guide is based on an older version of ClockworkMod recovery, everything in it still applies to the latest versions and should work flawlessly.
That’s all there is to ClockworkMod recovery so far. We hope you enjoy using it as much as we do!