iOS Question HttpJob Source

MarcoRome

Expert
Licensed User
Longtime User
Hi Erel, All. I see this code in HttpJob Source

B4X:
#if B4A or B4J
    Private taskId As String '<----- WHY HERE YES AND IN B4i NO ?
    Private req As OkHttpRequest
    Public Response As OkHttpResponse
#Else
    Private req As HttpRequest
    Public Response As HttpResponse
#End If

and of course in B4i in this Method i have error.

B4X:
'Get Size
Public Sub GetSize As Long
    Return File.Size(HttpUtils2Service.TempFolder, taskId) '<---- taskId undeclared
End Sub

The question is: Do you have any reason not to declare taskId in B4i ?
Thank you
Marco
 

OliverA

Expert
Licensed User
Longtime User
I'm looking at version 2.7 code, and I don't see a GetSize method. I think taskId is used/referenced in the OkHttp library that B4A/B4J uses. B4i uses a different library.
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
The source is one for B4X ( B4A , B4i, B4J )
https://www.b4x.com/android/forum/threads/b4x-okhttputils2-ihttputils2-httputils2-source-code.82632/

upload_2018-8-30_17-10-31.png
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I downloaded this yesterday to help out a poster (after just having downloaded it a week ago)...
Update: Just downloaded it again. No GetSize
B4X:
B4A=true
Group=Library Modules
ModulesStructureVersion=1
Type=Class
Version=7.28
@EndOfDesignText@
'version 2.70
'Class module
Sub Class_Globals
    Public JobName As String
    Public Success As Boolean
    Public Username, Password As String
    Public ErrorMessage As String
    Private target As Object
#if B4A or B4J
    Private taskId As String
    Private req As OkHttpRequest
    Public Response As OkHttpResponse
#Else
    Private req As HttpRequest
    Public Response As HttpResponse
#End If
    Public Tag As Object
    Type MultipartFileData (Dir As String, FileName As String, KeyName As String, ContentType As String)
#If B4J AND UI
    Private fx As JFX
#End If
End Sub

'Initializes the Job.
'Name - The job's name. Note that the name doesn't need to be unique.
'TargetModule - The activity or service that will handle the JobDone event.
Public Sub Initialize (Name As String, TargetModule As Object)
    JobName = Name
    target = TargetModule
End Sub
'Sends a POST request with the given data as the post data.
Public Sub PostString(Link As String, Text As String)
    PostBytes(Link, Text.GetBytes("UTF8"))
End Sub

'Sends a POST request with the given string as the post data
Public Sub PostBytes(Link As String, Data() As Byte)
    req.InitializePost2(Link, Data)
    CallSubDelayed2(HttpUtils2Service, "SubmitJob", Me)
End Sub
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
I downloaded this yesterday to help out a poster (after just having downloaded it a week ago)...
B4X:
B4A=true
Group=Library Modules
ModulesStructureVersion=1
Type=Class
Version=7.28
@EndOfDesignText@
'version 2.70
'Class module
Sub Class_Globals
    Public JobName As String
    Public Success As Boolean
    Public Username, Password As String
    Public ErrorMessage As String
    Private target As Object
#if B4A or B4J
    Private taskId As String
    Private req As OkHttpRequest
    Public Response As OkHttpResponse
#Else
    Private req As HttpRequest
    Public Response As HttpResponse
#End If
    Public Tag As Object
    Type MultipartFileData (Dir As String, FileName As String, KeyName As String, ContentType As String)
#If B4J AND UI
    Private fx As JFX
#End If
End Sub

'Initializes the Job.
'Name - The job's name. Note that the name doesn't need to be unique.
'TargetModule - The activity or service that will handle the JobDone event.
Public Sub Initialize (Name As String, TargetModule As Object)
    JobName = Name
    target = TargetModule
End Sub
'Sends a POST request with the given data as the post data.
Public Sub PostString(Link As String, Text As String)
    PostBytes(Link, Text.GetBytes("UTF8"))
End Sub

'Sends a POST request with the given string as the post data
Public Sub PostBytes(Link As String, Data() As Byte)
    req.InitializePost2(Link, Data)
    CallSubDelayed2(HttpUtils2Service, "SubmitJob", Me)
End Sub

Mhh...strain thing. Maybe is change code but why the Version is anyway 2.70 ?

I dowload the same in 26.06. Anyway i see the the first post is change in data 9 August. Maybe change code without change Rel ?
Only Erel can answer this question.
Anyway thank @OliverA for your support

upload_2018-8-30_17-21-6.png
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Mhh...strain thing. Maybe is change code but why the Version is anyway 2.70 ?

I dowload the same in 26.06. Anyway i see the the first post is change in data 9 August. Maybe change code without change Rel ?
Only Erel can answer this question.
Anyway thank @OliverA for your support

View attachment 71695
9 August 2017... See last edit
 
Upvote 0
Top