This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Kawa on Android - problems with setting text properties using "text:"
- From: Benny Tsai <benny dot tsai at gmail dot com>
- To: kawa at sourceware dot org
- Date: Wed, 9 Mar 2011 08:57:34 -0700
- Subject: Kawa on Android - problems with setting text properties using "text:"
Hello folks,
I just recently started working with Android programming and Scheme,
and was very excited to discover Kawa Scheme, which allows me to
combine the two interests!
However, I could use some help with an issue. When compiling (using
"ant debug") the following "Hello World" code (as described here:
http://per.bothner.com/blog/2010/AndroidHelloScheme/):
(require 'android-defs)
(activity hello
(on-create-view
(android.widget.TextView (this)
text:
"Hello, Android from Kawa Scheme!")))
... the compilation fails with the following error:
[java] c:\Android\KawaHello\src\kawa\android\hello.scm:6:5: type
constant-string is incompatible with required type int
Line 6 is where I pass in the "Hello..." string to "text:". I've read
that "text:" directs the compiler to look for "setText" and "addText"
methods. Looking at the TextView API, I see that there are multiple
setText() methods, the first of which is setText(int resid). Is the
compiler matching on that, and therefore expecting an int arg instead
of a String arg to "text:"?
This is extra puzzling to me because I've read Peter Feigl's recent
messages about Kawa on Android, and his test activity code appears to
use "text:" with Strings with no problems.
Here are some information on my environment. Please let me know if
any additional info is needed.
Windows XP (SP3)
Sun JDK 1.6.0_24
Ant 1.8.2
Kawa 1.11, source from SVN trunk, revision 6919, compiled with "ant
-Denable-android=true"
Android SDK Tools, revision 10
Android SDK Platform-tools, revision 3
SDK Platform Android 2.2, API 8, revision 2 (also tried targeting
Android 2.3.3, API 10, revision 1, same problem occurs)
respectfully,
-Benny