PRESENTACIÓN
Introducción a Android: 10 cosas importantes que hay que entender
View more presentations from jezabelink
El código de la aplicación esta en la entrada anterior de mi blog
Cabe destacar que la mitad de ese tiempo es empleado en los elementos visuales, mas que en la programación, quizá debería llamarse Una aplicación Android en 15 minutos, pero siempre es importante que se vea bien, así que hay que dedicarle tiempo al diseño también.
1. use adb
In the VirtualBox network configuration, it is simplest to configure it for Host-Only or Bridged.
boot up Android iso image on the VirtualBox.
setup ethernet (normally, it will do DHCP by default)
find the IP address of the android VM, by going to the console alt-f1 and then typing: netcfg
you can go back to the UI by pressing alt-f7
on you host machine, go to
cd ANDROID_SDK_PATH/platform-tools
./adb kill-server
./adb connect ANDROID_VM_IP:5555, after this command, you should see something like below
* daemon not running. starting it now *
* daemon started successfully *
ANDROID_VM_IP:5555
./adb logcat to dump the debug log
Default segment is 192.168.56.0/24vboxnet0 Link encap:Ethernet HWaddr 0a:00:27:00:00:00
inet addr:HOST_IP_IN_VBOXNET Bcast:192.168.56.255 Mask:
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:2637 (2.5 KiB)
Settings>Development>
package yesica.tests.helloworld;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class YesicaHelloWorld extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, This is a Android x86 VM");
setContentView(tv);
}
}
Creating output directories if needed...And using adb to install it:
Compiling aidl files into Java classes...
Compiling RenderScript files into Java classes and RenderScript bytecode...
Generating R.java / Manifest.java from the resources...
compile:
ANDROID_SDK_PATH/tools/ant/main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Compiling 2 source files to PROJECT_PATH/Android-helloworld/bin/classes
Converting compiled files and external libraries into PROJECT_PATH/Android-helloworld/bin/classes.dex...
Packaging resources
Creating full resource package...
Creating Android-helloworld-debug-unaligned.apk and signing it with a debug key...
debug:
Running zip align on final apk...
Debug Package: PROJECT_PATH/Android-helloworld/bin/Android-helloworld-debug.apk
$ ./adb install PROJECT_PATH/Android-helloworld/bin/Android-helloworld-debug.apkAnd there will be an output like this:
265 KB/s (13470 bytes in 0.049s)
pkg: /data/local/tmp/Android-helloworld-debug.apk
Success
Package Android-helloworld-debug.apk deployed
Starting activity yesica.tests.helloworld.MainActivity on device ANDROID_VM_IP:5555
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=yesica.tests.helloworld/.MainActivity }