Android Question Android Manifest with okhttp

Discussion in 'Android Questions' started by ashton293, Jul 14, 2015.

  1. ashton293

    ashton293 Member Licensed 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.
     
  2. DonManfred

    DonManfred Expert Licensed User

    did you replaced the new httputils2 too?
     
  3. ashton293

    ashton293 Member Licensed User

    Yes, I replaced the httputils2 library.

    The version I am using is 2.10.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Not sure what prints this line. Maybe a Log command was left in the library by mistake. However it is not an error.
     
  5. ashton293

    ashton293 Member Licensed User

    Thanks Erel.

    I will disregard it then.
     
  6. ashton293

    ashton293 Member Licensed 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.
     

    Attached Files:

  7. DonManfred

    DonManfred Expert Licensed User

    upload a small project which shows the problem...
     
  8. ashton293

    ashton293 Member Licensed 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.
     

    Attached Files:

  9. DonManfred

    DonManfred Expert Licensed User

    With sample upload i mean your SOURCE-Code, not the apk....
    In the IDE File -> Export as zip
     
  10. ashton293

    ashton293 Member Licensed User

    Sorry - this time.
     

    Attached Files:

  11. DonManfred

    DonManfred Expert Licensed User

    The referenced url does not exists...

     
  12. DonManfred

    DonManfred Expert Licensed User

  13. ashton293

    ashton293 Member Licensed User

    I am sorry Manfred but it does exist....

    I just typed this [http://69.28.199.180/~austr023/httputils2test.php] into the address line on a webpage and i received a response from the server.

    I think that indicates the address exists and the simple php file works as well.

    Would i be right?
     
  14. DonManfred

    DonManfred Expert Licensed User

    Remove the line
    Code:
    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

    [​IMG]
     
    Last edited: Jul 17, 2015
  15. DonManfred

    DonManfred Expert Licensed User

    THIS link works... in the sample you uploaded was a reference to

    httputilstest.php

    but it should have been httputils2test.php

    http://69.28.199.180/~austr023/httputils2test.php works (ok, with warning about the mysqli-command)
     
  16. ashton293

    ashton293 Member Licensed 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.
     
  17. DonManfred

    DonManfred Expert Licensed User

    See my answer in post #15

    I´ve uploaded your php-script to my webspace to test it...

    Here the working example

    http://snapshots.basic4android.de/ashton.zip
     
    lemonisdead likes this.
  18. ashton293

    ashton293 Member Licensed 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.
     
  19. DonManfred

    DonManfred Expert Licensed User

    If it does not work:

    Try to create a test project showing the problem and upload the example for this one... File Export as zip
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice