SlideShare a Scribd company logo
1 of 14
Using of contact information & data
model presentation in Android
Alexey Potapov
• Introduction to Contacts Provider
  Structure
• Contacts Provider Access and Data
  Consistency
• Determination changes
Contacts Provider Structure




• ContactsContract.Contacts
• ContactsContract.RawContacts
• ContactsContract.Data
ContactsContract.RawContacts

• Sources of raw contacts data
  o Google
  o Facebook
  o etc.
• Important raw contact columns
  o ACCOUNT_NAME
  o ACCOUNT_TYPE
ContactsContract.Data

• Important raw contact columns
• Generic column names
  o Data1 , … , Data16
• Type-specific column names
  o CommonDataKinds.Photo
  o CommonDataKinds.Email
  o etc.
ContactsContract.Contacts
• Neither applications nor
  sync adapters are allowed
  to add contacts
• Contact is representation
  of RawContacts
  aggregation
Contacts Provider Metadata

•   ContactsContract.RawContacts.DIRTY
•   ContactsContract.RawContacts.VERSION
•   ContactsContract.Data.DATA_VERSION
•   ContactsContract.RawContacts.SOURCE_ID
•   ContactsContract.RawContacts.DELETED
Contacts Provider Access and Data
           Consistency
• Contacts Aggregation
• Query contacts and data
• Batch modification
Contacts Aggregation
                               ID=1

              Join      ID=3

ID=1   ID=1
                               ID=2



ID=2   ID=2

                ID=3    ID=1

                                      Separate

                ID=4    ID=2
Query contacts and data

• Lookup Key vs. Contact ID
  Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI,
  String.valueOf(mId));
  ContactsContract.Contacts.getLookupUri(mId, mLookupKey);


• Query entities        API 11

  Uri.withAppendedPath(mContactUri,
  ContactsContract.Contacts.Entity.CONTENT_DIRECTORY);
Batch modification

• Yield points
  o to prevent blocking the system
• Modification back references
  o to use result of a previous operation
• Optimistic concurrency control
  o modification of database without having to lock
     the underlying repository
Determination changes
• ContentObserver
  o onChange(boolean selfChange)
  o onChange(boolean selfChange, Uri uri)   API 16

• Check db modifications by query
  o What we have?
  o What we want?
SELECT * FROM raw_contacts
    WHERE
        id||‘.’||contact_id||’.’
            ||version
    NOT IN (?)

SELECT * FROM data
    WHERE
        id||‘.’||data_version
    NOT IN (?)

? starred, etc.
Questions ?



      © Alexey Potapov

More Related Content

Similar to Android Contacts Provider data model and access

Using of contact information in android
Using of contact information  in androidUsing of contact information  in android
Using of contact information in androidAlexey Potapov
 
Solving the Disconnected Data Problem in Healthcare Using MongoDB
Solving the Disconnected Data Problem in Healthcare Using MongoDBSolving the Disconnected Data Problem in Healthcare Using MongoDB
Solving the Disconnected Data Problem in Healthcare Using MongoDBMongoDB
 
Database management systems 3 - Data Modelling
Database management systems 3 - Data ModellingDatabase management systems 3 - Data Modelling
Database management systems 3 - Data ModellingNickkisha Farrell
 
BusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptxBusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptxjwell817
 
University Single Constituent View Repository ( SCoRe)
University Single Constituent View Repository ( SCoRe)University Single Constituent View Repository ( SCoRe)
University Single Constituent View Repository ( SCoRe)Hemant Verma
 
Data_Modeling_MongoDB.pdf
Data_Modeling_MongoDB.pdfData_Modeling_MongoDB.pdf
Data_Modeling_MongoDB.pdfjill734733
 
Data Management Best Practices
Data Management Best PracticesData Management Best Practices
Data Management Best PracticesChristopher Eaker
 
Recommendations at Zillow
Recommendations at ZillowRecommendations at Zillow
Recommendations at Zillownjstevens
 
ORCID identifiers and other PIDs in research workflows (M. Buys)
ORCID identifiers and other PIDs in research workflows (M. Buys)ORCID identifiers and other PIDs in research workflows (M. Buys)
ORCID identifiers and other PIDs in research workflows (M. Buys)ORCID, Inc
 
