i found this
error log
line 36 is Log("File size: " & Response.ContentLength)
it is not working for me , any other way ?
B4X:
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
hc.Initialize("hc")
End If
Dim req As HttpRequest
req.InitializeHead("http://download.thinkbroadband.com/5MB.zip")
hc.Execute(req, 1)
End Sub
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Log("File size: " & Response.ContentLength)
Response.Release
End Sub
Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
Log("error: " & StatusCode)
Response.Release
End Sub
error log
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 36 (Main)
java.lang.NullPointerException
at anywheresoftware.b4a.http.HttpClientWrapper$HttpResponeWrapper.getContentLength(HttpClientWrapper.java:543)
at b4a.example.main._hc_responsesuccess(main.java:406)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:302)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at anywheresoftware.b4a.BA$3.run(BA.java:334)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Pause, UserClosed = true **
line 36 is Log("File size: " & Response.ContentLength)
it is not working for me , any other way ?
Last edited: