Skip to content

Update BridgeController.java #14

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Langerz82
Copy link

Not sure if this will work or not. :S

@NVentimiglia
Copy link
Owner

Ok, Will need this to be tested as well as an IOS and Win implementation

FIxed to get the port via the 2nd ":" delimeter.
@Langerz82
Copy link
Author

I'm having trouble finding out how to pass the port for SocketRocket.

@NVentimiglia
Copy link
Owner

Reading the documentation I could not find anything specific, but, it is mentioned in the docs that the test server runs on port 9900, so I think it is supported.

My gut says we should try manually adding it to the NSURL here

https://github.com/NVentimiglia/Websockets.PCL/blob/master/Websockets.Ios/WebsocketConnection.cs#L43

e.g.

_client = new WebSocket(new NSUrl(url+":"+port));

If not, lets open a ticket with them.

@Langerz82
Copy link
Author

Hello,

How do I compile the project for testing? Under 2015 I tried to do a
clean compile but receive the following errors which I'm not sure how to
fix.
If you could help me compile I can test the changes for different ports
under my project.
Kind regards,
Josh L.

On 9/1/2016 1:51 PM, Nicholas Ventimiglia wrote:

Reading the documentation I could not find anything specific, but, it
is mentioned in the docs that the test server runs on port 9900, so I
think it is supported.

My gut says we should try manually adding it to the NSURL here

https://github.com/NVentimiglia/Websockets.PCL/blob/master/Websockets.Ios/WebsocketConnection.cs#L43

e.g.

_client = new WebSocket(new NSUrl(url+":"+port));

If not, lets open a ticket with them.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#14 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJEYzdB5qqgKZPlQN9peCiPbaiG-JgWJks5qlkuvgaJpZM4JxN0T.

@NVentimiglia
Copy link
Owner

what errors ?

@Langerz82
Copy link
Author

Hello,

Maybe the image did not show, ill attach it to this message.

Kind regards,

Josh L.

On 9/3/2016 1:15 AM, Nicholas Ventimiglia wrote:

what errors ?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#14 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJEYzZNq3902tCim1B4RffHbftSn7RHpks5qmD2RgaJpZM4JxN0T.

@Langerz82
Copy link
Author

Sorry here is the image link:
errors

@NVentimiglia
Copy link
Owner

Looks like you are missing a reference, are if referencing to the common library ?

@Langerz82
Copy link
Author

Is there a file called: "Websockets.DroidBridge.BridgeController.cs" that's missing from the source?

@NVentimiglia
Copy link
Owner

Yes, it is imported from the Java Jar file from the binding library.
https://github.com/NVentimiglia/Websockets.PCL/tree/master/Websockets.Droid/Jars

@Langerz82
Copy link
Author

how do I get the BridgeController file from it? Sorry I'm new to this.

@NVentimiglia
Copy link
Owner

Its a binding library, so it should be generated when that project is built

https://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/

@Langerz82
Copy link
Author

Looking at the compile output this error is occurring:
JARTOXML : warning J2XA006: missing class error was raised while reflecting websockets.DroidBridge.BridgeController : android/os/Handler : Unsupported major.minor version 52.0
Do you use Java 1.7 jdk or Java 1.8 jdk?

@Langerz82
Copy link
Author

more debug info these are the commands it runs prior to that error:
C:\Program Files (x86)\Java\jdk1.7.0_71\bin\java.exe -XX:-UseSplitVerifier -jar "C:\Program Files (x86)\MSBuild\Xamarin\Android\jar2xml.jar" --jar=C:\Users\joslan\Downloads\Websockets.PCL-master\Websockets.Droid\Jars\Websockets.DroidBridge.jar --ref=D:\AndroidSDK2\platforms\android-24\android.jar --out=C:\Users\joslan\Downloads\Websockets.PCL-master\Websockets.Droid\obj\Release\api.xml --ref=C:\Users\joslan\Downloads\Websockets.PCL-master\Websockets.Droid\Jars\androidasync-2.1.6.jar (TaskId:138)

@Langerz82
Copy link
Author

The error is because it's calling version 24 of the Android SDK build-tools. How do I set it to call version 23 instead?

@Langerz82
Copy link
Author

I got it compiled I had to rename the android sdk 24 to "24~" so it fell back to version 23 when compiling.

@NVentimiglia
Copy link
Owner

Look, I would love to help more. Normally, I would jump on this and try to directly implement the feature. Right now, I cant due to other responsibilities. If you want to continue with this I would suggest reading through the code... CS, Java, and Objective C. Also reading through the frameworks I am using... Xamarin, SocketRocket, and Android Async. I think this might be a little much for someone new to these environments.

@Langerz82
Copy link
Author

Langerz82 commented Sep 5, 2016

I got compiling working fine for the Solution Part. Whats the easiest way to compile Websockets.DroidBridge.jar? I used the command line to compile it to classes then a jar file but it does not work. Do you compile with the iml file as input?
I'm sorry that I am so persistent this library is part of a major project to finish my IT degree so I'm extremely determined to get it working with non-standard ports and cross-platform.

edit:
Hey man all good I figured out how to use IDEA and can compile Websockets.DroidBridge.jar please ignore the message.

@NVentimiglia
Copy link
Owner

No worries,

The Java project is located here.
https://github.com/NVentimiglia/Websockets.PCL/tree/master/Websockets.DroidBridge
I used IntelliJ to produce the 'artifact'. Once placed into the BindingLibrary/Jar folder visual studio takes over and produces the C# proxy class for communicating with java. Inside the Java bridge, we are using AndroidAsync to communicate with the socket.

@kolbma
Copy link
Contributor

kolbma commented Oct 1, 2017

Why you'd like to handle the port in BridgeController?
There would be a bug on https connections. The port is by default 443 and not 80 and there is no dedictated port information from url available.
But nevertheless... why do you need this???
The port is in Url and it is used!
My tests work out of the box against a local WebsocketEcho server running on different ports.

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

Successfully merging this pull request may close these issues.

3 participants