Month: April 2014

  • Setup EC2 for Production using Ubuntu

    Here is full guide how to setup EC2 for production using Ubuntu. I use server for hosting many frameworks stacks start from PHP, Ptyhon and Nodejs. 1. Install default development packages 1sudo apt-get install git-core curl build-essential openssl libssl-dev pkg-config python-dev libxml2 libxml2-dev libxslt1-dev libbz2-dev libssl-dev p7zip-full unzip unace unp bzip2 gzip patch bind9 apache2 […]

  • Set EBS as root partition on EC2

    We can replace main partition in EC2 using EBS for larger space. Make sure to use HVM instead of Paravirtual. First thing, we need to create a new EBS and attach it into running instance. Now, we should login into our SSH server. 1. Copy old instance into new instance Find what your root partition […]

  • Remove element object from List / ArrayList in Java

    Removing object / element in List / ArrayList in Java a bit tricky. For instance, if we have ArrayList(); then we can remove the element using : 1listItem.remove(new Integer(index)); But this way not working for listItem contains objects. To remove, we should pass object itself. 1listItem.remove(Object);

  • Spinner white text color white background android solution

    Here is how to solve spinner showing white text color on white background. Make sure to use “this” or “getActivity()” in arrayAdapter. Here is correct example : 1234 ArrayAdapter<String> adapterCity = new ArrayAdapter<String>(getActivity(),                     android.R.layout.simple_spinner_item, listCity);             adapterCity.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);         […]

  • Solve action bar null pointer exception ActionBarImplICS notitle

    When we using actionbar appcompat, we should enable window title applications. But, it’s ugly to have window title in our apps. Here is the solution : Update your Android SupportLibrary and use 123getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                 WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_home);

  • Android SDK requires Android Developer Toolkit version 22.6.1 or above

    Here is solution to solve Eclipse have problem after updating Android SDK : Android SDK requires Android Developer Toolkit version 22.6.1 or above 1. Go to Help -> Install New Software 2. Add https://dl-ssl.google.com/eclipse/plugin/4.2 3. Tick on Developer Tools 4. Install and Restart your ADT