processing-android icon indicating copy to clipboard operation
processing-android copied to clipboard

import processing.net.* that is not available in Android mode

Open ajavamind opened this issue 3 years ago • 3 comments

I use processing.net in Java mode and would like to use in Android mode too. The library is missing. I got around the problem by using the Client source code in a tab, after removing package and public keywords. I think the net library would be useful. Another issue https://github.com/processing/processing-android/issues/177 discussed the same problem and solution but should not have been closed. I also found the Client code had an excessive timeout value that I think a new library should make configurable. My work around /**

  • @param parent typically use "this"
  • @param host address of the server
  • @param port port to read/write from on the server */ Client(PApplet parent, String host, int port) { this.parent = parent; this.host = host; this.port = port;
try {
  //socket = new Socket(this.host, this.port);    ****replaced this line with the following two lines:****
  socket = new Socket();
  socket.connect(new InetSocketAddress(this.host, this.port), 2000); // 2 second socket timeout limit

ajavamind avatar Mar 31 '21 13:03 ajavamind

@codeanticode do we really need to separately implement Network and PDF library for android-mode ?

ranaaditya avatar Apr 01 '21 04:04 ranaaditya

@ajavamind thanks for bringing this issue up.

@ranaaditya We might need a separate implementation of the Network library, not sure how much of the original Java library can be reused but according to what @ajavamind is saying, at least some of it. I don't think it makes sense to port the pdf library to Android becayse it's mean to render the output of the sketch to a pdf file, doesn't seem a very useful use case on mobile.

codeanticode avatar Apr 25 '21 23:04 codeanticode

@ajavamind thanks for bringing this issue up.

@ranaaditya We might need a separate implementation of the Network library, not sure how much of the original Java library can be reused but according to what @ajavamind is saying, at least some of it. I don't think it makes sense to port the pdf library to Android becayse it's mean to render the output of the sketch to a pdf file, doesn't seem a very useful use case on mobile.

@codeanticode I feel the same, actually we can make separate network library wrapper based on android.net package and java.net I mentioned this issue GSoC-potentials projects also :)

ranaaditya avatar Apr 25 '21 23:04 ranaaditya