Yohan Liyanage

     

    03
    Feb

    Get JellyBean on Your Xperia with CyanogenMod 10

    By Yohan Liyanage|Mobility|2 Comments


    CyanogenMod
    is a popular custom ROM for android devices, which has been around for years. With CyanogenMod 10, it brings Android 4.1 Jelly Bean, along with lots of tweaks. This guide is specifically targeted for Xperia owners who are willing to switch to CyanogenMod, and it is based on the CyanogenMod distribution by FreeXperia project (kudos to FreeXperia team!). I have personally followed these steps to successfully switch to CyanogenMod 10 on my Xperia S (LT26i – Code Name Nozomi). You can use the same steps if you are using a similar Xperia device (or even for any other compatible android device).

    Disclaimer

    Note that steps explained below will void your warranty. Also, there is a chance that your phone might get bricked (that is, it will not be usable), although most of us have done this successfully. So please proceed at your own risk, and note that I am not responsible for any damage, loss or legal issues inflicted during the process. Also, note that at the time of writing, CyanogenMod 10 Nozomi (FreeXperia build) is in ‘nightly’ stage. What this means is that the team is actively developing this, and it is not at official release stage. So expect to see bugs / issues, although my personal experience is that the build is in a stable state now.


    Prerequisites

    1. Download the ‘nightly’ for CyanogenMod 10 from FreeXperia Project, using the below link.

    https://sites.google.com/site/projectfreexperia/download/cyanogen-mod-10

    In this page, you will see the list of releases for CyanogenMod 10. At the time of writing, the latest nightly is FXP205. When you click on the download link for the build, you will see a list of packages available for download. From this list, you should select the package which is relevant for your phone.  Xperia S is code named as ‘nozomi’, so you should select the package which is marked as ‘nozomi’ from the download page (FXP 205 Nozomi – 175MB). If your device is another, please select the corresponding version (ex. Xperia P is Nyphon) from this link (http://xperiadev.wordpress.com/hardware/codenames/).

    2. Download the Google Apps for Jelly Bean bundle. Note that earlier releases of CyanogenMod contained this pre-packaged. But due to legal reasons, this is no longer available in that form. It has to be installed separately. You can download this from http://goo.im/gapps/gapps-jb-20120726-signed.zip (83.1MB).

    3. Download and install fastboot. This enables you to flash your Android device using your computer. For steps , please read this article http://techstricks.com/installing-adb-and-fastboot-on-windows-how-to-guide/.

    4. Unlock your Xperia S bootloader, unless you have done so already. Note that while Sony officially allows unlocking bootloader, this will void your warranty. So proceed only if you are okay with that.Visit http://unlockbootloader.sonymobile.com/ for instructions on this.

    5. Installing CyanogenMod requires a full data wipe, so backup anything that is important to you, including your Contacts, Calendar, SMS etc.

    6. Fully Charge Your Android Phone.


    Steps

    1. Copy the downloaded Cyanogen ROM ZIP file (Ex. FXP205-cm-10-20130201-UNOFFICIAL-nozomi.zip) and the Google Apps ZIP file (ex. gapps-jb-20120726-signed.zip) to your phone’s SD card by connecting the phone to your PC.

    2. Open the Cyanogen ROM ZIP file in your PC, and extract the boot.img file to your hard disk.

    3. Disconnect your phone from your PC, and power off the device.

    4. Now, we need to get the device in to ‘fastboot’ mode. To do this, press and hold the Volume Up key, and connect the phone to your PC using USB cable. Keep the Volume Up key pressed until you see the LED notification light glow in blue color. Blue color indicates that the device is in fastboot mode. If this is the first time you are connecting your phone under this mode to your PC, Windows will install the necessary drivers.

    5. Open up a command prompt, and go to the directory where you have saved the boot.img file. For me, it is saved in E:\CYNO directory, as shown in the below screenshot.

    6. Now, enter the following commands. Note that this requires ‘fastboot’ application to be in the path (read the link mentioned earlier for steps).

    Shell
    1
    fastboot flash boot boot.img

    If it is not in the path, you will get a message saying “fastboot is not recognized as an internal or external command….’.

    If it was successful, you will see the blow output.

    7. Now, type the following command to restart the device.

    Shell
    1
    fastboot reboot

    The device will restart, and you will see the ‘FreeXperia’ logo when it boots up. One it dissapears, a black screen will come. When you see this, disconnect the USB cable, and press and hold the Power button and the Volume Up key (for approx 5 seconds) to force shutdown the device. Keep the buttons pressed until the device powers off.

    8. Power up the device again by pressing the Power button, and when you see the FreeXperia logo, repetitively press the Volume Up button to enter recovery mode. When you are in recovery mode, you will see a menu with options such as ‘reboot system now, ‘install zip from sdcard’, etc.

    9. First, we have to do a full wipe, and a factory reset. For this, select ‘Wipe user data / factory reset’ option. You can use the Volume Up / Down keys to navigate (or the Action key, which is the bottom right button in the three button cluster), and the Home button to select the option. When you select the option, you will be asked for confirmation. Select ‘Yes – Delete all user data’ to confirm.  Once it is complete, you will see a message saying ‘Data wipe complete’.

    10. Now, select ‘Wipe cache partition’ option.

    11. Now, go to ‘Advanced’ -> ‘Wipe dalvik cache’.

    12. Once the above steps are done, we can proceed to install CyanogenMod. In order to do that, go to the recovery main menu (you will have to select Go Back from the Advanced Menu), and select the following.

    ‘Install ZIP from SDCard’ ->  ‘Choose ZIP from SDCard’ -> Navigate to the Cyanogen ZIP file and select it. You will be asked for the confirmation, and once you confirm, the installation will take place.

    13. Once the installation of CyanogenMod is complete, follow the same approach and install the Google Apps for Jelly Bean package as well.

    14. Now the installation is complete, and we can restart the phone. Go to the recovery home menu and select ‘Reboot System Now’.

    15. You will see the FreeXperia logo, and then CyanogenMod splash screen will appear. First boot will take a while because of the initialization. Be patient and wait for a couple of minutes until you see the home screen. Don’t worry, it will boot up much faster later on!

    16. Now the Welcome screen from CyanogenMod will appear, and follow the steps to complete setup.

    17. Enjoy JellyBean on your Xperia S with CyanogenMod!

    04
    Nov

    Integration Testing with MongoDB & Spring Data

    By Yohan Liyanage|Java|5 Comments

    Integration Testing is an often overlooked area in enterprise development. This is primarily due to the associated complexities in setting up the necessary infrastructure for an integration test. For applications backed by databases, it’s fairly complicated and time-consuming to setup databases for integration tests, and also to clean those up once test is complete (ex. data files, schemas etc.), to ensure repeatability of tests. While there have been many tools (ex. DBUnit) and mechanisms (ex. rollback after test) to assist in this, the inherent complexity and issues have been there always.

    But if you are working with MongoDB, there’s a cool and easy way to do your unit tests, with almost the simplicity of writing a unit test with mocks. With ‘EmbedMongo’, we can easily setup an embedded MongoDB instance for testing, with in-built clean up support once tests are complete. In this article, we will walkthrough an example where EmbedMongo is used with JUnit for integration testing a Repository Implementation.
    (more…)

    03
    Nov

    STS in OS X – Where’s the sts.ini?

    By Yohan Liyanage|Spring|Be the first to comment!

    I’ve been using STS (SpringSource Tool Suite) on OS X Lion for sometime now, and today I realized that it’s getting a bit slow. I thought of tuning the heap size a bit to give it more memory, so I went into the installation to look for eclipse.ini, and there was none. So I googled, and found that STS bundles a ‘sts.ini’ file instead. Unfortunately for me, I wasn’t able to find this one in the folder either! Startled, I tried searching on the directory, etc, but it was not there. After googling around a bit more, I found in Spring Forums that the actual sts.ini file for Mac OS comes inside the application bundle. So if you are using Mac OS, and want to edit the sts.ini file, here are the steps.

    1. Go to your STS installation, and right-click on STS Application
    2. Select ‘Show Package Contents’
    3. A new Finder window will open and show the content of the application bundle. Go to ‘Contents’ directory in this window.
    4. Inside ‘Contents’, go to ‘MacOS’ directory

    In this folder (Contents/MacOS) you will find the actual executable (STS) and the STS.ini file. Do your changes to STS.ini file (ex.changing Xmx) and save it just like you would under Linux / Windows with eclipse.ini / sts.ini.

    30
    Sep

    Eventing with Spring Framework

    By Yohan Liyanage|Java, Spring|4 Comments

    Spring Framework, since it’s inception, included an eventing mechanism which can be used for application-wide eventing. This eventing mechanism was developed to be used internally by Spring Framework for eventing, such as notification of context being refreshed, etc, but it can be used for application specific custom events as well. This eventing API is based on  an interface named {java}org.springframework.context.ApplicationListener{/java}, which defined one method named {java}onApplicationEvent{/java}. Below code snippet shows a simple events listener which just logs the event information.

    Java
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    package com.yohanliyanage.blog.springevents;
     
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.springframework.context.ApplicationEvent;
    import org.springframework.context.ApplicationListener;
     
    public class MyEventListener implements ApplicationListener {
     
        private static final Log LOG = LogFactory.getLog(MyEventListener.class);
        
        public void onApplicationEvent(ApplicationEvent event) {
            LOG.info("Event Occurred : " + event);
        }
    }

    (more…)

    21
    Jun

    JAX-WS: Working with .NET Web Services

    By Yohan Liyanage|Java|Be the first to comment!

    If you happen to write a JAX-WS Web Services client for a service which is written using .NET Platform, you might come across the below error message when you execute wsimport command.

    A class/interface with the same name “?????” is already in use. Use a class customization to resolve this conflict.

    This happens because .NET generated WSDL documents may contain multiple elements with same name, which leads to a naming conflict when JAXB attempts to generate bindings. If you ever come across this situation, the solution is very simple. You just have to instruct the JAXB generator to automatically resolve any naming conflicts that might occur during the code generation. This can be done by providing -B-XautoNameResolution argument to wsimport tool. Note that the ‘-B-XautoNameResolution’ has no spaces. -B is used to pass instructions to JAXB Schema Compiler.

    An example would be:

    1
    wsimport -d gen-src -verbose -B-XautoNameResolution  https://sample.net/service.asmx?WSDL

    Note that generated code will refer to duplicate names with a numeric suffix. For example, if there are two elements with name ‘XYZ’, one class will be ‘XYZ’, and the other occurrence will be named as ‘XYZ2′.

    1 2 3 … 8 →

    Yohan Liyanage

    Technologist, Evangelist & Blogger

    Download Resume View Yohan Liyanage's profile on LinkedIn
    Ohloh profile for Yohan Liyanage

    Twitter - @yohanliyanage

    • No public Twitter messages.

    Tag Cloud

    AOP Architecture Aspect J Career Concurrency Design Design Patterns Dev Tools Eclipse EJB Experience Hibernate Humour Integration IoC JAAS Java Java EE Java Web Start JAX-WS JBoss JBossWS JCaptcha4Struts2 JKCS JMX Jobs Know the JVM Logging Maven Nebula Framework Ohloh Repository RMI Security SOA Software Industry Spring Struts 2 Threads Ubuntu Virus Web Services Worm Zhara Zhara POS

    Categories

    • Blog (1)
    • Career (1)
    • Coding (14)
    • Java (14)
      • JBoss (3)
      • Know the JVM Series (4)
      • Maven (1)
    • JKCS (1)
      • Zhara (1)
    • Mobility (1)
    • Open Source (2)
    • Other (4)
    • Personal (1)
    • Personal Projects (4)
      • JCaptcha4Struts2 (4)
      • Nebula Framework (1)
    • Software (1)
    • Software Architecture (2)
    • Software Design (2)
    • Spring (2)
    • Ubuntu (1)
    • Uncategorized (1)

    The Road Behind…

    • February 2013 (1)
    • November 2012 (2)
    • September 2012 (1)
    • June 2012 (1)
    • March 2012 (1)
    • November 2011 (2)
    • May 2011 (2)
    • November 2010 (2)
    • October 2010 (4)
    • September 2010 (2)
    • August 2010 (2)
    • June 2010 (1)
    • May 2010 (1)
    • November 2009 (1)
    • September 2009 (1)
    • August 2009 (4)
    • July 2009 (2)
    • November 2008 (1)
    • September 2008 (5)

    RSS RSS Feed

    • Get JellyBean on Your Xperia with CyanogenMod 10
    • Integration Testing with MongoDB & Spring Data
    • STS in OS X – Where’s the sts.ini?
    • Eventing with Spring Framework
    • JAX-WS: Working with .NET Web Services
    • Getting SOA Right – Thinking Beyond ‘The Right Angles’
    • Looking for JBoss Maven Repository?
    • JBoss JMX Console Vulnerability – Standard Security Is Not Enough !
    • Presentation – Java Web Start : How Zhara POS Works
    • JBoss – Changing RMI Remote Client Callback Address

    Blog Memberships



    Powered by the inLine Minimal WordPress Theme