Thread

Java Native Interface for AW SDK (Sdk)

Java Native Interface for AW SDK // Sdk

1  |  

drchandra

Oct 13, 1998, 5:10pm
I have produced a first cut of the JNI for the SDK. It is not done yet. I
thought I'd release it now in order to allow feedback. I plan to update it
from release 5 to release 6, and then finish the rest of the calls. It's
about 86KB in size, at present. Should I attach files of that size in this
NG, or should I continue to only provide the URL to it?

Get it at http://www.mtn.org/~andrewes/AWJNI.ZIP

DrChandra/PK-37



--
Andrew C. Esh mailto:andrew_esh at cnt.com
http://www.mtn.org/~andrewes - ACE Home Page

roland vilett

Oct 13, 1998, 7:36pm
Hi DrChandra,

thanks very much for your heroic efforts! I'm sure many people will find
your JNI useful. Since it comes up so often, I'd like to add the question
"Can I write SDK applications in Java?" to the SDK FAQ and provide a link to
your JNI. I realize it isn't done yet, but then again neither is the SDK,
so... :)

-Roland

[View Quote]

edward sumerfield

Oct 14, 1998, 2:38am
Good work Doc. The URL is just fine.

Edward Sumerfield.

[View Quote]

thierry nabeth

Oct 23, 1998, 12:48pm
Hello,

I am very pleased to see that you have encapsulated the SDK into java.
You seem to have done a very good work.

I hope I will have the time soon to experiment what you have done using
VisualAge
for Java (very nice environment that is free for educational institutions).
Unfortunatly, I do not have a C compiler now, and I am not sure that what you
have done
can compile using the GNU compiler. Would it be possible to have also a binary
version
of what you have done ? (I suppose that with a binary version, you only need a
java compiler
to develop applications).

this
NG, or should I continue to only provide the URL to it?

For me a url is perfect.
I would suggest that you also publish on your web site the html page that
exists in the zip file.


Thank you.

Thierry Nabeth,
Research Fellow,
INSEAD CALT,
http://www.insead.fr/CALT/


[View Quote] > I have produced a first cut of the JNI for the SDK. It is not done yet. I
> thought I'd release it now in order to allow feedback. I plan to update it
> from release 5 to release 6, and then finish the rest of the calls. It's
> about 86KB in size, at present. Should I attach files of that size in this
> NG, or should I continue to only provide the URL to it?
>
> Get it at http://www.mtn.org/~andrewes/AWJNI.ZIP
>
> DrChandra/PK-37
>
> --
> Andrew C. Esh mailto:andrew_esh at cnt.com
> http://www.mtn.org/~andrewes - ACE Home Page

edward sumerfield

Oct 24, 1998, 2:24am
The SDk is also encapsulated into C++ library compiled with GNU if that is
what you want. Though Dr Chandra and I didn't work closely enough to ensure
that my C++ encapsulation and his java encapsulation would work together.

If this night goes wll then I will release the second version of the C++
wrapper.

Edward Sumerfield.

[View Quote]

thierry nabeth

Oct 26, 1998, 11:42am
Hello,

what you want.

Yes, I was aware about this initiative that I find very useful, because an OO
interface appears
to be higher level than a C interface.
I have downloaded the GCC compiler and your encapsulation so as to have a look
at it.

However, I am personnaly interested to find a all java solution.
The reason is that I do not have enough time to use both C++ and Java, and I
prefer to invest my time in java.
I indeed plan in the long term to explore java threads (--> active objects), and
to use the Web as the interface for Bots applications. (and if I have the time,
I would like to explore mobile agents in java using the voyager framework from
Objectspace).
Besides, I believe that a java solution can be easier to use, in particular for
creating prototypes.
(java is closer to an interpreted language than C++).

Note: A C++ version also makes sens, in particular for performance reasons. But
I am currently more intersting
in designing prototypes.


....

I have only noticed now some of your messages to Dr Chandra in the bulletin
board.
Very good idea to coordinate the two initiatives.

I believe that Object Orientation is a very important thing here, and is more or
less independant
of the OO language chosen (C++ or Java).
The identification of a good set of classes encapsulating the SDK is really what
matters here.
So what you do with Dr Chandra is very useful, and will contribute very
positively to making
the design of Bots applications easier, and have more people write such
applications.

