hello i'm try to use Face++ api for face detect and recognition with b4a with the following code:
#Region Project Attributes
#ApplicationLabel: MyFace
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim hc As HttpJob
Dim ApiUrl, ApiKey,ApiSecret As String
End Sub
Sub globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
ApiKey = ""
ApiSecret = ""
ApiUrl = "http://apius.faceplusplus.com/v2/detection/detect"
' https://apius.faceplusplus.com/v2/detection/detect
' ?api_secret=XXXXXX&api_key=XXXXXX&attribute=gender,age&img[POST]=1.jpg
If FirstTime Then
hc.initialize("hc",Me)
End If
Activity.LoadLayout("main")
hc.Poststring(ApiUrl,"&api_key="&ApiKey&"&api_secret="&ApiSecret&"&url="&File.Combine(File.DirRootExternal,"1.jpg"))
End Sub
Sub jobdone(Job As HttpJob)
Dim res As String
Dim parser As JSONParser
If Job.Success=True Then
res = Job.GetString
Log("Response from server: " & res)
Else
End If
Job.Release
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
the job.success never fire
were i wrong ?
Thanks
#Region Project Attributes
#ApplicationLabel: MyFace
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim hc As HttpJob
Dim ApiUrl, ApiKey,ApiSecret As String
End Sub
Sub globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
ApiKey = ""
ApiSecret = ""
ApiUrl = "http://apius.faceplusplus.com/v2/detection/detect"
' https://apius.faceplusplus.com/v2/detection/detect
' ?api_secret=XXXXXX&api_key=XXXXXX&attribute=gender,age&img[POST]=1.jpg
If FirstTime Then
hc.initialize("hc",Me)
End If
Activity.LoadLayout("main")
hc.Poststring(ApiUrl,"&api_key="&ApiKey&"&api_secret="&ApiSecret&"&url="&File.Combine(File.DirRootExternal,"1.jpg"))
End Sub
Sub jobdone(Job As HttpJob)
Dim res As String
Dim parser As JSONParser
If Job.Success=True Then
res = Job.GetString
Log("Response from server: " & res)
Else
End If
Job.Release
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
the job.success never fire
were i wrong ?
Thanks