Can someone explain to me the main function of Intents in Android OS?

I am new to programming applications for Android OS. Regarding the general architecture of the OS, I understand that processes are implemented as Linux processes and each of them is isolated.

However, I am completely confused about IPC and syscalls (if any). I know that IBinder is a form of this; packages are sent back and forth between processes, and Bundles are massive forms of packages (?). But even this is not familiar to me. The same with intentions. In general, I do not understand which IPCs are implemented and how.

Can someone briefly explain to me the specific methods used by user-level applications in the Android OS to interact with each other and with the OS? I was involved in kernel programming and played with various IPCs on Linux (Ubuntu and Debian), so it would help a lot if all this was explained in connection with what I know ...

Thanks in advance!

+3
source share
2 answers

Android - - , , , , , . Intents, , Binder, Android , , . - "" , , parcelable ( ). , Intents , Intent Filter.

, -, , :

public class OpenInternet extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ((Button) findViewById(R.id.OpenInternetButton))
                .setOnClickListener(new View.OnClickListener() {

                    @Override
                    public void onClick(View v) {
                        Intent i = new Intent(Intent.ACTION_VIEW, Uri
                                .parse("http://www.google.com"));
                        startActivity(i);
                    }
                });
    }
}

, , -, , , :

        <!-- For these schemes were not particular MIME type has been
             supplied, we are a good candidate. -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="http" />
            <data android:scheme="https" />
            <data android:scheme="about" />
            <data android:scheme="javascript" />
        </intent-filter>
        <!--  For these schemes where any of these particular MIME types
              have been supplied, we are a good candidate. -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="http" />
            <data android:scheme="https" />
            <data android:scheme="inline" />
            <data android:mimeType="text/html"/>
            <data android:mimeType="text/plain"/>
            <data android:mimeType="application/xhtml+xml"/>
            <data android:mimeType="application/vnd.wap.xhtml+xml"/>
        </intent-filter>

Intents, -, AIDL, .

, , libc , . "" IPC, , System V, .

+4

, , - . , URL-, RSS-, , . , (Activity), , , . , , , , URL- , Android , -. URL-, -. , ComponentName, , Android (, "-", ( , Activity), .

, , :

  • MyActivity1 RSS-.
  • MyActivity1 , ComponentName com.superawesome.MyWebBrowserActivity Data http://www.stackoverflow.com
  • MyWebBrowserActivity , URL

, , , :

Android Dev Guide: Intents Intent Filters

+1

Source: https://habr.com/ru/post/1747462/


All Articles