Bye, an continue the good work.

Thierry. -- insead calt


[View Quote] > The SDk is also encapsulated into C++ library compiled with GNU if that is
> what you want. Though Dr Chandra and I didn't work closely enough to ensure
> that my C++ encapsulation and his java encapsulation would work together.
>
> If this night goes wll then I will release the second version of the C++
> wrapper.
>
> Edward Sumerfield.
>
[View Quote]

edward sumerfield

Oct 26, 1998, 12:25pm
[snip]

>I indeed plan in the long term to explore java threads (--> active
objects), and
>to use the Web as the interface for Bots applications. (and if I have the
time,
>I would like to explore mobile agents in java using the voyager framework
from

>Objectspace).

Voyager looks good. I agree. I have development an agent framework of my
own. Its very easy in java, just implement serializable and writeObject. It
rocks. I dare say this is a simplification of the routing and recovery logic
required.

>Besides, I believe that a java solution can be easier to use, in particular
for
>creating prototypes.
>(java is closer to an interpreted language than C++).


I agree that Java is a cleaner OO language. I am only learning C++ because
that is where the jobs are these days.

However, I must disagree about the development advantages of java being
closer to an interpreted language. You still have to go through a compile
step so whether that results in executable code or byte code you still have
your development interation time wasted.

Infact, I would go as far as saying that Java is worse in this respect
because the Sun compiler is far slower than Gcc for example. I know the MS
Java compiler rips but standards is where its at in my opinion.

>Note: A C++ version also makes sens, in particular for performance
reasons. But
>I am currently more intersting
>in designing prototypes.


Did you know that Cygnus has a Java to .exe compiler available. Still beta I
believe but that should solve your performance problem. IBM has a nice java
to exe compiler aswell.

together.
>...
>
>I have only noticed now some of your messages to Dr Chandra in the bulletin
>board.
>Very good idea to coordinate the two initiatives.
>
>I believe that Object Orientation is a very important thing here, and is
more or
>less independant
>of the OO language chosen (C++ or Java).
>The identification of a good set of classes encapsulating the SDK is really
what
>matters here.
>So what you do with Dr Chandra is very useful, and will contribute very
>positively to making
>the design of Bots applications easier, and have more people write such
>applications.


I agree. OO rocks but I really do need some more input into an eventual
model. My ideas keep changing.

For my next release I am removing the Robot class and replacing it with an
Instance and Avatar class. The concept being that both your bot and other
bots that you see will be represented as Avatar objects. You can end up with
code like this.

Avatar me ( new Instance(number, priv) );
Avatar them1 (NULL);
Avatar them2 (NULL);

me.distanceFrom(them1);
me.follow(them1);
me.faceToFace(them1);
them1.distanceFrom(them2);

There are any number of methods that relate to Avatar interaction.

[snip]

Edward Sumerfield

drchandra

Oct 27, 1998, 11:14pm
How about if we try to coalesce these two projects into one? The Java can
just as well call your C++ encapsulation as it can a C one. If we are
working from the same base, we should be able to trade/translate object
designs.

DrChandra/PK-37

--
Andrew C. Esh mailto:andrew_esh at cnt.com
http://www.mtn.org/~andrewes - ACE Home Page


[View Quote]

drchandra

Oct 27, 1998, 11:38pm
The current release (version 0.3) compiles on a free compiler called gcc,
available for Windows as "CygWin32" from Cygnus. You can find out more about
it, and download it from www.cygnus.com.

In the next version of AWJNI, I will leave the C/C++ portions of the code
built, so that someone can use the interface without doing any building
outside of Java. Look for it next week.

DrChandra/PK-37

--
Andrew C. Esh mailto:andrew_esh at cnt.com
http://www.mtn.org/~andrewes - ACE Home Page


[View Quote]

edward sumerfield

Oct 28, 1998, 12:48am
We should definately work together. It saves a lot of typing.

You said that you/Doug have completed the C++ encapsulation of all the SDK.
I have only been doing that as I need the functions so you are far ahead of
me there.

We should discuss where we can share work.

I am implementing C++ because that is what I want to learn. I been doing
java for a few years so an less interested in that implementation. Also, the
me, C++ is where the job market is.

I think the big thing we can share is some discussions on the OO model that
represents AW. I still consider myself a novice at modelling and an always
interested in other peoples approaches.

