Saturday, April 24, 2010

Convert JPG files to PDF in linux

Install imagemagick package
apt-get install  imagemagick
Go to the command prompt and Go to that folder containing jpg
$cd path-to-your-jpg-files
Use Covert  comand to convert jpg to PDF
$convert path-to-your-jpg-files.jpg path-to-yournewfile.pdf
We can use *.jpg to include all jpg files into folder files

Tuesday, April 6, 2010

Debug Database with adb in Andoid

When I have created the sqlite database directly from my application. I am not getting where the database actually stored with application

Then I found that the system stores databases in the /data/data/package_name/databases folder by default.

To access that database We can use adb
Android Debug Bridge (adb) is a versatile tool lets you manage the state of an emulator instance or Android-powered device
  1. adb -s emulator-5554 shell
    adb -s <serialNumber> <command>
  2. sqlite3 /data/data/package_name/databases/database_name
Now you can access sqlite promt 
sqlite> .databases

which display 
seq  name             file                                                     
---  ---------------  ----------------------------------------------------------
1    main          data/data/package_name/databases/databasename

Wednesday, March 31, 2010

Use Google Map API with Android

To Use Google map API few things you have do

Sign Up for Google Map API

Get the MD5 from your local machine :

$ keytool -list -keystore ~/.android/debug.keystore

Certificate fingerprint (MD5): 8E:EA:04:13:F2:A8:A6:E6:A3:A5:20:96:9E:0A:30:DB

And enter the code here and generate the API code (Which looks like below image)
and add code to res/layout/main.xml

    android:apiKey="0T3dTjk2jvhmuFEAdn4DjX08e3eEeA-IoYEnWag" /*Your API key here*/

Now extend the class MapActivity  instead of Activity

gMapView = (MapView) findViewById(;


mc = gMapView.getController();

// Adding zoom controls to Map

ZoomControls zoomControls = (ZoomControls) gMapView.getZoomControls();

zoomControls.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT,




//This method is required for some accounting from the Maps service to see if you're currently displaying any route information. In this case, you're not, so return false.


protected boolean isRouteDisplayed() {

    return false;


In AndroidManifest.xml You also need access to the Internet in order to retrieve map tiles, so you must also request the INTERNET permission. In the manifest file, add the following as a child of the element:

<uses-permission android:name="android.permission.INTERNET"></uses-permission>

And now  Run the application
Output :

Friday, February 12, 2010

Set up Android development environment on Ubuntu 9.10

Experiments with setting up Android development environment in Ubuntu 9.10 karmic koala

Following packages are required for setup

Eclipse IDE

sudo apt-get install eclipse   
JDK 6 

sudo apt-get install sun-java6-jdk
Android SDK
  1. Download the latest Android SDK from 
  2. Copy that package to folder named android into your home folder
  3. tar -xvzf android-sdk_r04-linux_86.tgz
  4. mv android-sdk_r04-linux_86.tgz ~/android/
  5. cd ~/android/
  6. tar xzvf android-sdk_r04-linux_86.tgz
  7. - Edit your ~/.bashrc file and add a line to the bottom:export PATH=${PATH}:/home/padma/android/android-sdk-linux_86/tools/ 
  8. Go to /home/padma/android/android-sdk-linux_86/tools/
  9. run the android script : ./android
  10. In the resulting window, In setting menu add : 
  11. After that an “Available Packages” option. In that add repository link :  I clicked on that, then clicked the checkbox beside the “repository.xml” package to select all available packages and then clicked “Install Selected.”
Android Development Tools (ADT) for Eclipse.  
  1. Download ADT from
  2. Start Eclipse, then select Help > Install New Software.
  3. In the Available Software dialog, click Add....
  4. In the Add Site dialog, click Archive.
  5. Browse and select the downloaded zip file.
  6. Enter a name for the local update site Android Plugin in the "Name" field.
  7. Click OK.
  8. Go to “Window > Preferences” and locate/browse Android SDK path,(e.g here it is   /home/padma/android/android-sdk-linux_86)

Now create your first application with Android :

Tuesday, January 5, 2010

New Year Resolution 2010

 Happy New Year ...

Good resolutions are simply checks that men draw on a bank where they have no account

 This is time to make new year resolution here is mine ..........

- Prioritized work and do accordingly

- Do not spend time in Facebook games
- Stay away from SNS
- Learn any 2 new Programming language/Framework

- Spend time with family