Check Database exist fails android sqlite3openv2

I developed 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. public boolean databaseExist() { SQLiteDatabase checkDB = null; try […]

Continue reading →

PHP DomXPath: Read Complex XML files easily.

XPath allows traversing through XML elements and attributes very easily. For complex XMLs, using XPath can significantly reduce the complexity of coding. Good Tutorial of XPath can be viewed on W3C schools here. Reference on DomXPath can be viewed here. XPath is useful if someone needs to extract a specific node from an entire XML, […]

Continue reading →

PHP 5 DOM and XMLReader: Reading XML with Namespace (Part 1)

PHP-5’s DOM and XMLReader provides the ability to read XML files easily. The good thing about PHP-5’s DOM (mainly DomDocument, DomNodeList, DomNode) is that it implements the standard DOM features as specified by W3C. W3C’s reference on DOM can be viewed here. So, if someone has used DOM before (say on JavaScript), then it would […]

Continue reading →

PHP-5 DomDocument: Creating a Basic XML

DomDocument is a powerful library of PHP-5 to create XML. In this article, I will try to explain the basics of DomDocument and then will create a couple of simple XML files. First, lets have a look at a simple XML file: Taken from W3C’s example: <?xml version=”1.0″ encoding=”ISO-8859-1″?> >note> <to>Tove>/to> <from>Jani>/from> <heading>Reminder>/heading> <desc>Don’t forget […]

Continue reading →