Jack Palevich 9302304b46 Add jquery file used by example. | преди 12 години | |
---|---|---|
.. | ||
assets | преди 12 години | |
res | преди 12 години | |
src | преди 12 години | |
.gitignore | преди 12 години | |
AndroidManifest.xml | преди 12 години | |
HelloAmber.st | преди 12 години | |
Makefile | преди 12 години | |
README.md | преди 12 години | |
ant.properties | преди 12 години | |
build.xml | преди 12 години | |
local.properties | преди 12 години | |
proguard-project.txt | преди 12 години | |
project.properties | преди 12 години |
HelloAmber Android Amber Smalltalk Example
This example shows how to create an Android application that is partially written in Amber Smalltalk. The Android Java code uses a WebView to load and execute the JavaScript code produced by the Amber Smalltalk amberc compiler.
You could modify this example to create your own Android Amber Smalltalk examples.
Install the Android SDK from http://developer.android.com/sdk/index.html
(Tested with Android SDK version 17, should work with any SDK that supports Android SDK 8 or above.)
Make sure your PATH includes the android sdk tools and platform-tools directories.
If you want to run on a real Android device you will need a phone running Android 2.2 (Froyo) or newer. (With some work this restriction could be relaxed to support back to Android 1.6, although JavaScript performance is not good on earlier Android phones.)
cd helloamber
make
If the build is successful, you should be able to use your desktop computer's web browser to run the HTML5 part of the Android application. Simply open assets/index.html
Check that ADB can see your android device or emulator:
adb devices
If your device is visible:
cd helloamber
make install
make run
Javascript errors and console log messages are sent to the Android log. Use the adb logcat command to view the Android log.
The amberc compiler does not stop the "make" process when a smalltalk error is detected. You have to manually scan the build log to see if there are any smalltalk errors.
The makefile only supports making "debug" versions of Android applications. A release version would be the same, except that it is "signed", which is needed in order to publish on Android Market.
The app would start running more quickly if a lighter-weight version of JQuery was used.