Android Question Android Manifest with okhttp

ashton293

Member
Licensed User
Longtime User
Yesterday, I uploaded Okhttp and httputils2 v2.1.

Since that time I have been receiving the following message in my logs:

"(Intent) Intent { cmp=b4a.package/anywheresoftware.b4a.samples.httputils2.httputils2service }"

Do I need to make changes to my android manifest because of okhttp?

Does this message suggest I need to make changes to the android manifest?

Thank you.
 

ashton293

Member
Licensed User
Longtime User
I am still having issues with an app since changing to Okhttp and the updated Httputils2.

This module was working with the prior version of Httputils2.

I have found that Job.Success is now always producing a fail.

The response is coming from a php file on an external server.

I have gone through that php file and eliminated [ by commenting out] all echo json_encode lines which may respond to the app - previously it was returning arrays which satisfied certain conditions.

When it is:
a] returning an array
b] not returning anything at all
c] or returning a response with status = 1 and message = "data sent"

I have the same response - ie job.Success fails.

I have made job.Success=false to see what is causing "jobdone" to fail. I receive the following error message:

"
modulename_jobdone (java line: 856)

java.io.FileNotFoundException: /data/data/b4a.packagename/cache: open failed: EISDIR (Is a directory)

at libcore.io.IoBridge.open(IoBridge.java:416)

at java.io.FileInputStream.<init>(FileInputStream.java:78)

at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:209)

at anywheresoftware.b4a.samples.httputils2.httpjob._getstring2(httpjob.java:167)

at anywheresoftware.b4a.samples.httputils2.httpjob._getstring(httpjob.java:156)

at b4a.packagename.modulename._jobdone(modulename.java:856)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:511)

at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)

at anywheresoftware.b4a.keywords.Common$5.run(Common.java:981)

at android.os.Handler.handleCallback(Handler.java:615)

at android.os.Handler.dispatchMessage(Handler.java:92)

at android.os.Looper.loop(Looper.java:137)

at android.app.ActivityThread.main(ActivityThread.java:4745)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:511)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)

at dalvik.system.NativeStart.main(Native Method)

Caused by: libcore.io.ErrnoException: open failed: EISDIR (Is a directory)

at libcore.io.IoBridge.open(IoBridge.java:405)

... 18 more

java.io.FileNotFoundException: /data/data/b4a.packagename/cache: open failed: EISDIR (Is a directory)

"

I have also put Log markers in the Jobdone subroutine and found the problem is at the line

res=job.getstring

ie the program doesn't go past this line.


The Log is attached as a file.

I would appreciate any assistance.
 

Attachments

  • Logcat httputils2.txt
    2.5 KB · Views: 160
Upvote 0

ashton293

Member
Licensed User
Longtime User
Hi Manfred,

I have attached a small project and a simple php file for this error.

You will note I have a "Dim job as Httpjob" in the Jobdone subroutine as it does produce different error results.

When working on the larger project I had solved the "Doctype html PUBLIC..." error but I have left it there in this project because it has been one of the issues since I uploaded Okhttp and the new Httputils2.

I hope this helps.

Thank you for your assistance - it is appreciated.
 

Attachments

  • HttpUtils2test.apk
    290.9 KB · Views: 126
  • httputilstestphp.txt
    455 bytes · Views: 109
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The referenced url does not exists...

 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Remove the line
B4X:
    Dim job As HttpJob
from sub JobDone! it is causing the problem...

Jobdone gets an already initialized job as PARAMETER... USE this job-Reference inside the sub instead of dimming a NEW JOB with the same name (which overwrites the given parameter Job to this sub and the new job will have NO result-content in it...) in Jobdone

 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

ashton293

Member
Licensed User
Longtime User
I am afraid that I am still getting the same issues... the 404 error [ and I just tried posting into the address line in the browser and it worked again] and consequently the Job.Success wasn't True then when I make Job.Success= False I receive an ENOENT error.

It is the same that i have been seeing for the last day and a half - I either get the EISDIR error or the ENOENT error and the error depends on whether I have the Dim job as HttpJob in the Jobdone subroutine or not.

Any ideas why I can get a response by typing an address into the browser but the app can't get a response?


Apologies the posts crossed.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

ashton293

Member
Licensed User
Longtime User
Thank you for finding such an obvious mistake.

In the app I am working on I have php file names that are similarly spelled - I may change the spelling so they are less similar and see if that solves the problem there.

Thanks again.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…