This document discusses content providers in Android application development. It explains that content providers allow applications to share data by making application data available to other apps. A content provider is a class that implements methods to store and retrieve the type of data it handles. It also describes how to query, modify, and add data to content providers. Examples are provided of querying contact data from the device's contacts content provider and updating contact details by modifying the content provider data.
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAhsanul Karim
These slides are for self-learners and trainees of my BASIS and DIIT Android course.
I have used information, content and images from various sources. As these materials are for non-commercial use, I think they won’t infringe any copyright issue.
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAhsanul Karim
These slides are for self-learners and trainees of my BASIS and DIIT Android course.
I have used information, content and images from various sources. As these materials are for non-commercial use, I think they won’t infringe any copyright issue.
Murach: An introduction to web programming with ASP.NET Core MVCMahmoudOHassouna
Murach: An introduction to web programming with ASP.NET Core MVC
Mary Delamater, Joel Murach - Murach's ASP.NET Core MVC-Mike Murach & Associates, Inc. (2020) (1)
Murach: An introduction to web programming with ASP.NET Core MVCMahmoudOHassouna
Murach: An introduction to web programming with ASP.NET Core MVC
Mary Delamater, Joel Murach - Murach's ASP.NET Core MVC-Mike Murach & Associates, Inc. (2020) (1)
Store and retrieve data and make it accessible to all applications
Only way to share data across applications
There's no common storage area that all Android packages can access
Two types of content providers
Android's built-in content providers
Custom content providers we create
Store and retrieve data and make it accessible to all applications
Only way to share data across applications
There's no common storage area that all Android packages can access
Two types of content providers
Android's built-in content providers
Custom content providers we create
Store and retrieve data and make it accessible to all applications
Only way to share data across applications
There's no common storage area that all Android packages can access
Two types of content providers
Android's built-in content providers
Custom content providers we create
• Android ships with a number of content providers for common data types
audio, video, images, personal contact information, and so on
android.provider package
• We can query these providers for the data they contain
Data Transfer between Activities & DatabasesMuhammad Sajid
Data Transfer between Activities & Databases, Content Provider:
Content Provider will act as a central repository to store the data of the application in one place and make that data available for different applications to access whenever it’s required.
the Content Provider is a part of an android application and it will act as more like the relational database to store the app data. We can perform multiple operations like insert, update, delete and edit on the data stored in the content provider using insert(), update(), delete(), and query() methods.
Resources in Android are files stored under the res directory of your project. Resources can be physical files (Audio, video, images, text, etc…) or xml files that declare some values to use in your application. In this chapter we will discuss about the strings and menu resources.
Data Transfer between Activities & DatabasesMuhammad Sajid
Data Transfer between Activities & Databases, icon: This is displayed as icon for activity. You can check or save png image of name icon in drawable folder. android:icon="@drawable/icon"
• label: The label / title that appears at top in Toolbar of that particular Activity. You can check or edit label name by opening String XML file present inside Values folder
android:label = "@string/label“ or android:label = "New Activity“
Just like icon attribute, if you have not declared any label for your activity then it will be same as your parent activity
This post will walk you through Android ListView Tutorial for building simple and customized ListView using different Android adapters.
List is one of the most common UI patterns, which is being used extensively to display the collection of data elements in rows. In android ListView is a view group that displays a list of scrollable items. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array.
This presentation was provided by Ralph LeVan of OCLC, during the NISO event "Next Generation Discovery Tools: New Tools, Aging Standards," held March 27 - March 28, 2008.
Lecture 5: Storage: Saving Data Database, Files & PreferencesAhsanul Karim
This slide is made for Shikkhok.com Android course. To get the video lectures visit: http://www.shikkhok.com/%E0%A6%95%E0%A7%8B%E0%A6%B0%E0%A7%8D%E0%A6%B8-%E0%A6%A4%E0%A6%BE%E0%A6%B2%E0%A6%BF%E0%A6%95%E0%A6%BE/android-app-development/
এই সেশনে নিম্নলিখিত বিষয়গুলো সম্পর্কে খুব সংক্ষিপ্তভাবে আলোচনা করা হয়েছেঃ
১) বিভিন্ন মোবাইল এপ্লিকেশন প্লাটফর্ম (যেমনঃ আইফোন, এন্ড্রয়েড, ব্ল্যাকবেরী, উইন্ডোজ ফোন ইত্যাদি)
২) এন্ড্রয়েড প্লাটফর্ম-এ এপ্লিকেশন তৈরির সুবিধা
৩) গুগল প্লে স্টোর
৪) Application development trends ইত্যাদি।
যারা খুব দ্রুত কাজ শুরু করতে চান তারা নিশ্চিন্তে এই সেশনটি স্কিপ করতে পারেন। তবে এই সেশনের স্লাইডটির শেষে কিছু রিসোর্সের লিঙ্ক দেয়া আছে সেটি দেখতে পারেন।
Mobile Banking in Bangladesh: An Incomplete StudyAhsanul Karim
This is an incomplete study on Mobile Banking in Bangladesh. Feel free to use this for educational purpose. A more detailed version will be available soon.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Welcome to the first live UiPath Community Day Dubai! Join us for this unique occasion to meet our local and global UiPath Community and leaders. You will get a full view of the MEA region's automation landscape and the AI Powered automation technology capabilities of UiPath. Also, hosted by our local partners Marc Ellis, you will enjoy a half-day packed with industry insights and automation peers networking.
📕 Curious on our agenda? Wait no more!
10:00 Welcome note - UiPath Community in Dubai
Lovely Sinha, UiPath Community Chapter Leader, UiPath MVPx3, Hyper-automation Consultant, First Abu Dhabi Bank
10:20 A UiPath cross-region MEA overview
Ashraf El Zarka, VP and Managing Director MEA, UiPath
10:35: Customer Success Journey
Deepthi Deepak, Head of Intelligent Automation CoE, First Abu Dhabi Bank
11:15 The UiPath approach to GenAI with our three principles: improve accuracy, supercharge productivity, and automate more
Boris Krumrey, Global VP, Automation Innovation, UiPath
12:15 To discover how Marc Ellis leverages tech-driven solutions in recruitment and managed services.
Brendan Lingam, Director of Sales and Business Development, Marc Ellis
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
2. Application Building Blocks
• UI Component Typically
Corresponding to one screen.
Activity
• Responds to notifications or status
changes. Can wake up your process.
IntentReceiver
• Faceless task that runs in the
background.
Service
• Enable applications to share data.ContentProvider
3. Android Application Anatomy
Activities
1. Provides User Interface
2. Usually represents a Single Screen
3. Can contain one/more Views
4. Extends the Activity Base class
Services
1. No User Interface
2. Runs in Background
3. Extends the Service Base Class
Application= Set of Android Components
Content Provider
1. Makes application data available
to other apps
2. Data stored in SQLite database
3. Extends the ContentProvider
Base class
Intent/Broadcast Receiver
1. Receives and Reacts to broadcast
Intents
2. No UI but can start an Activity
3. Extends the BroadcastReceiver
Base Class
4. Android Content Provider
App 1
(Dialer)
App 2
(Messaging)
App 3
(Custom)
App 4
(Custom)
Content Provider 1
Data can be shared over different applications
Content Provider Basics
1. There are no common storage area that all Android application can access.
2. The only way: to share data across applications: Content Provider
3. Content providers store and retrieve data and make it accessible to all
applications.
Content Provider 2
5. Android Content Provider
Content Provider Basics (Contd.)
Android ships with a number of content providers for common data types:
1. Audio
2. Video
3. Images
4. Personal contact information etc
Content Provider provides the way to share the data between multiple applications.
For example, contact data is used by multiple applications (Dialer, Messaging etc.)
and must be stored in Content Provider to have common access.
A content provider is a class that implements a standard set of methods to let other
applications store and retrieve the type of data that is handled by that content provider.
Content Provider
data
App 1
App 2
6. Android Content Provider
Content Provider Basics (Contd.)
Here are some of Android's most useful built-in content providers, along with a description of
the type of data they're intended to store
Application can perform following operations on content provider -
1. Querying data
2. Modifying records
3. Adding records
4. Deleting records
7. Android Content Provider
Querying Data
Content Provider Data Model
Content providers expose their data as a simple table on a database model, where each row
is a record and each column is data of a particular type and meaning.
For example, information about people and their phone numbers might be exposed as follows:
Every record includes a numeric _ID field that uniquely identifies the record within the table.
IDs can be used to match records in related tables — for example, to find a person's phone
number in one table and pictures of that person in another.
A query returns a Cursor object that can move from record to record and column to column
to read the contents of each field. It has specialized methods for reading each type of data.
So, to read a field, you must know what type of data the field contains.
8. Android Content Provider
Querying Data
Content Provide: URI
1. Each content provider exposes a public URI that uniquely identifies its data set.
2. A content provider that controls multiple data sets (multiple tables) exposes a
separate URI for each one.
3. All URIs for providers begin with the string "content://".
The content: scheme identifies the data as being controlled by a content provider.
URI samples:
<standard_prefix>://<authority>/<data_path>/<id>
For example, to retrieve all the bookmarks stored by our web browsers (in Android):
content://browser/bookmarks
Similarly, to retrieve all the contacts stored by the Contacts application:
content://contacts/people
To retrieve a particular contact, you can specify the URI with a specific ID:
content://contacts/people/3
9. Android Content Provider
Querying Data
Content Provide: URI
So we need three pieces of information to query a content provider:
1. The URI that identifies the provider
2. The names of the data fields you want to receive
3. The data types for those fields
If we are querying a particular record, you also need the ID for that record.
Some more examples:
content://media/internal/images URI return the list of all internal images on the device.
content://contacts/people/ URI return the list of all contact names on the device.
content://contacts/people/45 URI return the single result row, the contact with ID=45.
10. Android Content Provider
Querying Data
Content Provide: URI
•Although this is the general form of the query, query URIs are arbitrary and confusing.
•For this android provide list of helper classes in android.provider package that define these
query Strings.
So we do not need to know the actual URI value for different data types.
So it will be easy to query data.
content://media/internal/images/ MediaStore.Images.Media.INTERNAL_CONTENT_URI
content://contacts/people/ Contacts.People.CONTENT_URI
content://contacts/people/45
Uri person = ContentUris.withAppendedId(People.CONTENT_URI, 23);
To query about specific record we have to use same CONTENT_URI and
must append specific ID.
Content Provider: Query
Here is how we can query for data:
Cursor cur = managedQuery(uri, null, null, null);
11. Android Content Provider
Querying Data
Content Provider: Query
Here is how we can query for data:
Cursor cur = managedQuery(uri, null, null, null, null);
Parameters:
1. URI
2. The names of the data columns that should be returned. A null value returns all
columns.
3. A filter detailing which rows to return, formatted as an SQL WHERE clause
(excluding the WHERE itself). A null value returns all rows.
4. Selection arguments
5. A sorting order for the rows that are returned, formatted as an SQL ORDER
BY clause (excluding the ORDER BY itself). A null value returns the records in the
default order for the table, which may be unordered.
12. Android Content Provider
Querying Data
Content Provider: Query Example
Create a new project:
Project Name: ContentProviderDemo1
Build Target: Android 1.6
Application Name:
ContentProviderDemo1
Package Name:
com.basistraining.cpdemo
Create Activity:
ContentProviderDemoActivity
Min SDK Version: 4
Add READ_CONTACTS permission
Now we make the Activity a
ListActivity to show a list of contacts
13. Android Content Provider
Querying Data
Content Provider: Query Example
Now we make the Activity a ListActivity to show a list of contacts:
Now, we’ll add a method to retrieve data from Contacts Content Provider.
The method will return an array of String which will be set as adapter for ListActivity
14. Android Content Provider
Querying Data Content Provider: Query Example
Now, we’ll add a method to retrieve data from Contacts Content Provider.
The method will return an array of String which will be set as adapter for ListActivity
16. Android Content Provider
Querying Data Content Provider: Query Example
Now, We run the app and in emulator we see a black screen as the emulator has no contact
data:
Lets add some contacts using Contacts app
17. Android Content Provider
Querying Data Content Provider: Query Example
If we run the app again:
What we are doing here???
We are accessing the content provider
Contacts from our application.
Contacts application inserts data into Contact
Content Provider.
App 1
(Contacts)
App 2
(our app)
Contacts Content Provider
18. Android Content Provider
Modifying Data Content Provider: Update Example
Let’s add another Activity which will load with selected data and provide us interface to edit:
1. We create Update Activity
2. We modify the main.xml for updating
19. Android Content Provider
Modifying Data Content Provider: Update Example
Let’s get back to ListActivity:
1. To identify which data to be updated we’ll need to pass _ID of the selected Person. So we
Modify the columns
2. We need to save the values in global arrays to pass them as parameter to update screen.
So:
20. Android Content Provider
Modifying Data Content Provider: Update Example
We need to save the values in global arrays to pass them as parameter to update screen.
So:
21. Android Content Provider
Modifying Data Content Provider: Update Example
Now we detect selected person and pass the values to Update screen:
And in the UpdateActivity, we get the values and set them in UI:
22. Android Content Provider
Modifying Data Content Provider: Update Example
Now lets add button functionality of Update
Need the method updateName()
24. Android Content Provider
Modifying Data Content Provider: Update Example
Now lets run the app and we end up with:
We need to add WRITE_CONTACTS permission
25. Android Content Provider
Modifying Data Content Provider: Update Example
Now follow the steps for testing:
1. Run the app
2. Select a Contact
3. Edit Contact name
4. Go back to main screen
5. Exit app
6. Check whether data is updated from the Contacts app
26. Android Content Provider
Practice Exercise
1. Create an Application named “Bookmark Manager”
2. In AVD, browse several sites in browser and bookmark them
3. Read all bookmarks from browser Content Provider and show them in list
4. On selecting an URL go to a new activity and open that link in a webview
Hints
URI: android.provider.Browser.BOOKMARKS_URI
Fields:
1. Browser.BookmarkColumns._ID,
2. Browser.BookmarkColumns.TITLE,
3. Browser.BookmarkColumns.URL