-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
394 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 26 | ||
buildToolsVersion "26.0.1" | ||
|
||
|
||
defaultConfig { | ||
minSdkVersion 16 | ||
targetSdkVersion 26 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation 'org.java-websocket:Java-WebSocket:1.3.4' | ||
implementation 'com.google.code.gson:gson:2.8.1' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.smartarmenia.dotnetcoresignalrclientjava" /> |
17 changes: 17 additions & 0 deletions
17
...rclientjava/src/main/java/com/smartarmenia/dotnetcoresignalrclientjava/HubConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.smartarmenia.dotnetcoresignalrclientjava; | ||
|
||
public interface HubConnection { | ||
void connect(String authHeader); | ||
|
||
void disconnect(); | ||
|
||
void addListener(HubConnectionListener listener); | ||
|
||
void removeListener(HubConnectionListener listener); | ||
|
||
void subscribeToEvent(String eventName, HubEventListener eventListener); | ||
|
||
void unSubscribeFromEvent(String eventName, HubEventListener eventListener); | ||
|
||
void invoke(String event, Object... parameters); | ||
} |
11 changes: 11 additions & 0 deletions
11
...ava/src/main/java/com/smartarmenia/dotnetcoresignalrclientjava/HubConnectionListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.smartarmenia.dotnetcoresignalrclientjava; | ||
|
||
public interface HubConnectionListener { | ||
void onConnected(); | ||
|
||
void onDisconnected(); | ||
|
||
void onMessage(HubMessage message); | ||
|
||
void onError(Exception exception); | ||
} |
5 changes: 5 additions & 0 deletions
5
...ientjava/src/main/java/com/smartarmenia/dotnetcoresignalrclientjava/HubEventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.smartarmenia.dotnetcoresignalrclientjava; | ||
|
||
public interface HubEventListener { | ||
void onEventMessage(HubMessage message); | ||
} |
39 changes: 39 additions & 0 deletions
39
...nalrclientjava/src/main/java/com/smartarmenia/dotnetcoresignalrclientjava/HubMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.smartarmenia.dotnetcoresignalrclientjava; | ||
|
||
import com.google.gson.JsonElement; | ||
|
||
public class HubMessage { | ||
private String invocationId = ""; | ||
private String target = ""; | ||
private JsonElement[] arguments; | ||
|
||
public HubMessage(String invocationId, String target, JsonElement[] arguments) { | ||
this.invocationId = invocationId; | ||
this.target = target; | ||
this.arguments = arguments; | ||
} | ||
|
||
public String getInvocationId() { | ||
return invocationId; | ||
} | ||
|
||
public void setInvocationId(String invocationId) { | ||
this.invocationId = invocationId; | ||
} | ||
|
||
public String getTarget() { | ||
return target; | ||
} | ||
|
||
public void setTarget(String target) { | ||
this.target = target; | ||
} | ||
|
||
public JsonElement[] getArguments() { | ||
return arguments; | ||
} | ||
|
||
public void setArguments(JsonElement[] arguments) { | ||
this.arguments = arguments; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...clientjava/src/main/java/com/smartarmenia/dotnetcoresignalrclientjava/SignalRMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.smartarmenia.dotnetcoresignalrclientjava; | ||
|
||
import com.google.gson.JsonElement; | ||
|
||
public class SignalRMessage { | ||
private String invocationId; | ||
private Integer type; | ||
private String target; | ||
private Boolean nonBlocking; | ||
private JsonElement[] arguments; | ||
|
||
public String getInvocationId() { | ||
return invocationId; | ||
} | ||
|
||
public void setInvocationId(String invocationId) { | ||
this.invocationId = invocationId; | ||
} | ||
|
||
public Integer getType() { | ||
return type; | ||
} | ||
|
||
public void setType(Integer type) { | ||
this.type = type; | ||
} | ||
|
||
public String getTarget() { | ||
return target; | ||
} | ||
|
||
public void setTarget(String target) { | ||
this.target = target; | ||
} | ||
|
||
public Boolean getNonBlocking() { | ||
return nonBlocking; | ||
} | ||
|
||
public void setNonBlocking(Boolean nonBlocking) { | ||
this.nonBlocking = nonBlocking; | ||
} | ||
|
||
public JsonElement[] getArguments() { | ||
return arguments; | ||
} | ||
|
||
public void setArguments(JsonElement[] arguments) { | ||
this.arguments = arguments; | ||
} | ||
} |
Oops, something went wrong.