Home | History | Annotate | Download | only in HelloWorld
      1 .class public LHelloWorld;
      2 
      3 #Ye olde hello world application
      4 #To assemble and run this on a phone or emulator:
      5 #
      6 #java -jar smali.jar -o classes.dex HelloWorld.smali
      7 #zip HelloWorld.zip classes.dex
      8 #adb push HelloWorld.zip /data/local
      9 #adb shell dalvikvm -cp /data/local/HelloWorld.zip HelloWorld
     10 #
     11 #if you get out of memory type errors when running smali.jar, try
     12 #java -Xmx512m -jar smali.jar HelloWorld.smali
     13 #instead
     14 
     15 .super Ljava/lang/Object;
     16 
     17 .method public static main([Ljava/lang/String;)V
     18     .registers 2
     19 
     20     sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
     21 
     22     const-string	v1, "Hello World!"
     23 
     24     invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
     25 
     26     return-void
     27 .end method