<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Android 1.5 and Database Storage</title>
	<atom:link href="http://blogs.nitobi.com/joe/2009/12/07/android-1-5-and-database-storage/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.nitobi.com/joe/2009/12/07/android-1-5-and-database-storage/</link>
	<description>A blog about what I do during the day</description>
	<lastBuildDate>Thu, 07 Jul 2011 01:00:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Joe B</title>
		<link>http://blogs.nitobi.com/joe/2009/12/07/android-1-5-and-database-storage/comment-page-1/#comment-11323</link>
		<dc:creator>Joe B</dc:creator>
		<pubDate>Mon, 04 Jan 2010 19:52:08 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.nitobi.com/joe/?p=158#comment-11323</guid>
		<description>This is about inheritance and not about relection.  In fact, this has nothing to do with reflection.

This pattern apppears a LOT in PhoneGap.  However, it can only appear in the DroidGap class.  If you have a class derived from the DroidGap class that&#039;s in its own activity, $PACKAGE will not be com.phonegap and instead will be the package of the derived app.

However, I didn&#039;t realize this at the time, and shoved this into Storage, and since we&#039;re using a Storage class, and not a class that was derived from storage, storage will give com.phonegap.  Because of this, I&#039;ve had to seperate this up into multiple calls, which is not the best thing to do, and this may be refactored in the future.

So, to recap.  If you have a class that inherits another class, and you call this in the base class, it will get the package name of the derived class, since the derived class can have a different package than the base class.

But yeah, thanks for finding the bug.</description>
		<content:encoded><![CDATA[<p>This is about inheritance and not about relection.  In fact, this has nothing to do with reflection.</p>
<p>This pattern apppears a LOT in PhoneGap.  However, it can only appear in the DroidGap class.  If you have a class derived from the DroidGap class that&#8217;s in its own activity, $PACKAGE will not be com.phonegap and instead will be the package of the derived app.</p>
<p>However, I didn&#8217;t realize this at the time, and shoved this into Storage, and since we&#8217;re using a Storage class, and not a class that was derived from storage, storage will give com.phonegap.  Because of this, I&#8217;ve had to seperate this up into multiple calls, which is not the best thing to do, and this may be refactored in the future.</p>
<p>So, to recap.  If you have a class that inherits another class, and you call this in the base class, it will get the package name of the derived class, since the derived class can have a different package than the base class.</p>
<p>But yeah, thanks for finding the bug.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Sheldon</title>
		<link>http://blogs.nitobi.com/joe/2009/12/07/android-1-5-and-database-storage/comment-page-1/#comment-11287</link>
		<dc:creator>Mike Sheldon</dc:creator>
		<pubDate>Fri, 01 Jan 2010 16:01:07 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.nitobi.com/joe/?p=158#comment-11287</guid>
		<description>This approach will result in appPackage being given the value of &quot;com.phonegap&quot; (the package which the Storage class is in). Which I don&#039;t think is really what you want, as it would mean any application that wants to make use of droidStorage would need to be in the com.phonegap package since access to /data/data/$PACKAGE is restricted to applications in $PACKAGE (this would also mean that all phonegap apps would also be able to access the databases from any other phonegap apps).

If you try accessing droidStorage from an application in package other than &quot;com.phonegap&quot; you&#039;ll get the following error:

E/Database(11458): sqlite3_open_v2(&quot;/data/data/com.phonegap/databases/iyfsexperience.db&quot;, &amp;handle, 6, NULL) failed

After which the application will crash.

Perhaps it would be better if there was a mechanism for setting the path manually?

My interpretation of this could be wrong, as my knowledge of java reflection is fairly shallow but my testing (and the resultant errors/crashes) seems to bear it out.

Cheers,
 Mike.</description>
		<content:encoded><![CDATA[<p>This approach will result in appPackage being given the value of &#8220;com.phonegap&#8221; (the package which the Storage class is in). Which I don&#8217;t think is really what you want, as it would mean any application that wants to make use of droidStorage would need to be in the com.phonegap package since access to /data/data/$PACKAGE is restricted to applications in $PACKAGE (this would also mean that all phonegap apps would also be able to access the databases from any other phonegap apps).</p>
<p>If you try accessing droidStorage from an application in package other than &#8220;com.phonegap&#8221; you&#8217;ll get the following error:</p>
<p>E/Database(11458): sqlite3_open_v2(&#8220;/data/data/com.phonegap/databases/iyfsexperience.db&#8221;, &amp;handle, 6, NULL) failed</p>
<p>After which the application will crash.</p>
<p>Perhaps it would be better if there was a mechanism for setting the path manually?</p>
<p>My interpretation of this could be wrong, as my knowledge of java reflection is fairly shallow but my testing (and the resultant errors/crashes) seems to bear it out.</p>
<p>Cheers,<br />
 Mike.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

