Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5966931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:52:12+00:00 2026-05-22T19:52:12+00:00

My goal is writing a ContentProvider without an Activity. For testing I wrote a

  • 0

My goal is writing a ContentProvider without an Activity. For testing I wrote a test – activity in a own app. For those who want to tell me that there is still a logger included in android, I know this.

Here is part of the ContentProvider

public static final String AUTHORITY = "de.xyz.android.log4android";
public static final int LOGGER_ARROW_URI_ID = 1;
public static final String ARROW_CONTENT_TYPE = 
    "vnd.de.xyz.android.cursor.dir/vnr.log";

public static final int LOGGER_ITEM_URI_ID = 2;
public static final String ITEM_CONTENT_TYPE = 
    "vnd.de.xyz.android.cursor.item/vnr.log";

public static final UriMatcher sUriMatcher;
static {
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(AUTHORITY, LOGGER_TABLE, LOGGER_ARROW_URI_ID);
    sUriMatcher.addURI(AUTHORITY, LOGGER_TABLE + "#", LOGGER_ITEM_URI_ID);
}

public static final Uri CONTENT_URI = Uri.parse("content://"
        + LogServiceProvider.AUTHORITY + "/logs");

public static final DefaultLogEntry LOG_ENTRY = null;

//Some more not important code

@Override
public Uri insert(Uri uri, ContentValues initialValues) {
    synchronized (this) {
        try {
            long rowID = dbHelper.getWritableDatabase().insert(LOGGER_TABLE,
                    null, initialValues);

            if (rowID > 0) {
                Uri _uri = ContentUris.withAppendedId(CONTENT_URI, rowID);
                getContext().getContentResolver().notifyChange(_uri, null);
                return _uri;
            }
        } catch (Exception ex) {
        }
        throw new SQLException("Failed to insert row into " + uri);
    }
}

//Some more not important code

So I also add the Content Provider Information to manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="de.xyz.android.logger"
          android:versionCode="1"
          android:versionName="1.0">

    <provider 
        android:name="de.xyz.android.logger.LogServiceProvider" 
        android:authorities="de.xyz.android.log4android"/>

    <application android:icon="@drawable/icon" android:label="@string/app_name">
    <uses-sdk android:minSdkVersion="4" /> 
</application>

Here Is the part out of my Client activity, that is in a seperate app.

ContentResolver cr = getContentResolver();
Uri getItem = Uri.parse("content://de.xyz.android.log4android/logs");
ContentValues values = new ContentValues();
values.put("level","WARNING");
values.put("time","1986-11-16");
values.put("message","FistTest");
values.put("owner","jsb");
values.put("file","testLog.java");
values.put("line","27");
Uri newItem = cr.insert(getItem, values);

LogCat tells me that TestClient cant find the ContentProvider

05-27 12:42:52.099: ERROR/ActivityThread(548): Failed to find provider info for de.xyz.android.log4android

Where is my error. In my opinion I did all mentioned in: Content Providers | Android. It would be nice if you could give me an hint. If you need more code fragments to understand ask me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:52:13+00:00Added an answer on May 22, 2026 at 7:52 pm
    <provider android:name=".LogServiceProvider"
              android:authorities="de.xyz.android.log4android"
              android:exported="true" />
    

    should help 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am tasked with writing a WPF app that performs crud on 100 or
Goal: Disable links before ajax:success is received. (then i'll tell my app server thing
I am writing a web-framework for Python, of which the goal is to be
my goal is to write a stored proc that can collect all field values
When writing a mathematical proof, one goal is to continue compressing the proof. The
I am writing a qt application, with the goal of it being portable to
I am writing a game in XNA. The first main goal is to have
I'm planning on writing a referral program for my recent startup. The goal is
i'm writing my first iPhone app with aim to upload it to the AppStore
Goal I'm porting a filesystem to Windows, and am writing a more Windows-like interface

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.