User Data Management with MongoDB
User Data Management with MongoDB User Data Management with MongoDB
User Data Management with MongoDB MongoDB
 
Clients in control: building demand-driven systems with Om Next
Clients in control: building demand-driven systems with Om NextClients in control: building demand-driven systems with Om Next
Clients in control: building demand-driven systems with Om NextAntónio Monteiro
 
DataONE Education Module 07: Metadata
DataONE Education Module 07: MetadataDataONE Education Module 07: Metadata
DataONE Education Module 07: MetadataDataONE
 
PIDs and DOI registration with DataCite - IATUL Workshop 2013
PIDs and DOI registration with DataCite - IATUL Workshop 2013PIDs and DOI registration with DataCite - IATUL Workshop 2013
PIDs and DOI registration with DataCite - IATUL Workshop 2013Frauke Ziedorn
 
Portfolio Oversight With eazyBI
Portfolio Oversight With eazyBIPortfolio Oversight With eazyBI
Portfolio Oversight With eazyBIeazyBI
 

Similar to Android Contacts Provider data model and access (20)

Using of contact information in android
Using of contact information  in androidUsing of contact information  in android
Using of contact information in android
 
Repairing Hidden Links in Linked Data
Repairing Hidden Links in Linked DataRepairing Hidden Links in Linked Data
Repairing Hidden Links in Linked Data
 
Solving the Disconnected Data Problem in Healthcare Using MongoDB
Solving the Disconnected Data Problem in Healthcare Using MongoDBSolving the Disconnected Data Problem in Healthcare Using MongoDB
Solving the Disconnected Data Problem in Healthcare Using MongoDB
 
Database management systems 3 - Data Modelling
Database management systems 3 - Data ModellingDatabase management systems 3 - Data Modelling
Database management systems 3 - Data Modelling
 
BusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptxBusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptx
 
Lecture7.pptx
Lecture7.pptxLecture7.pptx
Lecture7.pptx
 
University Single Constituent View Repository ( SCoRe)
University Single Constituent View Repository ( SCoRe)University Single Constituent View Repository ( SCoRe)
University Single Constituent View Repository ( SCoRe)
 
Data_Modeling_MongoDB.pdf
Data_Modeling_MongoDB.pdfData_Modeling_MongoDB.pdf
Data_Modeling_MongoDB.pdf
 
Data Management Best Practices
Data Management Best PracticesData Management Best Practices
Data Management Best Practices
 
Recommendations at Zillow
Recommendations at ZillowRecommendations at Zillow
Recommendations at Zillow
 
ORCID identifiers and other PIDs in research workflows (M. Buys)
ORCID identifiers and other PIDs in research workflows (M. Buys)ORCID identifiers and other PIDs in research workflows (M. Buys)
ORCID identifiers and other PIDs in research workflows (M. Buys)
 
User Data Management with MongoDB
User Data Management with MongoDB User Data Management with MongoDB
User Data Management with MongoDB
 
Clients in control: building demand-driven systems with Om Next
Clients in control: building demand-driven systems with Om NextClients in control: building demand-driven systems with Om Next
Clients in control: building demand-driven systems with Om Next
 
Intro to Data Management
Intro to Data ManagementIntro to Data Management
Intro to Data Management
 
Automated Methods for Identity Resolution across Online Social Networks
Automated Methods for Identity Resolution across Online Social NetworksAutomated Methods for Identity Resolution across Online Social Networks
Automated Methods for Identity Resolution across Online Social Networks
 
Data, data, everywhere? Not nearly enough!
Data, data, everywhere? Not nearly enough!Data, data, everywhere? Not nearly enough!
Data, data, everywhere? Not nearly enough!
 
array.pptx
array.pptxarray.pptx
array.pptx
 
DataONE Education Module 07: Metadata
DataONE Education Module 07: MetadataDataONE Education Module 07: Metadata
DataONE Education Module 07: Metadata
 
PIDs and DOI registration with DataCite - IATUL Workshop 2013
PIDs and DOI registration with DataCite - IATUL Workshop 2013PIDs and DOI registration with DataCite - IATUL Workshop 2013
PIDs and DOI registration with DataCite - IATUL Workshop 2013
 
Portfolio Oversight With eazyBI
Portfolio Oversight With eazyBIPortfolio Oversight With eazyBI
Portfolio Oversight With eazyBI
 

More from Meetup.by

Презентация Hack for Future
Презентация Hack for FutureПрезентация Hack for Future
Презентация Hack for FutureMeetup.by
 
Инициатива на Hackforfuture 4: "Тактильная экскурсионная карта Площади Незави...
Инициатива на Hackforfuture 4: "Тактильная экскурсионная карта Площади Незави...Инициатива на Hackforfuture 4: "Тактильная экскурсионная карта Площади Незави...
Инициатива на Hackforfuture 4: "Тактильная экскурсионная карта Площади Незави...Meetup.by
 
Инициатива на Hackforfuture 4: "Платформа открытых данных"
Инициатива на Hackforfuture 4: "Платформа открытых данных"Инициатива на Hackforfuture 4: "Платформа открытых данных"
Инициатива на Hackforfuture 4: "Платформа открытых данных"Meetup.by
 
Bezopasnyj gorod
Bezopasnyj gorodBezopasnyj gorod
Bezopasnyj gorodMeetup.by
 
CityBot - Александр Хадяков
CityBot - Александр ХадяковCityBot - Александр Хадяков
CityBot - Александр ХадяковMeetup.by
 
Карта безбарьерных объектов - Gleb
Карта безбарьерных объектов - GlebКарта безбарьерных объектов - Gleb
Карта безбарьерных объектов - GlebMeetup.by
 
Mendel prusa - Павел Кумейша
Mendel prusa - Павел КумейшаMendel prusa - Павел Кумейша
Mendel prusa - Павел КумейшаMeetup.by
 
Безопасный город: геоинформационная служба для минчан и гостей столицы - Алек...
Безопасный город: геоинформационная служба для минчан и гостей столицы - Алек...Безопасный город: геоинформационная служба для минчан и гостей столицы - Алек...
Безопасный город: геоинформационная служба для минчан и гостей столицы - Алек...Meetup.by
 
Meetup: pre-hackathon: экскурсии для слабовидящих - Людмила Скрадаль, Юлия Ва...
Meetup: pre-hackathon: экскурсии для слабовидящих - Людмила Скрадаль, Юлия Ва...Meetup: pre-hackathon: экскурсии для слабовидящих - Людмила Скрадаль, Юлия Ва...
Meetup: pre-hackathon: экскурсии для слабовидящих - Людмила Скрадаль, Юлия Ва...Meetup.by
 
ГЕНЫ: что это такое? - Павел Морозик
ГЕНЫ: что это такое? - Павел Морозик ГЕНЫ: что это такое? - Павел Морозик
ГЕНЫ: что это такое? - Павел Морозик Meetup.by
 
Получение и использование генетически модифицированных организмов - С.Е.Дромашко
Получение и использование генетически модифицированных организмов - С.Е.ДромашкоПолучение и использование генетически модифицированных организмов - С.Е.Дромашко
Получение и использование генетически модифицированных организмов - С.Е.ДромашкоMeetup.by
 
Perm Visual Communications - Катя Романчик
Perm Visual Communications - Катя Романчик Perm Visual Communications - Катя Романчик
Perm Visual Communications - Катя Романчик Meetup.by
 
The Tourist Signage System in lviv - Катя Романчик
The Tourist Signage System in lviv - Катя Романчик The Tourist Signage System in lviv - Катя Романчик
The Tourist Signage System in lviv - Катя Романчик Meetup.by
 
Городское развитие - Катя Романчик
Городское развитие - Катя Романчик Городское развитие - Катя Романчик
Городское развитие - Катя Романчик Meetup.by
 
Перспективы развитя туризма в Минске - Анна Гомза
Перспективы развитя туризма в Минске - Анна Гомза Перспективы развитя туризма в Минске - Анна Гомза
Перспективы развитя туризма в Минске - Анна Гомза Meetup.by
 
МИНСКИЙ ШРИФТ - Алексей Коваль
МИНСКИЙ ШРИФТ - Алексей КовальМИНСКИЙ ШРИФТ - Алексей Коваль
МИНСКИЙ ШРИФТ - Алексей КовальMeetup.by
 
Фес, Мумбаи - Наталья Немкова
Фес, Мумбаи - Наталья Немкова Фес, Мумбаи - Наталья Немкова
Фес, Мумбаи - Наталья Немкова Meetup.by
 
Системы ориентирующей информации - Яся Каралевич-Картэль
Системы ориентирующей информации - Яся Каралевич-Картэль Системы ориентирующей информации - Яся Каралевич-Картэль
Системы ориентирующей информации - Яся Каралевич-Картэль Meetup.by
 
Android на глиняных ногах - Дмитрий Волотко
Android на глиняных ногах - Дмитрий Волотко Android на глиняных ногах - Дмитрий Волотко
Android на глиняных ногах - Дмитрий Волотко Meetup.by
 
Планы Prestigio по выпуску мультипадов на Android до конца 2012 года - Алина ...
Планы Prestigio по выпуску мультипадов на Android до конца 2012 года - Алина ...Планы Prestigio по выпуску мультипадов на Android до конца 2012 года - Алина ...
Планы Prestigio по выпуску мультипадов на Android до конца 2012 года - Алина ...Meetup.by
 

More from Meetup.by (20)

Презентация Hack for Future
Презентация Hack for FutureПрезентация Hack for Future
Презентация Hack for Future
 
Инициатива на Hackforfuture 4: "Тактильная экскурсионная карта Площади Незави...
Инициатива на Hackforfuture 4: "Тактильная экскурсионная карта Площади Незави...Инициатива на Hackforfuture 4: "Тактильная экскурсионная карта Площади Незави...
Инициатива на Hackforfuture 4: "Тактильная экскурсионная карта Площади Незави...
 
Инициатива на Hackforfuture 4: "Платформа открытых данных"
Инициатива на Hackforfuture 4: "Платформа открытых данных"Инициатива на Hackforfuture 4: "Платформа открытых данных"
Инициатива на Hackforfuture 4: "Платформа открытых данных"
 
Bezopasnyj gorod
Bezopasnyj gorodBezopasnyj gorod
Bezopasnyj gorod
 
CityBot - Александр Хадяков
CityBot - Александр ХадяковCityBot - Александр Хадяков
CityBot - Александр Хадяков
 
Карта безбарьерных объектов - Gleb
Карта безбарьерных объектов - GlebКарта безбарьерных объектов - Gleb
Карта безбарьерных объектов - Gleb
 
Mendel prusa - Павел Кумейша
Mendel prusa - Павел КумейшаMendel prusa - Павел Кумейша
Mendel prusa - Павел Кумейша
 
Безопасный город: геоинформационная служба для минчан и гостей столицы - Алек...
Безопасный город: геоинформационная служба для минчан и гостей столицы - Алек...Безопасный город: геоинформационная служба для минчан и гостей столицы - Алек...
Безопасный город: геоинформационная служба для минчан и гостей столицы - Алек...
 
Meetup: pre-hackathon: экскурсии для слабовидящих - Людмила Скрадаль, Юлия Ва...
Meetup: pre-hackathon: экскурсии для слабовидящих - Людмила Скрадаль, Юлия Ва...Meetup: pre-hackathon: экскурсии для слабовидящих - Людмила Скрадаль, Юлия Ва...
Meetup: pre-hackathon: экскурсии для слабовидящих - Людмила Скрадаль, Юлия Ва...
 
ГЕНЫ: что это такое? - Павел Морозик
ГЕНЫ: что это такое? - Павел Морозик ГЕНЫ: что это такое? - Павел Морозик
ГЕНЫ: что это такое? - Павел Морозик
 
Получение и использование генетически модифицированных организмов - С.Е.Дромашко
Получение и использование генетически модифицированных организмов - С.Е.ДромашкоПолучение и использование генетически модифицированных организмов - С.Е.Дромашко
Получение и использование генетически модифицированных организмов - С.Е.Дромашко
 
Perm Visual Communications - Катя Романчик
Perm Visual Communications - Катя Романчик Perm Visual Communications - Катя Романчик
Perm Visual Communications - Катя Романчик
 
The Tourist Signage System in lviv - Катя Романчик
The Tourist Signage System in lviv - Катя Романчик The Tourist Signage System in lviv - Катя Романчик
The Tourist Signage System in lviv - Катя Романчик
 
Городское развитие - Катя Романчик
Городское развитие - Катя Романчик Городское развитие - Катя Романчик
Городское развитие - Катя Романчик
 
Перспективы развитя туризма в Минске - Анна Гомза
Перспективы развитя туризма в Минске - Анна Гомза Перспективы развитя туризма в Минске - Анна Гомза
Перспективы развитя туризма в Минске - Анна Гомза
 
МИНСКИЙ ШРИФТ - Алексей Коваль
МИНСКИЙ ШРИФТ - Алексей КовальМИНСКИЙ ШРИФТ - Алексей Коваль
МИНСКИЙ ШРИФТ - Алексей Коваль
 
Фес, Мумбаи - Наталья Немкова
Фес, Мумбаи - Наталья Немкова Фес, Мумбаи - Наталья Немкова
Фес, Мумбаи - Наталья Немкова
 
Системы ориентирующей информации - Яся Каралевич-Картэль
Системы ориентирующей информации - Яся Каралевич-Картэль Системы ориентирующей информации - Яся Каралевич-Картэль
Системы ориентирующей информации - Яся Каралевич-Картэль
 
Android на глиняных ногах - Дмитрий Волотко
Android на глиняных ногах - Дмитрий Волотко Android на глиняных ногах - Дмитрий Волотко
Android на глиняных ногах - Дмитрий Волотко
 
Планы Prestigio по выпуску мультипадов на Android до конца 2012 года - Алина ...
Планы Prestigio по выпуску мультипадов на Android до конца 2012 года - Алина ...Планы Prestigio по выпуску мультипадов на Android до конца 2012 года - Алина ...
Планы Prestigio по выпуску мультипадов на Android до конца 2012 года - Алина ...
 

Recently uploaded

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 

Android Contacts Provider data model and access

  • 1. Using of contact information & data model presentation in Android Alexey Potapov
  • 2. • Introduction to Contacts Provider Structure • Contacts Provider Access and Data Consistency • Determination changes
  • 3. Contacts Provider Structure • ContactsContract.Contacts • ContactsContract.RawContacts • ContactsContract.Data
  • 4. ContactsContract.RawContacts • Sources of raw contacts data o Google o Facebook o etc. • Important raw contact columns o ACCOUNT_NAME o ACCOUNT_TYPE
  • 5. ContactsContract.Data • Important raw contact columns • Generic column names o Data1 , … , Data16 • Type-specific column names o CommonDataKinds.Photo o CommonDataKinds.Email o etc.
  • 6. ContactsContract.Contacts • Neither applications nor sync adapters are allowed to add contacts • Contact is representation of RawContacts aggregation
  • 7. Contacts Provider Metadata • ContactsContract.RawContacts.DIRTY • ContactsContract.RawContacts.VERSION • ContactsContract.Data.DATA_VERSION • ContactsContract.RawContacts.SOURCE_ID • ContactsContract.RawContacts.DELETED
  • 8. Contacts Provider Access and Data Consistency • Contacts Aggregation • Query contacts and data • Batch modification
  • 9. Contacts Aggregation ID=1 Join ID=3 ID=1 ID=1 ID=2 ID=2 ID=2 ID=3 ID=1 Separate ID=4 ID=2
  • 10. Query contacts and data • Lookup Key vs. Contact ID Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(mId)); ContactsContract.Contacts.getLookupUri(mId, mLookupKey); • Query entities API 11 Uri.withAppendedPath(mContactUri, ContactsContract.Contacts.Entity.CONTENT_DIRECTORY);
  • 11. Batch modification • Yield points o to prevent blocking the system • Modification back references o to use result of a previous operation • Optimistic concurrency control o modification of database without having to lock the underlying repository
  • 12. Determination changes • ContentObserver o onChange(boolean selfChange) o onChange(boolean selfChange, Uri uri) API 16 • Check db modifications by query o What we have? o What we want?
  • 13. SELECT * FROM raw_contacts WHERE id||‘.’||contact_id||’.’ ||version NOT IN (?) SELECT * FROM data WHERE id||‘.’||data_version NOT IN (?) ? starred, etc.
  • 14. Questions ? © Alexey Potapov