# Stories by Vladislav Puryev on Medium

Stories by Vladislav Puryev on Medium

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## The legend about AIDL. Part 3. The crucial ingredient

DevFeed: [The legend about AIDL. Part 3. The crucial ingredient](<https://devfeed.tech/articles/the-legend-about-aidl-part-3-the-crucial-ingredient-26014.md>)

Original publisher: [Read original article](<https://unbreakable-titan.medium.com/the-legend-about-aidl-part-3-the-crucial-ingredient-71c5e8eea553?source=rss-e32583ce94d4------2>)

Author: Vladislav Puryev

Published: 2021-01-16T14:50:56Z

Content type: tutorial

Language: en

Sources: [Stories by Vladislav Puryev on Medium](<https://devfeed.tech/sources/stories-by-vladislav-puryev-on-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [aosp](<https://devfeed.tech/tags/aosp.md>), [code](<https://devfeed.tech/tags/code.md>), [code-search](<https://devfeed.tech/tags/code-search.md>), [ide](<https://devfeed.tech/tags/ide.md>)

### AI overview

This third installment of a series examines how Android Interface Definition Language (AIDL) is used within Android system code. It traces calls involved in launching an Activity and follows the handling of Bundle and ActivityOptions objects, using shortened code examples from Android 10 sources.

### Source excerpt

Hello everybody. In the previous two parts you could read a lot of things about Android Interface Definition Language. About its origin, theoretical and practical basics, how these basics are implemented in Android system, how AIDL works and how developer can use it (as a result, quite simple) and some other things about Android and computer science. Well now, everything of this is pretty curious, but I would like to tell you about one more interesting thing. You are using AIDL much more, than you suppose. WARNING! This article contains a lot of code that will be provided in shortened form. Full versions you can find in your IDE, in AOSP or Android Code Search. Please be careful, cause most of further code can be changed any time by Google developers, that is why some material can be obsolete and partially or completely wrong in the future, but actual for the moment of publication. All code is retrieved from sources, which actual for Android 10. This series of articles consist of three parts: The legend about AIDL. Part 1. The roots The legend about AIDL. Part 2. In Action The legend about AIDL. Part 3. The crucial ingredient (you are here) The biggest one The statement above is quite brave, isn't it? Let's research the code and see that AIDL is more important, than any Android application component. The first opponent is Activity. Bigger, than Activity This is ridiculous, isn't it? How much times developers (and their users) are using Activity and how much times they need AIDL? It seems that crushing blow is directed to the hero of article. To prove this incredible fact it needs to look at the content of method, which allow to launch activity -- startActivity(). https://medium.com/media/0b4ea8396635cc920b6335a25c0aef13/href This method is calling another one startActivity(), passing null for parameter options. Depending on this value, second startActivity() calls startActivityForResult() with options or not. Let's dig deeper. https://medium.com/media/9855de0e0c3444e

## The legend about AIDL. Part 2. In Action

DevFeed: [The legend about AIDL. Part 2. In Action](<https://devfeed.tech/articles/the-legend-about-aidl-part-2-in-action-26013.md>)

Original publisher: [Read original article](<https://unbreakable-titan.medium.com/the-legend-about-aidl-part-2-in-action-f3dd552e4d17?source=rss-e32583ce94d4------2>)

Author: Vladislav Puryev

Published: 2021-01-16T14:50:18Z

Content type: tutorial

Language: en

Sources: [Stories by Vladislav Puryev on Medium](<https://devfeed.tech/sources/stories-by-vladislav-puryev-on-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Process](<https://devfeed.tech/topics/process.md>), [Remote Procedure Call (RPC)](<https://devfeed.tech/topics/rpc.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [aidl](<https://devfeed.tech/tags/aidl.md>), [android](<https://devfeed.tech/tags/android.md>), [code](<https://devfeed.tech/tags/code.md>), [ipc](<https://devfeed.tech/tags/ipc.md>), [process](<https://devfeed.tech/tags/process.md>), [rpc](<https://devfeed.tech/tags/rpc.md>)

### AI overview

This tutorial explains how developers can use Android Interface Definition Language (AIDL), including its relationship to RPC and IDL concepts. It focuses on communication between applications and other processes through Android interprocess communication, with code and technical details.

### Source excerpt

The legend of AIDL. Part 2. In Action Hello everybody. In previous article you could read about theoretical basics of Interface Definition Language and its main idea. Well, unlike the previous one, this part will contain a lot of code and technical details. Sometimes you will see internal parts of Android system, the parts that most of developers should not worry about in their works. The following material is dedicated to AIDL itself, how developer can use it, how it works and how RPC and IDL concepts are implemented in Android system. I hope you are interested and ready. Let's start! WARNING! The some code will be provided in shortened form. Full versions you can find in your IDE, in AOSP or Android Code Search. Please be careful, cause most of further code can be changed any time by Google developers, that is why some material can be obsolete and partially or completely wrong in the future, but actual for the moment of publication. This series of articles consist of three parts: The legend about AIDL. Part 1. The roots The legend about AIDL. Part 2. In Action (you are here) The legend about AIDL. Part 3. The crucial ingredient AIDL for applications developer I think, that there are just two general situations, when you really need to use Android Interface Definition Language: You have two (or more) applications and you are completely sure, that user will install one "main" application which can provide some functions for others. It means, that one of your applications must be exactly installed on user's device, cause other one (two, four and etc.) wouldn't give user some features without "basic application". It is possible to say, that your "basic application" is a server. You are developer of a new device, based on Android. May be some more usages are exist, but anyway all of them require AIDL power just for one goal -- communication between different processes (process is not always an application). Why so? Well, a lot of parts of Android system and different ap

## The legend about AIDL. Part 1. The roots

DevFeed: [The legend about AIDL. Part 1. The roots](<https://devfeed.tech/articles/the-legend-about-aidl-part-1-the-roots-26012.md>)

Original publisher: [Read original article](<https://unbreakable-titan.medium.com/the-legend-about-aidl-part-1-the-roots-c144be38d9a4?source=rss-e32583ce94d4------2>)

Author: Vladislav Puryev

Published: 2021-01-16T14:45:31Z

Content type: tutorial

Language: en

Sources: [Stories by Vladislav Puryev on Medium](<https://devfeed.tech/sources/stories-by-vladislav-puryev-on-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [distributed-systems](<https://devfeed.tech/topics/distributed-systems.md>), [Remote Procedure Call (RPC)](<https://devfeed.tech/topics/rpc.md>), [Processes](<https://devfeed.tech/topics/processes.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [aidl](<https://devfeed.tech/tags/aidl.md>), [android](<https://devfeed.tech/tags/android.md>), [computer-science](<https://devfeed.tech/tags/computer-science.md>), [distributed-systems](<https://devfeed.tech/tags/distributed-systems.md>), [processes](<https://devfeed.tech/tags/processes.md>), [programming](<https://devfeed.tech/tags/programming.md>), [remote-procedure-calls](<https://devfeed.tech/tags/remote-procedure-calls.md>), [rpc](<https://devfeed.tech/tags/rpc.md>)

### AI overview

This first article in a three-part series introduces Android Interface Definition Language (AIDL) and explains its theoretical foundation in Interface Definition Language (IDL). It discusses processes in distributed systems and introduces Remote Procedure Call (RPC) as a way for client applications to invoke server functions without knowing their implementation. The article is theoretical; code examples and Android internals are deferred to later parts.

### Source excerpt

The legend of AIDL. Part 1. The roots Hello everybody. I would like to tell you one story about very ancient and not popular character of Android system. Not popular for developers, as they suppose. This is Android Interface Definition Language. In this article I want to tell you about the origin of AIDL, about the base concept -- IDL. Let's get started. WARNING! This article contains theoretical information only. The code examples, internals and actual technical details from Android system will be provided in the next articles. This series of articles consist of three parts: The legend about AIDL. Part 1. The roots (you are here) The legend about AIDL. Part 2. In Action The legend about AIDL. Part 3. The crucial ingredient What is IDL AIDL means Android Interface Definition Language. But before get to know more about platform specific mechanism, it is useful to learn something about its theoretical basis. Let's forget about Android for a while and try to understand what Interface Definition Language is. Well, there are not too many official definitions for this concept, but I like next one (source): Interface definition language -- is a language that describes the interface between client and server process in a distributed system. I suppose it is not very clear. Let's break it down. Independent Communication What is one of the main features of distributed systems? They can interact (even must interact) with many processes. Process is a single complicated concept, which is beyond of this article. Just for now, you should know (if you are not familiar with it) next thing: process is an program (application) at runtime. All of it is quite rough, but enough. More important for distributed systems, that applications can be developed with different programming languages and technologies. And they can be located on different computers. Or they can be on one computer (device), but on distinct and independent virtual machines. Anyway user must have access to programs and res

## ViewModel. How it works.

DevFeed: [ViewModel. How it works.](<https://devfeed.tech/articles/viewmodel-how-it-works-26015.md>)

Original publisher: [Read original article](<https://unbreakable-titan.medium.com/viewmodel-how-it-works-434282649286?source=rss-e32583ce94d4------2>)

Author: Vladislav Puryev

Published: 2020-01-18T15:40:09Z

Content type: tutorial

Language: en

Sources: [Stories by Vladislav Puryev on Medium](<https://devfeed.tech/sources/stories-by-vladislav-puryev-on-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>), [Framework](<https://devfeed.tech/topics/framework.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Google](<https://devfeed.tech/topics/google.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [android](<https://devfeed.tech/tags/android.md>), [android-framework](<https://devfeed.tech/tags/android-framework.md>), [code](<https://devfeed.tech/tags/code.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [evolution](<https://devfeed.tech/tags/evolution.md>), [java](<https://devfeed.tech/tags/java.md>), [screen](<https://devfeed.tech/tags/screen.md>), [state](<https://devfeed.tech/tags/state.md>), [technical](<https://devfeed.tech/tags/technical.md>), [viewmodel](<https://devfeed.tech/tags/viewmodel.md>)

### AI overview

This technical tutorial examines how Android ViewModel works internally and how it helps preserve screen state across configuration changes. It explains that ViewModel itself is a simple abstract class and that state retention results from processes within the Android framework, with correct initialization and factories required for dependencies.

### Source excerpt

Android ViewModel. How it works. Hello everybody. This post will be about popular solution from Google for Android developers -- ViewModel (if you are not familiar with it yet -- get started from official documentation). The main goal of article -- show you how viewModel works, how this tool helps us to save state of our screens. First of all it is better to note that viewModel -- is just java code inside Android framework and there is no any magic... almost. This mechanism was improved something about three times from its origin (2017) till the present day. Let's take a look at "Evolution of anatomy". WARNING! This article contains a lot of technical content and internals of Android framework. And please pay attention -- all demonstrated code you can find in your Android Framework using middle-click or ctrl + left-click. There is no any of self-made code -- all is inside Android framework. Attention again -- most of code will be provided in shortened form. Only necessary details. Full versions you can find in Android Framework source codes straight inside your IDE. ViewModel 2017 Honestly, this part (I mean exactly ViewModel's version of 2017) can be unnecessary, because Medium has several articles, that describes viewModel saving state mechanism in first version. I like this one. But I suggest you more code than there. First of all let's take a look at ViewModel class itself. According to official documentation: The ViewModel class allows data to survive configuration changes such as screen rotations. It can lead to research this class. https://medium.com/media/3966f6a014283670bd0d0430100902cd/href It is just simple abstract class. Without any secrets. With one empty method. Can documentation be wrong (or obsolete) so long time? This question is not so obvious. From one side, if you will create your child viewModel and initialize it using constructor, in this case saving states mechanism will not work. But if you are doing everything in the right way (using special initial