Sometimes our application needs to call an application that has been written by others (provided that the user has installed it on his mobile phone). There are many methods for calling your own application B. For example, in the activity of the called application B, set the Intent-filter and then use the Intent to call it directly. Let’s talk about these later. This talk first talks about how to call third-party applications, such as Baidu Cloud Drive.
To call a third-party application, you need to know two parameters (here you need to parse the files of the third-party application first, which is a bit like cracking):
The package name of the third-party application;
The Activity class name in a third-party application (you can choose according to your needs, and generally choose the Activity that will be launched first).
After that, you can call the following code to start the third-party application:
ComponentName componentName = new ComponentName(pkg, cls);
Intent intent = new Intent();
(componentName);
startActivity(intent);
Note: You can use: /p/xml-apk-parser/
How to use:
AXMLPrinter2 can only parse binary xml files:
java -jar <binary xml filename>
Parsing the file:
java -jar <apk filename>