Convert java.net.URI to android.net.Uri-ThrowExceptions

Exception or error: I am able to find how to convert android.net.Uri to Java.net.URI here but not vice-versa. So after spending some time I figured it out. Here is the solution(If there is another solution then please post that as well) First convert javaURI to string and then use android.net.Uri’s parse function android.net.URI androidUri = …

java – Retrofit – android.os.NetworkOnMainThreadException-ThrowExceptions

Exception or error: I am using Retrofit 2 to get json and parse it to POJO. My purpose is getting one value of that object. compile ‘com.squareup.retrofit2:retrofit:2.0.0-beta4’ compile ‘com.squareup.retrofit2:converter-gson:2.0.0-beta4’ My REST client: public interface MyClient { @GET(“/part1/part2”) Call<MyItem> getMyItem(@Query(“param1”) String param1, @Query(“param2”) String param2, @Query(“param3”) String param3); } Here I found great great tool to …

android – Unable to open debugger port : java.net.SocketException “Socket closed”-ThrowExceptions

Exception or error: I’m using Android Studio, with multiple flavors using Gradle, each with a Debug and Release type, organized as described here, on the bottom half.When I try to start the debugger, I get this error: Error running androidRecover [installAppDebug]: Unable to open debugger port : java.net.SocketException “Socket closed I’m also unable to attach …

proguard – com.google.android.gms.internal.zzhu: can't find referenced class android.security.NetworkSecurityPolicy-ThrowExceptions

Exception or error: I tried to generate an apk using proguard, but I’ve got this error while trying to build: Warning: com.google.android.gms.internal.zzhu: can’t find referenced class android.security.NetworkSecurityPolicy Warning: there were 3 unresolved references to classes or interfaces. You may need to add missing library jars or update their versions. If your code works fine without …

java – OkHttp javax.net.ssl.SSLPeerUnverifiedException: Hostname domain.com not verified-ThrowExceptions

Exception or error: I’ve been trying for days to get this working. I’m trying to connect to my server over https with a self signed certificate. I don’t think there is any pages or examples that I haven’t read by now. What I have done: Created bks keystore by following this tutorial: http://blog.crazybob.org/2010/02/android-trusting-ssl-certificates.html It uses …