Eftime,


Report on what I've done so far.



I've try ./auto_build.sh linux_unsecured_with_java on iotivity root folder,
it shows done building target. I do not change the output folder.

And then I run the java -cp command, I believe this is to configure the
classpath.



There is no file inside folder
$(pwd)/out/linux/x86_64/debug/java/examples-java/simpleclient

But there is a simpleclient.jar found in $(pwd)/java/
examples-java/simpleclient/build/libs

I am not sure where do I mess up the build process.



I do managed to import the gradle project found inside $(pwd)/java into my
Eclipse Mars.

There is an error saying that line 20 of build.gradle value of $TARGET_OS
not defined, could be because this script is for Scons. I edit it to
/iotivity-linux/build/libs/ then I am able to import it.



I think I could somehow manage to use JNI with files inside $(pwd)/java/jni
with those .so library to test Iotivity. But would be better if I could do
things in your way in order to make changes and commit back to gerrit.



If I run SimpleServer project inside Eclipse under debug mode. This line
will have linking error

OcPlatform.Configure(platformConfig); <- UnsatisfiedLinkError

It could be telling me that it couldn't find the library file which is
trying to link with.

I am still working on this issue.



Could you please share with me what kind of development environment you are
using to wrap iotivity with JNI?





From: [email protected]
[mailto:iotivity-dev-bounces at lists.iotivity.org] On Behalf Of Maxi Wu
Sent: Thursday, May 5, 2016 5:02 PM
To: 'Eftime, Petre P'; uzchoi at samsung.com; iotivity-dev at lists.iotivity.org
Subject: Re: [dev] Is it possible to port the Java(Android) API to general
java application?



Eftime,



I have checkout the source from IOT-1089, and have some trouble trying to
build it. Not familiar with Scons.



If I run ./auto_build.sh, first time g++ gives me a virtual memory used up
error. I tried it after expanding my memory, it ends with "done building
target".

Then I look into the /out folder, there is /linux/x86_64/release, inside
/resource/example with executable files of c.

I looked into SConstruct, auto_build.sh and Readme.scons.txt, I should be
looking for folder generic_java/examples, is it?



I have also tried the build command "scons RELEASE=true BUILD_JAVA=ON",
gives me an error "AttributeError 'SconsEnvironment' object has no attribute
'Download': SConstruct line28



I've also tried to import gradle project found in folder /java/examples-java
to Eclipse Mars, a gradle project preview failed window pop up. Could not
fetch model of type 'GradleBuild' ysing Gradle distribution
http://services.gradle.org/distributions/gradle-2.2.1-all.zip



Please give me some information or what command to use, on how to build java
examples and core for Linux platform.



Thanks a lot,



From: Maxi Wu [mailto:[email protected]] 
Sent: Wednesday, May 4, 2016 3:27 PM
To: 'Eftime, Petre P'; 'uzchoi at samsung.com';
'iotivity-dev at lists.iotivity.org'
Subject: RE: [dev] Is it possible to port the Java(Android) API to general
java application?



Eftime,



Thank you. Glad to have any help with Java API.



I am trying to work on a client application to make request to iotivity
cloud server or iotivity resource.

There is already C/C++ library running on Linux, I am thinking wrapping it
with JNI will enable Generic Java development, that is what you are working
on, it that right?



I will take a look at your changes and see if I could create a simpleclient
with it.



One more thing, wiki has a Iotivity Simulator which run on Eclipse. It is a
Java wrapper on simulator core.

I am wondering what this simulator core actually do. Will I able to import
this library and use it to communicate with a genuine iotivity server?

Or maybe I could try to understand what CoAP message it sends out and
develop a generic CoAP client to talk to iotivity server? If the CoAP and
application layer protocol of Iotivity is not going to have a drastic
change, implementing a generic Java CoAP client could be a viable solution.



From: Eftime, Petre P [mailto:[email protected]] 
Sent: Wednesday, April 27, 2016 8:07 PM
To: uzchoi at samsung.com; 'Maxi Wu'; iotivity-dev at lists.iotivity.org
Subject: RE: [dev] Is it possible to port the Java(Android) API to general
java application?



Hi Maxi,



I am currently on getting Java API working on Linux, but review and testing
might take a while since it's a major change in how the Java API is being
built for Android as well. For now transport is only IP, no BLE.



You can find my changes here: https://gerrit.iotivity.org/gerrit/#/c/7895/,
and you should be able to build and run the simpleclient and simpleserver
examples, or your project as well. The API documentation should be very
similar to the Android one, minus Activity or Context.



However, keep in mind that some things might change and not everything has
been tested thoroughly, and there's no official documentation for how to
build and run a program right now, although I can offer you help here, if
you need any.



--

Petre Eftime



From: [email protected]
[mailto:iotivity-dev-bounces at lists.iotivity.org] On Behalf Of ???(Uze Choi)
Sent: Wednesday, April 27, 2016 12:14 PM
To: 'Maxi Wu' <maxi.wu at u-media.com.tw>; iotivity-dev at lists.iotivity.org
Subject: Re: [dev] Is it possible to port the Java(Android) API to general
java application?



Hi Maxi,



Please check the Eftime, Petre P mail with Title as "Re: [dev] Generic Java
Bindings Feature"

Visit
https://gerrit.iotivity.org/gerrit/gitweb?p=iotivity.git;a=shortlog;h=refs/h
eads/generic-java



BR, Uze Choi

From: [email protected]
[mailto:iotivity-dev-bounces at lists.iotivity.org] On Behalf Of Maxi Wu
Sent: Wednesday, April 27, 2016 5:36 PM
To: iotivity-dev at lists.iotivity.org
Subject: [dev] Is it possible to port the Java(Android) API to general java
application?



Hi,



Java is cross-platform, but JNI uses native library. Is it possible to use
this Android API like normal JAVA application?

If not, How to create a Java client? Do we need to interact with iotivity
cloud using CoAP?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160506/50e8b218/attachment.html>

Reply via email to