I\'m trying to bring SignalR into my Android Studio project.
I successfully followed the tutorial on getting started with SignalR,
I got this working with just Android Studio and the files from the GitHub project.
Here's what I had to do, for posterity's sake.
signalr-client-sdk-android-debug.aar
in java-client\signalr-client-sdk-android\build\outputs\aar
signalr-client-sdk.jar
in java-client\signalr-client-sdk\build\libs
libs
folder of your app.build.gradle
and add:repositories {
flatDir{
dirs 'libs'
}
}
dependencies {
compile 'com.google.code.gson:gson:2.3.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name: 'signalr-client-sdk-android-release', ext: 'aar')
}
Tools, Android, Sync Project with Gradle Files, and when that was successful I did a Build.
Then finally, this line of code gave me the ALT+Enter prompt to generate the import
s for this line of code:
Platform.loadPlatformComponent(new AndroidPlatformComponent());
which gave me:
import microsoft.aspnet.signalr.client.Platform;
import microsoft.aspnet.signalr.client.http.android.AndroidPlatformComponent;
Whew!
I also got this working with just Android Studio and the files from the GitHub project but my gradle dependencies are set like this:
implementation files('libs/signalr-client-sdk.jar')
implementation files('libs/signalr-client-sdk-android.aar')
Well you can download the jar files from this link
Step 1
Create a libs folder inside your package and simply paste these jar files here.
Step 2
Now add "compile files" inside dependencies of build.gradle
Now after this press "Sync Project with Gradle file"
Step 3
Even after syncing and importing jar successfully you still face some import errors etc. Now try Invalidate cache and restart.After couple of times it will be fine and imports all the classes
Step 4
Now you will see the imports for Platform.loadPlatformComponent(); without any problems