What are your goals for your implementation?

[View Quote]

drchandra

Oct 28, 1998, 3:03pm
[View Quote] Actually, I started with C++, but then Doug picked it up and ported it to C,
and finished it. I am still evaluating that maneuver, but I'm starting to
like it. The main thing Doug did is put the project into CygWin32, which
makes it even more accessible to those who are too financially challenged to
spend big bucks on a fancy C++ development suite.

The main reason I wanted to work with C++ is because I had it, and I thought
that later additions to the project could be made based on integration
between Java objects working with C++ objects. In other words, I envisioned
objects orientedness on both sides of the JNI line. I was also thinking of
building twin versions of the object sets on top of my C++ encapsulation:
One in Java, and one in C++.

Now that I've seen your work in C++, and thought about the actual goals and
requirements of the JNI project, I don't have a compelling reason to move
away from C. I can still see that we could both use the same C++ interface
to the AW SDK, but I don't want to move away from CygWin32 for that. For
that reason, I am looking into how well CygWin32 supports C++. I think it
does, but I'm new to it, so I need experience.

>We should discuss where we can share work.

I think the areas which we may still be able to collaborate are in UML
modeling, and general object sets. I was thinking that I could port objects
from one language to the other, and we could build a base of common AW
objects, available in both languages. I have Rational Rose, so UML modeling
and multi-language code generation is a snap. The only differences in the
object sets would be the specifics of how they call the AW SDK.

>
>I am implementing C++ because that is what I want to learn. I been doing
>java for a few years so an less interested in that implementation. Also,
the
>me, C++ is where the job market is.

Maybe. I see Java as being more productive than C++, unless you have years
of experience in C++. Usually by the time you've got that much experience,
you've priced yourself out of the general application development job
market. Also, C++ tends to be much less portable across platforms than Java.

>I think the big thing we can share is some discussions on the OO model that
>represents AW. I still consider myself a novice at modelling and an always
>interested in other peoples approaches.

This is where we can collaborate the most. Perhaps I should download and do
some analysis of your C++ code, along side the Java objects that Doug
developed. A combination of those two sources is what I'll work toward. I'll
produce a few class diagrams, upon which we can build some use-cases.

What UML modeler do you use? I will see if the evaluation version of Rose
will read the models I plan to produce, so you can at least view them.

>What are your goals for your implementation?

To look at going back to C++ without losing CygWin32. If I can do that, then
we might have a common base encapsulation layer we can both build on.

[View Quote]
--
Andrew C. Esh mailto:andrew_esh at cnt.com
http://www.mtn.org/~andrewes - ACE Home Page

roland vilett

Oct 31, 1998, 2:35am
I just wanted to mention, I'm sure everyone's definition of "big bucks" is
different, but I have recently seen the standard edition of Visual C++ 6.0
for sale at online software sites for as little as $80 to $90. Just skip
past the ~$800 "professional" version (which they usually list first) and
look further down the list, you'll probably find it there.

If you find yourself spending inordinate amounts of time struggling with a
freeware compiler, you might want to consider Visual C++...I don't want to
sound like I'm actually pushing Microsoft software or anything (gasp), but
the Visual line of development tools really are useful products to have
around, especially if you are going to be doing a fair amount of programming
under Windows. Among other things, the help files come with a complete
Windows API reference, which is something you absolutely must have on hand
if you are going to be doing any GUI programming. It also comes with MFC,
which a lot of people find useful, although I don't use it much myself.

-Roland

[View Quote]

edward sumerfield

Nov 1, 1998, 2:14pm
I agree, it is an excellent product. I have used 4.0 extensively and I have
heard that 6.0 is fabulous. I am choosing to use GNU at the moment because I
don't have $80. Though I agree also that that is an excellent price for the
software you are getting.

I am not totally clear on the differences between standard ($80), professional
($800) and enterprise (>$1000) editions. I have always been blessed by working
for companies that give me the enterprise version.

Edward Sumerfield.

[View Quote] > I just wanted to mention, I'm sure everyone's definition of "big bucks" is
> different, but I have recently seen the standard edition of Visual C++ 6.0
> for sale at online software sites for as little as $80 to $90. Just skip
> past the ~$800 "professional" version (which they usually list first) and
> look further down the list, you'll probably find it there.
>
> If you find yourself spending inordinate amounts of time struggling with a
> freeware compiler, you might want to consider Visual C++...I don't want to
> sound like I'm actually pushing Microsoft software or anything (gasp), but
> the Visual line of development tools really are useful products to have
> around, especially if you are going to be doing a fair amount of programming
> under Windows. Among other things, the help files come with a complete
> Windows API reference, which is something you absolutely must have on hand
> if you are going to be doing any GUI programming. It also comes with MFC,
> which a lot of people find useful, although I don't use it much myself.
>
> -Roland
>
[View Quote]

thierry nabeth

Nov 3, 1998, 10:44am
Hello,

Thank you for the information.

But what I am looking for is the possibility to write SDK application totally
using java (JDK or VisualAge)
without having to bother (and spend time) having to install a C compiler.
The issue here is not only about money but about time. (precious time that is
better used for me to begin prototyping
applications rather than configuring a compiler, understand the deep logic of
JNI, spending time reremembering
the C language to forget it soon after, etc.).

I do not see what would prevent to have a dll that encapsulates the SDK, and
only use a java compiler !?

Actually, I am trying to explore this issues, have installed the Cygnus GPP
compiler (B20),
installed the version 0.3 of JNI encapsulation of Dr. Chandra.

In the AWJNI
I have done a "make". (make clean, than make).
It seems to have compiled ok.

I have created a new folder where I have put the files:
Aw.class
Aw.dll
Aw.class (and *.java)
AWExeption.class (and *.java)
cygwin1.dll
libaw.dll

--------
What is not clear for me is how you specify you citizen name.
(but right now I am just trying to identify something that works).


===== what I get is:
static init
aw_init - build:

int init (int build) = %d
454
void term (void)

aw_term

aw_login

int login (void) = %d
444
aw_wait

....

int world_list (void) = %d
444
aw_object_add

<< Crash >> (launch the debugger on NT).

==========

454 error message has to do with the wrong version.
(I use the build 7 of the SDK).

I didn't have the time to explore any more, but I will.

If in the mean time you have some ideas, let me know.

Note:
The content of the AWJNI folder is not very clear for me.
For instance the Hello... folder does not compile.
Besides I was not sure in the AWJNI folder what are supposed to be the
application.
Is it Aw.java as I assumed or something else ?


Bye,

Thierry Nabeth, -- calt.

[View Quote] > I just wanted to mention, I'm sure everyone's definition of "big bucks" is
> different, but I have recently seen the standard edition of Visual C++ 6.0
> for sale at online software sites for as little as $80 to $90. Just skip
> past the ~$800 "professional" version (which they usually list first) and
> look further down the list, you'll probably find it there.
>
>

.....

>

thierry nabeth

Nov 3, 1998, 2:11pm
Hello,

(I use the build 7 of the SDK).

I have found in the AWJNI on the documentation that AWJNI was using the build 6
of sdk.

So that should explain the error message. 454.

What is more surprising is that I have the same error message even after I have
subsituted
the new Aw.h (of the Build 7 sdk) in the AWCyg.h and AwData.h !??

(of course, I have done a new make clean, recompiled using make, transfered the
new
libaw.dll, etc.).



Chandra >> In the next version of AWJNI, I will leave the C/C++ portions of the
code
built, so that someone can use the interface without doing any building
outside of Java. Look for it next week.

Oops, I had not seen this message.
I believe this is better for me to wait for this update.

Bye,

Thierry -- calt.








