Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ajavamind opened this issue Mar 31, 2021 · 3 comments
Open

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

ajavamind opened this issue Mar 31, 2021 · 3 comments

Comments

@ajavamind
Copy link

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 #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
@ranaaditya
Copy link
Member

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

@codeanticode
Copy link
Member

@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.

@ranaaditya
Copy link
Member

@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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants