1. Find the github source code of the framework used by the jar package and download it
. For example: the original jar package.
Find the github address of the framework source code:
https://github.com/eclipse/paho.mqtt.android
Use git to pull the source code project to the local
2. New Module — Select Java or Kotlin Library to create
the entire project downloaded in (1):
(2) Find the path content in the java directory under the org.eclipse.paho.client.mqttv3 folder to be packaged , as shown in the figure
org.eclipse.paho.client.mqttv3
(3) Fill in the path name into the new Java or Kotlin Library In the Package name box below
3. Put the source code into the module
(1) Copy from the java directory just now
(2) Paste it into the java directory of the new module
4. After modifying the source code, package the jar package. The
packaged jar package is in the build-libs directory under this mudule (the name of the packaged jar package will be consistent with the module name, you can also modify the name of the jar package and then use it) 5
. Import the jar package using
(1) serve the jar package into your own project
(2) introduce it in build
6. Completed, Nice!