Skip to content
LinkIT 360
Innovation Telecommunication VAS and Advertising Company
LinkIT 360LinkIT 360
  • Home
  • About Us
  • Expertise
    • Digital Services
    • Platforms
    • Services
  • Blog
  • Contact Us
  • Follow
  • Home
  • About Us
  • Expertise
    • Digital Services
    • Platforms
    • Services
  • Blog
  • Contact Us
  • Follow

Basics Content Provider in Android

You are here:
  1. Home
  2. Articles
  3. Basics Content Provider in Android
May242021
ArticlesContent Provider

Content Provider in Android — In our series of Android articles, Previously we discussed about Activity, Services, and Fragment. Here we are going to discuss about content providers and to cover the basic concepts you need to make use of existing ones or to write content providers on your own.

Content Provider

 

It gets better,

What are Content Providers?

A Content Provider component supplies data from one application to others on request. Such requests are handled by the methods of the ContentResolver class. A content provider can use different ways to store its data and the data can be stored in files, in a database or even over a network.

Content Providers support the four basic operations, normally called CRUD-operations. CRUD is the acronym for create, read, update and delete. With content providers those objects simply represent data as most often a record of a database — but they could also be a photo on your SD-card or a video on the web.

Content URIs

The most important concept to understand when dealing with content providers is the content URI. Whenever you want to access data from a content provider you have to specify a URI. URIs for content providers look like this:

content://authority/optionalPath/optionalId

Here, detailed explanation about Content URIs

  • The scheme for content providers is always “content”. The colon and double-slash “://” are a fixed part
  • This specifies the name of the content provider, for example browser , contacts etc. Authorities have to be unique for every content provider. Android documentation recommends to use the fully qualified class name of your ContentProvider-subclass.
  • The optional path, is used to distinguish the kinds of data your content provider offers.For example, distinguishes between audio files, video files and images using different paths for each of these types of media. This way a content provider can support different types of data that are nevertheless related. For totally unrelated data though you should use different content providers — and thus different authorities.
  • The last element is the optional id, which — if present — must be numeric. The id is used whenever you want to access a single record (e.g. a specific video file).

There are two types of URIs:

  • directory-based URIs
  • id-based URIs.

If no id is specified a URI is automatically a directory-based URI.

If You use directory-based URIs to access multiple elements of the same type (e.g. all songs of a band). All CRUD-operations are possible with directory-based URIs.

You use id-based URIs if you want to access a specific element. You cannot create objects using an id-based URI — but reading, updating and deleting is possible.

Check these out : Complete Professional Android Training Topics

Content Types

A content type consist of a two types such as media type and a subtype divided by a slash. A typical example is “image/png”. The media type “image” describes the content as an image file which is further specified to be of the Portable Network Graphic variety by the subtype “png”.

And guess what?

vnd.android.cursor.item — Used for single records

vnd.android.cursor.dir — Used for multiple records

The subtype on the other hand is used for content provider specific details and should differ for all types your content provider supports. The naming convention for subtypes is vnd.companyname.contenttype. Most content providers support multiple subtypes.

Which standard Content Providers are available?

A number of content providers are part of Android’s API. All these standard providers are defined in the package android.provider. The below lists the standard providers and what they are used for

  • CalendarContract SDK 14 — Manages the calendars on the user’s device.
  • Browser SDK 1 — Manages your web-searches, bookmarks and browsing-history.
  • CallLog SDK 1 — Keeps track of your call history.
  • MediaStore SDK 1 — The content provider responsible for all your media files like music, video and pictures.
  • Settings SDK 1 — Manages all global settings of your device.
  • UserDictionary SDK 3 — Keeps track of words you add to the default dictionary.

Conclusion:

In this part of this mini series you have learned all about the two types of URIs for content providers as well as about the two media types of content types.

https://medium.com/@saranyaan2710/content-provider-in-android-basics-d219cf42574d

Categories: Articles, Content ProviderBy Vaya SEOMay 24, 2021Leave a comment
Tags: Content Provider

Author: Vaya SEO

https://vaya.co.id

Post navigation

PreviousPrevious post:Mobile Satellite Service Provided by Systems OperatingNextNext post:The Best Service Provider in Indonesia

Related Posts

Reinventing Customer Experience with AI-Enabled Telco VAS
November 11, 2025
The Rise of Direct Carrier Billing in Emerging Markets
August 11, 2025
Explosive Use of MVAS Amidst the Development of 5th Generation Technology
May 10, 2023
The Increasing of Smartphone Users Projected to Fuel the Market’s Expansion for MVAS
April 14, 2023
Market Study for Mobile Value-Added Services in 2030
April 5, 2023
Where 5G Technology Has Been Deployed
May 27, 2022

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Post comment

Recent Posts
  • Instant Bank Transfer Casino Canada Bonus Guide – Wagering, Offers & Fast Play
  • Casino Revolut Deposits Guide for Canadian Players – Steps, Bonuses & Withdrawal Tips
  • Zahraniční kasina: Jak proběhne ověření účtu
  • Zahraniční online casino: bezpečnostní průvodce pro české hráče
  • USDT Casino security guide for Canadian players
Recent Comments
  • carrick sukses buat mu ditakuti lagi on What Is OTT? The Modern Media Streaming Landscape
  • Comcode Tech on Why Telecommunication is So Important?
  • Farlin on Standard Vs Premium SMS: A Guide to SMS Fees
  • Pontusuamang on Smartphones Wipe Out 40 Years of Camera Industry Growth
  • Koov Yang on Talking to Strangers
LinkIT 360 HQ
Menara Jamsostek Utara 9th Floor.
Jl. Gatot Subroto Kav. 38, Jakarta Selatan
Indonesia

Find us on:

Facebook page opens in new windowLinkedin page opens in new window
Company
  • About Us
  • Legal
Expertise
  • Digital Services
  • Platforms
  • Services
Keep in Touch
  • Our Blog
  • Contact Us

  • Scatter Hitam
  • Slot Gacor Resmi
© 2010 - 2023 PT LinkIT 360. All Rights Reserved
Go to Top
Cleantalk Pixel
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of all the cookies.
Cookie settingsACCEPT
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.

CookieDurationDescription
cookielawinfo-checbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.

Functional

Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.

Performance

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.

Advertisement

Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.

Others

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

SAVE & ACCEPT