[View Quote] > Hello,
>
> Thank you for the information.
>
> But what I am looking for is the possibility to write SDK application totally
> using java (JDK or VisualAge)
> without having to bother (and spend time) having to install a C compiler.
> The issue here is not only about money but about time. (precious time that is
> better used for me to begin prototyping
> applications rather than configuring a compiler, understand the deep logic of
> JNI, spending time reremembering
> the C language to forget it soon after, etc.).
>
> I do not see what would prevent to have a dll that encapsulates the SDK, and
> only use a java compiler !?
>
> Actually, I am trying to explore this issues, have installed the Cygnus GPP
> compiler (B20),
> installed the version 0.3 of JNI encapsulation of Dr. Chandra.
>
> In the AWJNI
> I have done a "make". (make clean, than make).
> It seems to have compiled ok.
>
> I have created a new folder where I have put the files:
> Aw.class
> Aw.dll
> Aw.class (and *.java)
> AWExeption.class (and *.java)
> cygwin1.dll
> libaw.dll
>
> --------
> What is not clear for me is how you specify you citizen name.
> (but right now I am just trying to identify something that works).
>
> ===== what I get is:
> static init
> aw_init - build:
>
> int init (int build) = %d
> 454
> void term (void)
>
> aw_term
>
> aw_login
>
> int login (void) = %d
> 444
> aw_wait
>
> ...
>
> int world_list (void) = %d
> 444
> aw_object_add
>
> << Crash >> (launch the debugger on NT).
>
> ==========
>
> 454 error message has to do with the wrong version.
> (I use the build 7 of the SDK).
>
> I didn't have the time to explore any more, but I will.
>
> If in the mean time you have some ideas, let me know.
>
> Note:
> The content of the AWJNI folder is not very clear for me.
> For instance the Hello... folder does not compile.
> Besides I was not sure in the AWJNI folder what are supposed to be the
> application.
> Is it Aw.java as I assumed or something else ?
>
> Bye,
>
> Thierry Nabeth, -- calt.
>
[View Quote]

drchandra

Nov 5, 1998, 10:20pm
Yep, I understand. If you don't do C, there should be no requirement for it.
My next release will also include the binary support so you don't have to
compile anything in C.

DrChandra/PK-37
--
Andrew C. Esh mailto:andrew_esh at cnt.com
http://www.mtn.org/~andrewes - ACE Home Page


[View Quote]

drchandra

Nov 5, 1998, 10:22pm
Yes, 0.3 is build 6. Next one. Not sure when. Anyone willing to do the
update is welcome to do so, unless I get to it first.



--
Andrew C. Esh mailto:andrew_esh at cnt.com
http://www.mtn.org/~andrewes - ACE Home Page


[View Quote]

thierry nabeth

Nov 9, 1998, 10:58am
Hello,

I have managed to make the AWJNI with the new build (7) version.
I had to do some substitution in the *.h, the *.c and the *.java files.

(I use grep to identify what where BUILD was used).

The only problem, is that in the aw.java file, the version is hard coded.
=====
Aw awcall = new Aw();
System.out.println("int init (int build) = %d\n" +awcall.AWinit (5));
=====
5 is the version here.


On the other hand, I didn't have to time to figure out exactely how to specify
the login
and the password, and more generally what *.java file to use to start a demo.
(I have used aw.java, but I am not sure this is the correct file).

====== (from aw.java)
awcall.AWterm ();
System.out.println("int login (void) = %d\n" +awcall.AWlogin ());
System.out.println("int wait (int milliseconds) = %d\n" +awcall.AWwait
(10));
System.out.println("int int (ATTRIBUTE a) = %d\n" +awcall.AWint_get
(CITIZEN_NUMBER));
System.out.println("int i_set (ATTRIBUTE a, int value) = %d\n"
+awcall.AWint_set (CITIZEN_NUMBER, 1));
System.out.println("char* string (ATTRIBUTE a) = %d\n" +awcall.AWstring
(LOGIN_NAME));
System.out.println("int string_set (ATTRIBUTE a, char *value) = %d\n"
+awcall.AWstring_set (LOGIN_NAME, "DrChandra"));
System.out.println("int bool (ATTRIBUTE a) = %d\n" +awcall.AWbool
(CITIZEN_BETA));
System.out.println("int bool_set (ATTRIBUTE a, int value) = %d\n"
+awcall.AWbool_set (CITIZEN_BETA, 1));
System.out.println("int enter (char *world, int avatars) = %d\n"
+awcall.AWenter ("AW", 21));
======

It would be nice if we could have a clean version of the JNI folder, with a very
short description of the
function of the different files.
I can eventually help on this, but it takes me a lot of time to try to
understand, and besides I am afraid that
what I do will be obsolet with the new version.


Thierry -- calt.


[View Quote] > Yes, 0.3 is build 6. Next one. Not sure when. Anyone willing to do the
> update is welcome to do so, unless I get to it first.
>
> --
> Andrew C. Esh mailto:andrew_esh at cnt.com
> http://www.mtn.org/~andrewes - ACE Home Page
>
>

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2022. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn