Langsung ke konten utama

Postingan

Menampilkan postingan dengan label basics

What is Content Provider

Today I will continue my "What is *Android component*" series and tell you about one of the essentials parts of an Android application a content provider. Previous posts from this series: What is Activity What is Fragment The problem First of all, let's consider the problem that this component is meant to solve. It's often useful for applications to retrieve data from other apps on the smartphone. Many pre-installed Android apps have the data that can improve the user experience of other apps.  For example, phone book has information about the people that are probably your friends and it can be used by social networking app like LinkedIn to connect with someone you know in this social network. User dictionary has information that can help users type faster by providing them with the most used words when they use a custom keyboard. So, it would be convenient to have some tool that can share those kinds of data. Something that would provide a consistent interface acros...

What is Fragment

The concept of a fragment is tied very tight with the concept of an activity. And if you don't understand clearly what activity is I encourage you to read last week's post first and then return to fragments. Also, here's the post that will help you to get a nice overview of basic Android classes such as Context, Activity, Fragment, Thread etc. What is the problem With the growth of popularity of Android system more and more developers started to pay attention to it. More and more apps were developed for Android and it entailed more and more complexity in these apps. In particular, this complexity was growing in activities and layouts. Possible solutions First of all, developers wanted something that would be reusable in several activities. And this, as I think, gave a birth to ActivityGroup .  As the documentation says it's A screen that contains and runs multiple embedded activities which seems like a bit overhead. In this implementation, every activity has i...