Weblog of Alif

Exploring the Web: An Apple a day


MySQL Tip: Using Bitwise Operations for Multivalued Attributes

December 17, 2013 -- alif

Recently, I was working on an Application when I decided to use bitwise operations on a multi-valued attribute. I haven't done any performance benchmarks, but I would think this should improve the performance on making Queries.

Here's an example: Suppose we want to store Users and their Interests. We should have the following 3 Tables:

  1. Users - Stores User Information
  2. Interests - Various Interests
  3. UserInterests - Stores the Relationship between Users and Interests

Android Volley Tutorial - Making HTTP GET, POST, PUT, DELETE Requests

July 31, 2013 -- alif

Google released Android Volley Library around May/June 2013, which has been internally used by Google for some time. It is supposed to provide Fast Networking Operations and also takes care of Threads nicely. If you are unfamiliar with Volley, please see Google I/O 2013 Video

Unfortunately, there is almost no documentation on Volley. So, I put together code snippets on how to make Volley HTTP Requests (GET, POST, PUT, DELETE).

Android activity hide action bar

May 16, 2013 -- alif

If the Action bar of an Android's activity needs to be hidden through the manifest xml file (non Java Programming), then the easy way is to add the following attribute in Activity tag:


However, if a custom Theme is created then it is convenient to create another style extending the custom theme and then adding the following two items in it.

Android Tip: Elegant Restful requests with Spring Template

March 5, 2013 -- alif

In this article, we shall create a basic Android App showing how to make REST requests in an Android App in a clean/structured way. Many Articles on the Web creates an inner class inside the Activity or passes Activity into another class, which can make the code messy. This tutorial focuses on how to make HTTP requests in a more organized/cleaner way by using callbacks.


Using OAuth 2.0 with Google API in Phonegap / ChildBrowser

September 9, 2012 -- alif

This article explains how to implement OAuth 2 with Google API (gapi) on Phonegap using Childbrowser Plugin. We will authorize Google Tasks API from Phonegap and then retrieve a list of Tasks (of default list) from Google Server.

Symfony2 - Displaying error, info, warning messages internationalization

August 12, 2012 -- alif

Sometimes you want to display an info, warning or error message in Symfony2. It could be a simple notice about a new feature or a success message when user updates profile. Symfony2's official site explains how to display messages using Session, but, in their example, they 'hardcode' the message inside controller. I shall explain how to add internationalization very easily in messages.

Address to Lat Lon without API key using Google Geocoder in PHP

July 27, 2012 -- alif

I am recently developing an Application where I need to convert Address and intersection to Lat & Long. I wrote a similar post, but when I revisited Google Maps today, I find out that their new Web Services and Javascript V3 API is much more simplified.

You do not need any Maps API key anymore.

Below is their new url, you need to specify the output format as either xml or json, and pass address and sensor as arguments

Check if a database exist (android sqlite3_open_v2 failed)

May 3, 2011 -- alif
Recently, I have been developing an android application where I shipped an sqlite database with the application. The Sqlite is initially stored at assets folder, and then copied to the proper directory (/data/data/[package]/databases/[db-name]) upon launch. I had the following piece of code for checking the existence of a database.


Subscribe to RSS - blogs