JavaOSC icon indicating copy to clipboard operation
JavaOSC copied to clipboard

Is there somewhere a working Android example ?

Open hannesa2 opened this issue 1 year ago • 11 comments

I'm fighting with Android and run into multiple issues, so the general question arise: Is there somewhere a running sample for Android ?

hannesa2 avatar Sep 23 '24 16:09 hannesa2

When I use it implementation "com.illposed.osc:javaosc-core:0.9"

android {
   ...
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
}

It runs into

java.lang.NoSuchMethodError: No virtual method getDefinedPackage(Ljava/lang/String;)Ljava/lang/Package; in class Ljava/lang/ClassLoader; 
or its super classes (declaration of 'java.lang.ClassLoader' appears in /apex/com.android.art/javalib/core-oj.jar)
  at com.illposed.osc.LibraryInfo.<clinit>(LibraryInfo.java:46)
  at com.illposed.osc.LibraryInfo.hasStandardProtocolFamily(LibraryInfo.java:283)
  at com.illposed.osc.transport.udp.UDPTransport.<init>(UDPTransport.java:61)
  at com.illposed.osc.transport.OSCPort.<init>(OSCPort.java:40)
  at com.illposed.osc.transport.OSCPortIn.<init>(OSCPortIn.java:108)
  at com.illposed.osc.transport.OSCPortIn.<init>(OSCPortIn.java:123)
  at com.illposed.osc.transport.OSCPortIn.<init>(OSCPortIn.java:132)
  at com.illposed.osc.transport.OSCPortIn.<init>(OSCPortIn.java:145)
  at com.illposed.osc.transport.OSCPortIn.<init>(OSCPortIn.java:160)
  at com.illposed.osc.transport.OSCPortIn.<init>(OSCPortIn.java:170)

hannesa2 avatar Sep 23 '24 16:09 hannesa2

Just for the records, when I use it implementation "com.illposed.osc:javaosc-core:0.8"

It runs into

java.lang.ClassNotFoundException: Didn't find class "java.awt.Color" on path: DexPathList[[zip file "/data/app/~~TPKBDhW-PO6T_CQCzznfDQ==/info.hannesa2.osc-bnj0nyska4PediHZHIEerQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~TPKBDhW-PO6T_CQCzznfDQ==/info.hannesa2.osc-bnj0nyska4PediHZHIEerQ==/lib/arm64, /system/lib64, /system_ext/lib64]]
  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
  at com.illposed.osc.argument.handler.AwtColorArgumentHandler.getJavaClass(AwtColorArgumentHandler.java:43)
  at com.illposed.osc.OSCSerializer.<init>(OSCSerializer.java:101)
  at com.illposed.osc.OSCSerializerAndParserBuilder.buildSerializer(OSCSerializerAndParserBuilder.java:64)
  at com.illposed.osc.transport.channel.OSCDatagramChannel.send(OSCDatagramChannel.java:100)
  at com.illposed.osc.transport.udp.UDPTransport.send(UDPTransport.java:138)

hannesa2 avatar Sep 23 '24 16:09 hannesa2

https://github.com/youlisse/Ircam

check that its only osc send from android in kotlin but might help

youlisse avatar Oct 08 '24 08:10 youlisse

Thanks for the hints. I've to receive in Android from outside the device and I've issues to receive something. Maybe it's an network ?

hannesa2 avatar Oct 08 '24 09:10 hannesa2

if you think it could be the network and you dont have the hand on it try with your phone as an hotspot some network block udp message (like public network, company network ...)

youlisse avatar Oct 08 '24 09:10 youlisse

i also struggle implementing osc in :(

youlisse avatar Oct 08 '24 09:10 youlisse

https://github.com/youlisse/Ircam

check that its only osc send from android in kotlin but might help

Your repo is disappeared @youlisse Image

hannesa2 avatar Feb 14 '25 05:02 hannesa2

@hannesa2 did you ever find a solution? I am trying to stand up an Android project using this library as well and have run in the the exact same issues that you described above.

cormacstewart14 avatar Feb 17 '25 15:02 cormacstewart14

@cormacstewart14 Unfortunately no, I assume its an UDP issue. At least some google issues are pointing to this. In my point of view an Android sample is missing here which tests it. My current state is this https://github.com/hannesa2/OSC-android-server but till now I failed

hannesa2 avatar Feb 17 '25 15:02 hannesa2

@hannesa2 thanks for the reply... I think forking the repo could get it working but that isn't ideal

cormacstewart14 avatar Feb 17 '25 15:02 cormacstewart14

What would be the ideal working situation, how can I help ?

hannesa2 avatar Feb 17 '25 15:02 hannesa2