Android Question How to invoke an API

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi Eril,

I am now a member.Just trying to get the hang of B4A to convert my library for android. Pls tell me how to call API and get the response in a variable.Following is the API.
http://59.161.167.52/api/[email protected]&user=" & sUser & ":" & sPwd & "&senderID=" & sSenderID & "&receipientno=" & sNo & "&msgtxt=" & sMsg & "&state=4"

Thanks
 

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi,
I tried this way it say connection refused.
Error: org.apache.http.conn.HttpHostConnectException: Connection to http://59.162.167.52 refused
I have supplied each variable a value in key value pair.

Sub Button1_Click
Dim job1 As HttpJob
job1.Initialize(job1,Me)
job1.Download2("http://59.162.167.xx/api/MessageCompose", Array As String("admin", "xx" , "user", "xx:xx","senderID","STVPSB","receipientno","9827973052","msgtxt","This is a test msg from App","state","4"))

This is an API which i use to send SMS from VB.Net.It goes smoothly. No username or pwd required other than this.

Pls guide me.
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
It seems like some network problem. Are you testing it on a real device? Is the device connected to the internet?


I m trying with USB Debugging, There is no network problem.
I thought this would be pretty straightforward.
Is there any way to create Microsoft.xmlHTTP object so i can use Send method as in VB.Net

Juzer
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
I m trying with USB Debugging, There is no network problem.
I thought this would be pretty straightforward.
Is there any way to create Microsoft.xmlHTTP object so i can use Send method as in VB.Net

Juzer
Hi Erel,

Sorry.....,My internet was loosing network intermittently.
Now its working ok.Internet was the problem.

Thanks

Juzer
 
Upvote 0
Top