Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

363
Vistas
Differences in developing Android kotlin apps vs Android Java apps on the command line (without android studio)

I am trying to compile a sample Android application (original source) written in kotlin on the command line.

The Java version of it compiles without a problem.

This is the file hierarchy layout:

.
├── AndroidManifest.xml
├── bin
├── mykey.keystore
├── obj
│   └── com
│       └── example
│           └── helloandroid
├── res
│   ├── drawable
│   ├── layout
│   │   └── activity_main.xml
│   └── values
│       └── strings.xml
└── src
    └── com
        └── example
            └── helloandroid
                ├── MainActivity.java
                └── MainActivity.kt

If I compile the Java version I issue the following commands:

  1. aapt package -f -m -J ./src -M ./AndroidManifest.xml -S ./res -I /opt/android-sdk/platforms/android-28/android.jar
  2. javac -d obj -classpath src -bootclasspath /opt/android-sdk/platforms/android-28/android.jar src/com/example/helloandroid/*.java
  3. dx --dex --output=./bin/classes.dex ./obj
  4. aapt package -f -m -F ./bin/hello.unaligned.apk -M ./AndroidManifest.xml -S ./res -I /opt/android-sdk/platforms/android-28/android.jar
  5. cp ./bin/classes.dex .
  6. aapt add ./bin/hello.unaligned.apk classes.dex
  7. apksigner sign --ks mykey.keystore ./bin/hello.apk
  8. Install the App via adb on a Google Pixel and it works.

Now the question is: How would I replicate that "workflow" with kotlin?

As far as I understand the only steps I need to change are the first two. I need to generate a R.kt file, because otherwise R is undefined and step two where I actually compile the sources to classes. After that there should be no difference ?

I don't want to use gradle. I just want to understand how I can use the command line utils.

Thanks in advance for any helpful answer :D

EDIT: The Source is completely in Kotlin, not a mix of Java+Kotlin as shkschneider suggested. The MainActivity.java is essentially the same Code as MainActivity.kt I just want to switch to Kotlin.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I solved the Problem. The R.kt file has to be generated via the JetBrains IDE from the R.java file, because they don't provide a standalone tool. If someone knows one please share a link :D

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda