Windows Phone program startup and Android program startup principle Comparison

Source: Internet
Author: User
Tags comparison resource socket unix domain socket xmlns

How is Windows Phone program started, and what is the difference between him and the Android program, we focus on the native code level to analyze

When the Windows Phone program is started:

Use the application definition in XAML to specify the starting page (which is the page that is loaded automatically when the WindowsPhone7 program is started).
The specified method is to set the StartupUri property to the Uniform Resource Identifier (URI) of the Page that you want.
You can set StartupUri declaratively in markup, as shown in the following example.
<application
Xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml"
X:class= "Sdksample.app"
startupuri= "Pagewithhyperlink.xaml"/>
In this case, the StartupUri attribute is set to identify the relative pack URI of the HomePage.xaml. When the WindowsPhone7 APP starts, it automatically navigates to the HomePage.xaml and displays the file. This is the bird kind:

As for how Android started, I'm going to talk about it from native code.

First of all, we all know that Android is the Linux kernel, his start naturally inseparable from Linux Boothloader and kernel start, which I do not do too much to repeat.

The following are Android from the ServiceManager inside to start the corresponding background process, with zyngote to start the daemon process. This background process is used to keep the program in order, and the daemon daemon is listening to the state of the program. As for the daemon process in Java application is indeed a lot, such as the use of Apache release JSP program, this Apache is the daemon.

ServiceManager This is the C language definition, defined in the background of the process, as for zynote this process, which is from the App_main CP to open a initial method to its initialization method.

The preceding keyword service tells the init process to create a process called "zygote", the program to be executed by the zygote process is/system/bin/app_process, followed by the parameters to be passed to app_process.

The next socket keyword indicates that the zygote process requires a socket resource called "zygote" so that after the system starts, we can see a file named Zygote in the/dev/socket directory. The type of socket defined here is the UNIX domain socket, which is used for local interprocess communication, and is a socket-based interprocess communication. The activitymanagerservice we talked about earlier is that this socket comes with the zygote process communication Request fork an application process.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.