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

like
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

    <com.google.android.maps.MapView
    android:id="@+id/myGMap"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:enabled="true"
    android:clickable="true"
    android:apiKey="0T3dTjk2jvhmuFEAdn4DjX08e3eEeA-IoYEnWag" /*Your API key here*/
    />

Now geol.java extend the class MapActivity  instead of Activity

gMapView = (MapView) findViewById(R.id.myGMap);

gMapView.setSatellite(true);

mc = gMapView.getController();

// Adding zoom controls to Map

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

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

LayoutParams.WRAP_CONTENT));

gMapView.addView(zoomControls);

gMapView.displayZoomControls(true);


//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.

@Override

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 http://developer.android.com/sdk/index.html 
  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 :  https://dl-ssl.google.com/android/repository/repository.xml 
  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.”
  12.  
Android Development Tools (ADT) for Eclipse.  
  1. Download ADT from http://dl.google.com/android/ADT-0.9.5.zip
  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 : http://developer.android.com/guide/tutorials/hello-world.html

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

Sunday, November 29, 2009

Problem in Starting Zend Studio

Whenever you find the problem in Starting Zend Studio , and it is not giving any error then just do 3 simple steps

  1. Close ZDE.
  2. Locate the fileTypes directory under
    {your user home directory}\ZDE\config_X.Y\fileTypes and delete it.(Where X.Y are Zend Studio version numbers,for versions of Zend Studio older than 3.5.x this directory is named:{Your user home directory}\ZDE\config\fileTypes)
  3.  Start ZDE again.

Monday, November 23, 2009

Admin category sidewide to wordpressmu

To add the sidewide categery to your wordpressmu site download the plugin from


http://wpmudev.org/project/Add-default-categories-to-all-new-blogs/download

Extract to the mu-plugins folder

With this plugin you will be able to create a list of categories that will be created in every new blog created