Closed dmtrlbdv1 closed 9 years ago
I am sorry - I forget to add... I try to connect from the android (device and emulator), if it important
Your code is correct. Does your android app have the internet permission?
Yes, internet permission is set ( as I said my localhost is available form my app ). May be I do not set some dependencies in gradle ? ( maven repository have set in another gradle file ) Or may be I need make some steps to connect to wss server ? I tried withSslContext(SslContext.newClientContext(InsecureTrustManagerFactory.INSTANCE)) - but nothing changed.
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '21.1.2'
defaultConfig {
applicationId "...."
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
android {
packagingOptions {
exclude 'META-INF/io.netty.versions.properties'
exclude 'META-INF/INDEX.LIST'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.android.support:support-v4:22.1.0'
compile 'ws.wamp.jawampa:jawampa:0.2.0'
}
Sorry, can't help you regarding Android configuration as I have no experience with that. In #21 there was a discussion about the correct settings for Proguard, maybe you have a problem with that. @jrogers also build an example for android, maybe this helps: https://github.com/jrogers/AndroidWampExample
If you want to debug why the connection fails you could put breakpoints in the associated Netty Channel Handlers for the connection (e.g. in WampClientWebsocketHandler
, WebSocketClientProtocolHandler
, WebSocketClientProtocolHandshakeHandler
, WebSocketClientHandshaker08
). Sorry - currently don't have time to investigate that deeper myself.
Thank you. I found nexus 7 (5.0) and tried to start my app on it - all working! I do not understand why samsung galaxy s not allow me to connect. I hope it is just certificates issue or something and my server will be working without problems.
I am trying to open connection to the server and now I have an issue with it. If it local started crossbar.io server - I am able to connect to it, but I am can't connect to any internet server ( for example wss://demo.crossbar.io/ws ). In this case only cycled disconnect-connection states. What I am doing incorrect ?
try { // Create a builder and configure the client WampClientBuilder builder = new WampClientBuilder();
// builder.withUri("ws://192.168.1.39:8282/ws") builder.withUri("wss://demo.crossbar.io/ws") .withRealm("realm1") .withInfiniteReconnects() .withReconnectInterval(5, TimeUnit.SECONDS); // Create a client through the builder. This will not immediatly start // a connection attempt client = builder.build();