Friday, 22 November 2013

How to TRUNCATE SQLServer CE 3.5

SQLServer Compact Edition 3.5, does not support the truncate function supported by some other database servers like MS SQL Server ,mysql serever etc. so i decided, to do a little walk around and found a little piece of code that enables you do have with some considerable speed. Just follow this two step process and you are done.
  • First Delete all columns in the database table. use the query :

    DELETE FROM tablename;

    where tablename is the name of your table.
    NOTE :your delete query do not need the where clause since you are deleting all rows in the table.
  • Add the query :

    ALTER TABLE yourtablename ALTER COLUMN ID IDENITY(1,1)

    and you should see your table reset to its initial status with no rows or identity.

Wednesday, 29 May 2013

Android developmet - impelemting Android splash screen

To customise your android application to start as a splash screen on clicking its icon from home screen, follow this steps
  • After creating the project skeleton, note that a file called MainActivity.java has been created for you already in src floder.
  • Also notice that an xml file called activity_main.xml has also been added to your layout folder
  • Also note that for each activity , they exit an intent filter registerd.
  • Now create a new android Activity called splash with a corresponding splash. xml created in layouts for you.
  • Next go the xml file created for you and add a Frame layout the default relative layout alredy created for you.
  • On the frame layout , add an imageview containing the splash image
  • Next go to your manifest file and edit the intent filter for the the mainActivity, set its category to default instead of launcher
  • create intent filter for your splash activity, setting its action to main and category to launcher.