Monday, August 9, 2010

How to create a Simple database in Android

To create a database
step1:
Intialize a SQLiteDatabase  variable ( SQLiteDatabase sample = null; )
step2:
Instantiate above variable Like sample  =  this.openOrCreateDatabase(DATABASE_NAME,MODE_PRIVATE,null);
step3:
This step is for to create a table in the database
sample.execSQL(CREATE TABLE IF NOT EXISTS TABLE_NAME ( FIRSTNAME VARCHAR , LASTNAME  VARCHAR));
These Three Steps Will Create a  database with a table

Friday, August 6, 2010

How to Install android apk File in the emulator

To install a apk file into the Android Emulator :

  • Install Android SDK  from the Site 
  • Extract the zip to D:\android-sdk-windows (or goto the directory u have extracted)
  • Next copy your apk file  to D:\android-sdk-windows\tools
  •  Goto Start -- Run ....& type cmd in that box.
  • In the Black Screen(Command Prompt) Type the Following
    • your installed driver for example D: ( press enter )
    •  cd  android-sdk-windows  ( press enter ) if  it's difficult to type the entire name use TAB
    •  cd tools ( press enter )
    • adb install your_application.apk
  • Next SEE YOUR APP ON THE EMULATOR
    • If not  or any other problem uses the following in the same Command prompt
        • $adb kill-server
        • $adb start-server   (restart the adb)