Android Question Error using Visual Studio WEB API

I am using B4A for android developing and Visual Studio WEB API that return JSON to create web service
But I got error while compiling the code :


These are the error messages
Compiling generated Java code. Error
B4A line: 108
hc.Execute(req, TaskId)
javac 1.8.0_144
src\b4a\example\main.java:413: error: cannot access ClientProtocolException
_hc.Execute(processBA,_req,_taskid);
^
class file for org.apache.http.client.ClientProtocolException not found


My Web API can be accessed by using this command URL on browser and return JSON

http://localhost:57750/api/Nuser/002/JK1.ACMHAD/password/_/_/_

While 002/JK1.ACMHAD/password/_/_/_ are the parameters


And the code in B4A is :

Sub cmdLogin_Click
If txtUserName.Text = "" Or txtPassword.Text="" Then
Msgbox("Username and Password cant be empty!","Peringatan")
Else
ExecuteRemoteQuery("002/" & txtUserName.text & "/" & txtPassword.text & "/_/_/_", GlobalLoginUser)
End If
End Sub

Sub ExecuteRemoteQuery(Parameters As String, TaskId As Int)
Dim req As HttpRequest
Dim a As String
req.InitializePost2("http://10.102.4.149:8040/api/Nuser/" & Parameters, a.GetBytes("UTF8"))
hc.Execute(req, TaskId)
End Sub


Please help.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
?? I dont understand

Libraries does not have a "Setup"... The files (usually a jar and a xml file) must be copied to the Additional Library folder. In this case, okhttp, it is already inside the B4A installation if you are using a actual version of B4A.

It is the library okhttp and okhttputils inside the library tab.
 
Upvote 0
Top