Jack Palevich 9302304b46 Add jquery file used by example. | 12 năm trước cách đây | |
---|---|---|
.. | ||
assets | 12 năm trước cách đây | |
res | 12 năm trước cách đây | |
src | 12 năm trước cách đây | |
.gitignore | 12 năm trước cách đây | |
AndroidManifest.xml | 12 năm trước cách đây | |
HelloAmber.st | 12 năm trước cách đây | |
Makefile | 12 năm trước cách đây | |
README.md | 12 năm trước cách đây | |
ant.properties | 12 năm trước cách đây | |
build.xml | 12 năm trước cách đây | |
local.properties | 12 năm trước cách đây | |
proguard-project.txt | 12 năm trước cách đây | |
project.properties | 12 năm trước cách đây |
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.