I found many post on this but nothing works. I am really desperate...
The root of the problem is that I want to send a custom object(lets call it PolylineAdapter) from a Java server(the Master) to the Android client application. The fact is that if I create two identical PolylineAdapter classes(one on the server and one on the client), I get ClassNotFoundException(when I read the object from the Socket’s ObjectInputStream on the client side) which is rational given the fact that these are two separate classes.
To solve this problem I am considering of packaging the PolylineAdapter class in a jar which I can then import in my Android project and in my server project. The jar will contain exactly the same PolylineAdapter class on both project, so I will not get the exception.
The problem is that the Android Studio won’t recognize my PolylineAdapter class. I tried importing my jar as jar dependency in both IDEA(by JetBrains) and Eclipse and worked well, but Android Studio doesn’t recognize it when I write a statement in the editor. I tried every answer I found(Add as Library, create new module etc.) but nothing worked.