How to create a lib (SDK), import, and run the application
Step by step, creating the project:
Sdk:
1 - In your android studio:
Step by step, creating the project:
Sdk:
1 - In your android studio:
Select > File > New > New Project
2 - On the window, select the option more correct to you, for example:
Suggestion: Empty views activity.
After select, select the option Next.
3 - Window to configure the project:
Add a project name, package name, save location, language, and minimum SDK, that makes sense for your SDK context;
After click in Finish;
4 - Create a new module to your project:
5 - New window, module with android library:
Right. You have a project configured to start your SDK. Now, letis go create a project client, and import e run the application.
6 - Create a simple project client:
Suggestion: Use the step 1, 2 and 3, to create a project. Change the name, package, location, language as needed;
7 - Now, you need go back to project sdk, and create a file AAR:
Open your terminal, and run the command line bellow:
.\gradlew assemble
This command line above, create the file AAR, in your package:
C:\Users\patri\OneDrive\Documents\Sdk\mylibrary\build\outputs\aar
8 - Import the file on project client:
Open the file build.gradle (Module :app)
Add new dependency:
After import, run Sync Now.
9 - After it, create a simple activity in your module sdk. And run again the step 7.
In your activity, on module SDK, make sure that this activity is exported, for example:
android:exported="true"
10 - Create a button in your project client, to start the activity of the sdk. Look bellow, an example:
When the user selects the button, the screen opens, as shown in the second image;
Nice! You has finished!