Android am command and hotkey file compilation,

Source: Internet
Author: User

Android am command and hotkey file compilation,

1. CALL am start-a android. intent. action. CALL-d tel: 10086

Here,-a indicates the action,-d indicates the input data, and-t indicates the input type.

2. Open a webpage: am start-a android. intent. action. VIEW-d http://www.baidu.com (here-d indicates the incoming data)

3. start an activity: am start-n com. hysmarthotel. movie/com. hysmarthotel. movie. MainActivity

4: Start a service: am startservice-n com. android. music/com. android. music. MediaPlaybackService (here-n indicates the component)

5: Send a broadcast: am broadcast-a com. smz. mybroadcast am broadcast-a <broadcast action>

In addition, the am command can be written into the android system and saved to system/etc/hotkey. xml,

The hotkey. xml format is as follows:

<? Xml version = "1.0" encoding = "UTF-8"?>
<Hotkey>
<Event
Code = "00b7"
Cmd = "am start-n com. amlogic. tvplay/com. amlogic. tvplay. MainActivity"/>
<Event
Code = "00b8"
Cmd = "am start-n com. hysmarthotel. movie/com. hysmarthotel. movie. MainActivity"/>
<Event
Code = "003f"
Cmd = "am start-n sdmc. hotel. remote/sdmc. hotel. remote. KeXinListView"/>
</Hotkey>

Event indicates the key-value pair, and code indicates the code value of your remote control (hexadecimal). cmd indicates the broadcast or activity to be sent.

When you configure the hotkey, press the relevant key on the android Application layer, and the system will execute the related commands in the hotkey.

 

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.