== Adding the Content Provider Package ==
The next step is to add a new package to the DatabaseProvider project into which the content provider class will be created. Add this new package by navigating within the Project tool window to DatabaseProvider - > app -> src -> main -> java, right clicking on the java entry and selecting the New -> Package menu option. In the New Package dialog, enter the following package name into the name field before clicking on the OK button:
<pre>
com.ebookfrenzy.database.database.provider
</pre>
[[Image:android_studio_new_package_addedandroid_studio_new_package_added2.png|A new package added to an Android Studio project]]
Figure 42-1
<pre>
com.ebookfrenzy.database.database.provider.MyContentProvider
</pre>
<pre>
package com.ebookfrenzy.database.database.provider;
import android.content.ContentProvider;
<pre>
package com.ebookfrenzy.database.database.provider;
import android.content.ContentProvider;
private static final String AUTHORITY =
"com.ebookfrenzy.database.database.provider.MyContentProvider";
private static final String PRODUCTS_TABLE = "products";
public static final Uri CONTENT_URI =
<pre>
package com.ebookfrenzy.database.database.provider;
import android.content.ContentProvider;
private static final String AUTHORITY =
"com.ebookfrenzy.database.database.provider.MyContentProvider";
private static final String PRODUCTS_TABLE = "products";
public static final Uri CONTENT_URI =
private static final String AUTHORITY =
"com.ebookfrenzy.database.database.provider.MyContentProvider";
private static final String PRODUCTS_TABLE = "products";
public static final Uri CONTENT_URI =
<pre>
package com.ebookfrenzy.database.database.provider;
import com.ebookfrenzy.database.database.MyDBHandler;
import android.content.ContentProvider;
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ebookfrenzy.database.database" >
<application
android:theme="@style/AppTheme" >
<activity
android:name="com.ebookfrenzy.database.database.DatabaseActivity"
android:label="@string/app_name" >
<intent-filter>
</activity>
Exception encountered, of type "Error"
[0b9a3f36] /index.php/Special:MobileDiff/17220 Error from line 434 of /var/www/techotopia/includes/diff/DairikiDiff.php: Call to undefined function each()
Backtrace:
#0 /var/www/techotopia/includes/diff/DairikiDiff.php(544): DiffEngine->diag()
#1 /var/www/techotopia/includes/diff/DairikiDiff.php(344): DiffEngine->compareSeq()
#2 /var/www/techotopia/includes/diff/DairikiDiff.php(227): DiffEngine->diffLocal()
#3 /var/www/techotopia/includes/diff/DairikiDiff.php(721): DiffEngine->diff()
#4 /var/www/techotopia/includes/diff/DairikiDiff.php(859): Diff->__construct()
#5 /var/www/techotopia/includes/diff/DairikiDiff.php(980): MappedDiff->__construct()
#6 /var/www/techotopia/extensions/MobileFrontend/includes/diff/InlineDiffFormatter.php(99): WordLevelDiff->__construct()
#7 /var/www/techotopia/includes/diff/DiffFormatter.php(140): InlineDiffFormatter->changed()
#8 /var/www/techotopia/includes/diff/DiffFormatter.php(82): DiffFormatter->block()
#9 /var/www/techotopia/extensions/MobileFrontend/includes/diff/InlineDifferenceEngine.php(117): DiffFormatter->format()
#10 /var/www/techotopia/includes/diff/DifferenceEngine.php(797): InlineDifferenceEngine->generateTextDiffBody()
#11 /var/www/techotopia/includes/diff/DifferenceEngine.php(728): DifferenceEngine->generateContentDiffBody()
#12 /var/www/techotopia/extensions/MobileFrontend/includes/specials/SpecialMobileDiff.php(241): DifferenceEngine->getDiffBody()
#13 /var/www/techotopia/extensions/MobileFrontend/includes/specials/SpecialMobileDiff.php(135): SpecialMobileDiff->showDiff()
#14 /var/www/techotopia/extensions/MobileFrontend/includes/specials/MobileSpecialPage.php(53): SpecialMobileDiff->executeWhenAvailable()
#15 /var/www/techotopia/includes/specialpage/SpecialPage.php(384): MobileSpecialPage->execute()
#16 /var/www/techotopia/includes/specialpage/SpecialPageFactory.php(553): SpecialPage->run()
#17 /var/www/techotopia/includes/MediaWiki.php(281): SpecialPageFactory::executePath()
#18 /var/www/techotopia/includes/MediaWiki.php(714): MediaWiki->performRequest()
#19 /var/www/techotopia/includes/MediaWiki.php(508): MediaWiki->main()
#20 /var/www/techotopia/index.php(41): MediaWiki->run()
#21 {main}