<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments for Paolo Casarini</title>
	<atom:link href="http://www.casarini.org/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.casarini.org/blog</link>
	<description>happy programming</description>
	<pubDate>Thu, 09 Sep 2010 11:53:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>Comment on AiC mobile per Android esce sul Market by paolo</title>
		<link>http://www.casarini.org/blog/2010/aic-mobile-per-android-esce-sul-market/#comment-21595</link>
		<dc:creator>paolo</dc:creator>
		<pubDate>Fri, 27 Aug 2010 06:38:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.casarini.org/blog/?p=419#comment-21595</guid>
		<description>Grazie, proprio ieri ho rilasciato una nuova versione (1.1.0).
Nel caso trovassi difetti o avessi suggerimenti puoi scrivermi o aprire un issue su http://code.google.com/p/aicmobile/</description>
		<content:encoded><![CDATA[<p>Grazie, proprio ieri ho rilasciato una nuova versione (1.1.0).<br />
Nel caso trovassi difetti o avessi suggerimenti puoi scrivermi o aprire un issue su <a href="http://code.google.com/p/aicmobile/" rel="nofollow">http://code.google.com/p/aicmobile/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AiC mobile per Android esce sul Market by Marcello</title>
		<link>http://www.casarini.org/blog/2010/aic-mobile-per-android-esce-sul-market/#comment-21594</link>
		<dc:creator>Marcello</dc:creator>
		<pubDate>Thu, 26 Aug 2010 23:25:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.casarini.org/blog/?p=419#comment-21594</guid>
		<description>sei un miiiitooo!!! grz mille!!! lo testo per bene!</description>
		<content:encoded><![CDATA[<p>sei un miiiitooo!!! grz mille!!! lo testo per bene!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android ContentProvider on SQLite tables without the _id column by paolo</title>
		<link>http://www.casarini.org/blog/2009/android-contentprovider-on-sqlite-tables-without-the-_id-column/#comment-21591</link>
		<dc:creator>paolo</dc:creator>
		<pubDate>Thu, 05 Aug 2010 13:51:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.casarini.org/blog/?p=216#comment-21591</guid>
		<description>In the query method example I assume a mOpenHelper object as a member variable that is able to provide a SQLiteDatabase object through the getReadableDatabase method.

If you need a class for it, an example could be the following:

[java]
public class SQLiteDatabaseHelper {
    private static final String TAG = SQLiteDatabaseHelper.class.getSimpleName();

    private final CursorFactory factory;
    private final int version;
    private final File dbFile;
    
    private SQLiteDatabase database;
    private boolean isInitializing;
    
    /**
     * Create a helper object to create, open, and/or manage a database
     * already built and provide in specific path.
     * The database is not actually created or opened until one of
     * {@link #getWritableDatabase} or {@link #getReadableDatabase} is called.
     *
     * @param dbpath the path of the database file
     * @param factory to use for creating cursor objects, or null for the default
     * @param version number of the database
     */    
    public SQLiteDatabaseHelper(String dbpath, CursorFactory factory, int version) {
        this.factory = factory;
        this.version = version;
        dbFile = new File(dbpath);
    }
    
    public synchronized SQLiteDatabase getWritableDatabase() {
        if (database != null &#038;&#038; database.isOpen() &#038;&#038; !database.isReadOnly()) {
            return database;  // The database is already open for business
        }

        if (isInitializing) {
            throw new IllegalStateException("getWritableDatabase called recursively");
        }

        boolean success = false;
        SQLiteDatabase db = null;
        try {
            isInitializing = true;
            if (dbFile.exists()) {
                db = SQLiteDatabase.openDatabase(dbFile.getPath(), factory, SQLiteDatabase.OPEN_READWRITE);
                if (db.getVersion() != version) {
                    throw new SQLiteException("The database in [" + dbFile.getPath() +
                            "] has version [" + db.getVersion() + "] while the version needed is [" + version +"]");
                }
            } else {
                throw new SQLiteException("Error while opening database: the file [" + dbFile.getPath() + "] does not exist");
            }
            
            success = true;
            return db;
        } finally {
            isInitializing = false;
            if (success) {
                if (database != null) {
                    try { database.close(); } catch (Exception e) {}
                }
                database = db;
            } else {
                if (db != null) db.close();
            }
        }
    }
    
    public synchronized SQLiteDatabase getReadableDatabase() {
        if (database != null &#038;&#038; database.isOpen()) {
            return database;  // The database is already open for business
        }
        
        if (isInitializing) {
            throw new IllegalStateException("getReadableDatabase called recursively");
        }
        
        try {
            return getWritableDatabase();
        } catch (SQLiteException e) {
            Log.w(TAG, "Couldn't open " + dbFile.getPath() + " for writing (will try read-only):", e);
        }
        
        SQLiteDatabase db = null;
        try {
            isInitializing = true;
            db = SQLiteDatabase.openDatabase(dbFile.getPath(), factory, SQLiteDatabase.OPEN_READONLY);
            if (db.getVersion() != version) {
                throw new SQLiteException("The database in [" + dbFile.getPath() +
                        "] has version [" + db.getVersion() + "] while the version needed is [" + version +"]");
            }
            
            Log.i(TAG, "Opened " + dbFile.getPath() + " in read-only mode");
            database = db;
            return database;
        } finally {
            isInitializing = false;
            if (db != null &#038;&#038; db != database) db.close();
        }
    }
    
    public synchronized void close() {
        if (database != null) {
            try { database.close(); } catch (Exception e) {}
        }
    }
}
[/java]</description>
		<content:encoded><![CDATA[<p>In the query method example I assume a mOpenHelper object as a member variable that is able to provide a SQLiteDatabase object through the getReadableDatabase method.</p>
<p>If you need a class for it, an example could be the following:</p>
<p>[java]<br />
public class SQLiteDatabaseHelper {<br />
    private static final String TAG = SQLiteDatabaseHelper.class.getSimpleName();</p>
<p>    private final CursorFactory factory;<br />
    private final int version;<br />
    private final File dbFile;</p>
<p>    private SQLiteDatabase database;<br />
    private boolean isInitializing;</p>
<p>    /**<br />
     * Create a helper object to create, open, and/or manage a database<br />
     * already built and provide in specific path.<br />
     * The database is not actually created or opened until one of<br />
     * {@link #getWritableDatabase} or {@link #getReadableDatabase} is called.<br />
     *<br />
     * @param dbpath the path of the database file<br />
     * @param factory to use for creating cursor objects, or null for the default<br />
     * @param version number of the database<br />
     */<br />
    public SQLiteDatabaseHelper(String dbpath, CursorFactory factory, int version) {<br />
        this.factory = factory;<br />
        this.version = version;<br />
        dbFile = new File(dbpath);<br />
    }</p>
<p>    public synchronized SQLiteDatabase getWritableDatabase() {<br />
        if (database != null &#038;&#038; database.isOpen() &#038;&#038; !database.isReadOnly()) {<br />
            return database;  // The database is already open for business<br />
        }</p>
<p>        if (isInitializing) {<br />
            throw new IllegalStateException(&#8221;getWritableDatabase called recursively&#8221;);<br />
        }</p>
<p>        boolean success = false;<br />
        SQLiteDatabase db = null;<br />
        try {<br />
            isInitializing = true;<br />
            if (dbFile.exists()) {<br />
                db = SQLiteDatabase.openDatabase(dbFile.getPath(), factory, SQLiteDatabase.OPEN_READWRITE);<br />
                if (db.getVersion() != version) {<br />
                    throw new SQLiteException(&#8221;The database in [" + dbFile.getPath() +<br />
                            "] has version [" + db.getVersion() + "] while the version needed is [" + version +"]&#8220;);<br />
                }<br />
            } else {<br />
                throw new SQLiteException(&#8221;Error while opening database: the file [" + dbFile.getPath() + "] does not exist&#8221;);<br />
            }</p>
<p>            success = true;<br />
            return db;<br />
        } finally {<br />
            isInitializing = false;<br />
            if (success) {<br />
                if (database != null) {<br />
                    try { database.close(); } catch (Exception e) {}<br />
                }<br />
                database = db;<br />
            } else {<br />
                if (db != null) db.close();<br />
            }<br />
        }<br />
    }</p>
<p>    public synchronized SQLiteDatabase getReadableDatabase() {<br />
        if (database != null &#038;&#038; database.isOpen()) {<br />
            return database;  // The database is already open for business<br />
        }</p>
<p>        if (isInitializing) {<br />
            throw new IllegalStateException(&#8221;getReadableDatabase called recursively&#8221;);<br />
        }</p>
<p>        try {<br />
            return getWritableDatabase();<br />
        } catch (SQLiteException e) {<br />
            Log.w(TAG, &#8220;Couldn&#8217;t open &#8221; + dbFile.getPath() + &#8221; for writing (will try read-only):&#8221;, e);<br />
        }</p>
<p>        SQLiteDatabase db = null;<br />
        try {<br />
            isInitializing = true;<br />
            db = SQLiteDatabase.openDatabase(dbFile.getPath(), factory, SQLiteDatabase.OPEN_READONLY);<br />
            if (db.getVersion() != version) {<br />
                throw new SQLiteException(&#8221;The database in [" + dbFile.getPath() +<br />
                        "] has version [" + db.getVersion() + "] while the version needed is [" + version +"]&#8220;);<br />
            }</p>
<p>            Log.i(TAG, &#8220;Opened &#8221; + dbFile.getPath() + &#8221; in read-only mode&#8221;);<br />
            database = db;<br />
            return database;<br />
        } finally {<br />
            isInitializing = false;<br />
            if (db != null &#038;&#038; db != database) db.close();<br />
        }<br />
    }</p>
<p>    public synchronized void close() {<br />
        if (database != null) {<br />
            try { database.close(); } catch (Exception e) {}<br />
        }<br />
    }<br />
}<br />
[/java]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android ContentProvider on SQLite tables without the _id column by Mikey</title>
		<link>http://www.casarini.org/blog/2009/android-contentprovider-on-sqlite-tables-without-the-_id-column/#comment-21590</link>
		<dc:creator>Mikey</dc:creator>
		<pubDate>Thu, 05 Aug 2010 13:24:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.casarini.org/blog/?p=216#comment-21590</guid>
		<description>Can you please state solution for "mOpenHelper cannot be resolved" ?
Do we need to use own DBHelper?</description>
		<content:encoded><![CDATA[<p>Can you please state solution for &#8220;mOpenHelper cannot be resolved&#8221; ?<br />
Do we need to use own DBHelper?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PostgreSQL 8.4 e il locale it_IT by Pietro</title>
		<link>http://www.casarini.org/blog/2009/postgresql-84-e-il-locale-it_it/#comment-21588</link>
		<dc:creator>Pietro</dc:creator>
		<pubDate>Mon, 12 Jul 2010 13:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.casarini.org/blog/?p=280#comment-21588</guid>
		<description>Grazie paolo! Ho risolto!</description>
		<content:encoded><![CDATA[<p>Grazie paolo! Ho risolto!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PostgreSQL 8.4 e il locale it_IT by paolo</title>
		<link>http://www.casarini.org/blog/2009/postgresql-84-e-il-locale-it_it/#comment-21587</link>
		<dc:creator>paolo</dc:creator>
		<pubDate>Mon, 12 Jul 2010 12:14:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.casarini.org/blog/?p=280#comment-21587</guid>
		<description>I think you should generate the it_IT.UF8 before:
# locale-gen it_IT.UTF-8

More information at the end of the following page:
https://help.ubuntu.com/community/Locale</description>
		<content:encoded><![CDATA[<p>I think you should generate the it_IT.UF8 before:<br />
# locale-gen it_IT.UTF-8</p>
<p>More information at the end of the following page:<br />
<a href="https://help.ubuntu.com/community/Locale" rel="nofollow">https://help.ubuntu.com/community/Locale</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PostgreSQL 8.4 e il locale it_IT by Pietro</title>
		<link>http://www.casarini.org/blog/2009/postgresql-84-e-il-locale-it_it/#comment-21586</link>
		<dc:creator>Pietro</dc:creator>
		<pubDate>Mon, 12 Jul 2010 10:57:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.casarini.org/blog/?p=280#comment-21586</guid>
		<description>Ciao,
sono nella tua stessa situazione (PostgreSQL 8.4 e Encoding UTF8 dei database di default, Collation e Ctype en_US.UTF-8). Ho provato a creare un database con:

CREATE DATABASE miodb OWNER mioutente ENCODING='UTF-8' LC_COLLATE='it_IT.UTF-8' LC_CTYPE='it_IT.UTF-8' TABLESPACE=miotbs;

e mi viene restituito un errore:
ERROR:  invalid locale name it_IT.UTF8

Non riesco a venirne a capo. Qualche consiglio?

Pietro</description>
		<content:encoded><![CDATA[<p>Ciao,<br />
sono nella tua stessa situazione (PostgreSQL 8.4 e Encoding UTF8 dei database di default, Collation e Ctype en_US.UTF-8). Ho provato a creare un database con:</p>
<p>CREATE DATABASE miodb OWNER mioutente ENCODING=&#8217;UTF-8&#8242; LC_COLLATE=&#8217;it_IT.UTF-8&#8242; LC_CTYPE=&#8217;it_IT.UTF-8&#8242; TABLESPACE=miotbs;</p>
<p>e mi viene restituito un errore:<br />
ERROR:  invalid locale name it_IT.UTF8</p>
<p>Non riesco a venirne a capo. Qualche consiglio?</p>
<p>Pietro</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android ContentProvider on SQLite tables without the _id column by Lorenz</title>
		<link>http://www.casarini.org/blog/2009/android-contentprovider-on-sqlite-tables-without-the-_id-column/#comment-21573</link>
		<dc:creator>Lorenz</dc:creator>
		<pubDate>Mon, 07 Jun 2010 23:44:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.casarini.org/blog/?p=216#comment-21573</guid>
		<description>Nice article for android sqlite, thanx for write it up..:-)</description>
		<content:encoded><![CDATA[<p>Nice article for android sqlite, thanx for write it up..:-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AiC mobile by &#187; GlutenBuster, il prontuario dei prodotti senza glutine per la dieta dei celiaci &#187; Android, Google, Software, - AndroidWorld.it</title>
		<link>http://www.casarini.org/blog/aicmobile/#comment-21570</link>
		<dc:creator>&#187; GlutenBuster, il prontuario dei prodotti senza glutine per la dieta dei celiaci &#187; Android, Google, Software, - AndroidWorld.it</dc:creator>
		<pubDate>Sun, 06 Jun 2010 08:02:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.casarini.org/blog/?page_id=339#comment-21570</guid>
		<description>[...] avete modo di testare il software lo sviluppatore chiede aiuto sul suo sito web.  AKPC_IDS += "16355,";Popularity: unranked [...]</description>
		<content:encoded><![CDATA[<p>[...] avete modo di testare il software lo sviluppatore chiede aiuto sul suo sito web.  AKPC_IDS += &#8220;16355,&#8221;;Popularity: unranked [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PostgreSQL 8.4 e il locale it_IT by Postgres server con uuid e database unicode UTF-8 &#124; matteo consolati</title>
		<link>http://www.casarini.org/blog/2009/postgresql-84-e-il-locale-it_it/#comment-21546</link>
		<dc:creator>Postgres server con uuid e database unicode UTF-8 &#124; matteo consolati</dc:creator>
		<pubDate>Fri, 21 May 2010 01:32:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.casarini.org/blog/?p=280#comment-21546</guid>
		<description>[...] - http://www.casarini.org/blog/2009/postgresql-84-e-il-locale-it_it/ [...]</description>
		<content:encoded><![CDATA[<p>[...] - <a href="http://www.casarini.org/blog/2009/postgresql-84-e-il-locale-it_it/" rel="nofollow">http://www.casarini.org/blog/2009/postgresql-84-e-il-locale-it_it/</a> [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
