Compiler Q&A

Update and Rebuild your SDK and Sources with the latest version
Step 1: ~/ElastosRDKforUbuntu$git pull

Step 2: ~/ElastosRDKforUbuntu/Sources$emake rebuild or ~/ElastosRDKforUbuntu/Sources/Elastos/LibCore$emake rebuild ~/ElastosRDKforUbuntu/Sources/Elastos/Runtime$emake rebuild

Step 3: eldrop or ~/ElastosRDKforUbuntu/Targets/rdk/arm.gnu.linux.dbg/bin$elcopy Elastos.Utility.eco ~/ElastosRDKforUbuntu/Targets/rdk/arm.gnu.linux.dbg/bin$elcopy Elastos.Runtime.eco

Build and Run a Console Program Sample
Step 1: ~/ElastosRDKforUbuntu/Sources/Elastos/Samples/ComponentTechnology/FooBar$emake or emake rebuild

Step 2: pd @ change to ~/ElastosRDKforUbuntu/Targets/rdk/arm.gnu.linux.dbg/bin emu -c elrsh

Step 3: ~/ElastosRDKforUbuntu/Targets/rdk/arm.gnu.linux.dbg/bin$elcopy FooBarDemo.eco Copying FooBarDemo.eco to /data/data/com.elastos.runtime/elastos... 1393 KB/s (57404 bytes in 0.040s) ~/ElastosRDKforUbuntu/Targets/rdk/arm.gnu.linux.dbg/bin$elcopy FooBarDemo Copying FooBarDemo to /data/data/com.elastos.runtime/elastos... 135 KB/s (6235 bytes in 0.044s)

Step 4: In the adb shell: cd data/data/com.elastos.runtime ls To confirm all the files and directory are available.
 * 1) ./FooBarDemo

Result: Bar Foo OnFooEvent

How do you start emulator and teh adb shell?
Step 1: yukun@yukun-desktop:~/Dev/gingerbread$ gedit build/envsetup.sh export PATH=$PATH:/home/yukun/Dev/gingerbread/out/host/linux-x86/bin :/home/yukun/ElastosRDKforUbuntu/Build/Emulator/android_sdk/platform-tools export ANDROID_PRODUCT_OUT=/home/yukun/Dev/gingerbread/out/target/product/generic

Step 2: yukun@yukun-desktop:~/Dev/gingerbread$. build/envsetup.sh including device/htc/passion/vendorsetup.sh including device/samsung/crespo4g/vendorsetup.sh including device/samsung/crespo/vendorsetup.sh Step 3: yukun@yukun-desktop:~/Dev/gingerbread$ echo $PATH /home/yukun/jdk1.6.0_34/bin:/home/yukun/jdk1.6.0_34/jre/bin:/usr/local/sbin
 * /usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/yukun/bin
 * /home/yukun/Dev/gingerbread/out/host/linux-x86/bin
 * /home/yukun/ElastosRDKforUbuntu/Build/Emulator/android_sdk/platform-tools

Step 4: yukun@yukun-desktop:~/Dev/gingerbread$ emulator

Step 5: Open another terminal window. yukun@yukun-desktop:~/Dev/gingerbread$ adb shell adb server is out of date. killing...
 * daemon started successfully *

 How do you deploy and compile Dalvik&CAR in Android sources?
Step 1: Backup and move the original dalvik and libcore directories to another place.

Step 2: Import the Dalvik&CAR codes from the git repository.

Step 3: Replace the dalvik and libcore directories with the new one.

Step 4: Rebuild the Android source code with make or make update-api command.

How do you run HelloWorld on our Dalvik&CAR VM?
Step 1: Write a Foo.java. class Foo { public static void main(String[] args) { System.out.println("Hello, world"); } } Step 2: javac Foo.java

Step 3: dx --dex --output=foo.jar Foo.class Step 4: adb push foo.jar /sdcard/foo.jar

Step 5: adb shell dalvikvm -cp /sdcard/foo.jar Foo Unfortunately,you may get an error: Dalvik VM init failed (check log file)

If the dalvik vm works,you will get the result: Hello,world.

How do you resolve the 'Dalvik VM init failed' problem?
Step 1: Find pushDLL.sh in ~/gingerbread/dalvik/com.elastos.runtime. The content in it should look like below: adb push libz.so /data/data/com.elastos.runtime/elastos/libz.so adb push Elastos.Utility.eco /data/data/com.elastos.runtime/elastos/Elastos.Utility.eco adb push Elastos.Runtime.eco /data/data/com.elastos.runtime/elastos/Elastos.Runtime.eco adb push libc.so /data/data/com.elastos.runtime/elastos/libc.so Step 2: Run the pushDLL.sh script file, and make sure that all the *.so and *.eco files are pushed into the device's relevant directory. You may need to use the chmod u+x xxxx command to resolve some problems like 'Read-only file system' or 'Failed to copy: Permission denied'.

Step 3:

Home