Methods for invoking third party applications within Android applications _android

Source: Internet
Author: User

Sometimes our applications need to invoke applications that others have already written (provided that they are already installed on the user's phone). Their application a calls their own application B, there are more methods, for example, in the activity of the invoked application B, set Intent-filter, and then use the intent call directly. After that, let's talk about how to invoke a third party application, such as Baidu Cloud disk.
Calling a Third-party application requires knowing two parameters (here you need to parse the Androidmanifest.xml file for Third-party applications, a bit of a cracked flavor):
The package name of the third party application;
The activity class name within the third party application (which can be selected according to its own needs, usually the first activity initiated).
You can then invoke the following code to start a third party application:

Copy Code code as follows:

ComponentName componentname = new ComponentName (pkg, CLS);
Intent Intent = new Intent ();
Intent.setcomponent (componentname);
StartActivity (Intent);

Note: Androidmanifest.xml file can be used: http://code.google.com/p/xml-apk-parser/
How to use:
AXMLPrinter2 can only parse binary XML files:

Copy Code code as follows:

Java-jar Axmlprinter.jar < binary XML file name >

Parse Androidmanifest.xml file:

Copy Code code as follows:

Java-jar apkparser.jar <apk file name >

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.