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

  • SEARCH
  • Home
  • 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 6234483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:29:37+00:00 2026-05-24T10:29:37+00:00

I am trying to learn the content provider implementation and how it works. I

  • 0

I am trying to learn the content provider implementation and how it works. I tried the sample notepad application in Android SDK and everything is working fine. I am able to create new notes and save them and edit them.

I tried changing this content provider to custom implementation. This is working fine. But I dont understand the below implementations

1) why is the Notepad.java defined two times once within the folder “com.example.android.notepad” and then within “com.google.provider”.

2) How is the intent type “content://com.vinod.provider.NotePad/notes” going to the list and “content://com.vinod.provider.NotePad/notes/2” going to the edit activity? how is this controlled?

3) in the manifest I see mime type like “vnd.android.cursor.dir/vnd.google.note”. what does the vnd.android.cursor.dir and vnd.android.cursor.item stands for. And what is “vnd.google.note”

Can some one please explain me these questions. Thank you for your time and help.

  • 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-24T10:29:38+00:00Added an answer on May 24, 2026 at 10:29 am

    1) Two Files

    They are two different classes — com.example.android.notepad is a class that implements the application. com.google.provider.notepad is a class that implements the ContentProvider.

    The application provides the user interface, the ContentProvider provides data storage.

    Looking at This link to the Notepad ContentProvider example, its’ naming is much clearer.


    2) URI Matching

    Referencing NotepadProvider.java:

      sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
      sUriMatcher.addURI(NotePad.AUTHORITY, "notes", NOTES);
      sUriMatcher.addURI(NotePad.AUTHORITY, "notes/#", NOTE_ID);
    

    UriMatcher takes a list of patterns. NotePad.AUTHORITY is the base of the content URI.

    "notes" is one pattern to match, and the enum NOTES is returned.
    "notes/#" is one pattern to match, and the enum NOTE_ID is returned.

    switch (sUriMatcher.match(uri)) {
    case NOTES:
       ...
       break;
    
    case NOTES:
       ...
       break;
    
    default:
       ...
       break;
    }
    

    Is the pattern for making a decision to run different code based on URI


    3) MIME types

    MIME types are optional. You probably don’t need to do anything with them.

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

Sidebar

Related Questions

I'm trying to learn some Ember.js and while I realize everything is in flux
I'm trying to play around with netcat to learn more about how HTTP works.
I am trying to learn android so i am making some apps to play
I'm trying to learn how to put table content into css floats. My approach
I am a beginner coder trying to learn how to make android apps. I
I've always used Xcode in the past so now I'm trying to learn Android
I am an Android newbie trying to learn the UI side of things and
Trying to learn a bit of CSS and I want a horizontal navbar and
Trying to learn a bit about PDO and is going through this tutorial .
Trying to learn about php's arrays today. I have a set of arrays like

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.