Icon

Creating an application template for Spydroid


In this post, we'll look at how to create an application template from scratch
09 Ago 11:28

Buscamos crear una plantilla de aplicación básica para camuflar un poco nuestra aplicación, que nos abre las puertas a un dispositivo android, esto con fines éticos y de aprendizaje

1. Creating a new module in the project

Version Catalog

• Select Android Library, change the module name and package, and finish.
Version Catalog

2. Configure the build.gradle file of your template:

• Make sure to have the following plugins in the header

build.gradle.kts (:template-your_name_template)

- file
Version Catalog

• Configure a buildFeatures for usage the features of the app
Version Catalog


• Ensure you have the following dependencies with version catalog in your Gradle file
Version Catalog

Version Catalog

3. Create the directory structure according to your needs

Version Catalog

• Example structure
Version Catalog

4. Create a Navigation.kt file at the root of the package and keep it public

• NOTE: Remember that the Navigation.kt file will be the only one visible in the app; make everything else internal by using the internal visibility modifier

Navigation.kt

- file
Version Catalog

Version Catalog

5. Create a view. We'll use HomeScreen as an example

• First Hello World

HomeScreen.kt

- file
Version Catalog

6. Call your template from the build.gradle file at the app level

• Open the Gradle Scripts directory

build.gradle (:app)

- file
Version Catalog

• Add the following in dependencies: implementation(project(":template-your_name_template"))
Version Catalog

7. Add your template to the application

• Open the directory app > net.spydroid.app
Version Catalog

•Create a string defining your template and set it to the variable template_app

config.kt

- file
Version Catalog

•Create a constant named preference_name and assign it the same string you created earlier

MainScreen.kt

- file
Version Catalog

•Go to line 112 of the file and add the navigation for your app, just like the others

MainScreen.kt

- file
Version Catalog

8. Run Project

Version Catalog