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.
 

DonManfred

Expert
Licensed User
Longtime User
did you replaced the new httputils2 too?
 
Upvote 0

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: 154
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: 125
  • httputilstestphp.txt
    455 bytes · Views: 107
Upvote 0

DonManfred

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

LogCat connected to: 05157df57d72d204
--------- beginning of main
--------- beginning of system
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
(Intent) Intent { cmp=b4a.example/anywheresoftware.b4a.samples.httputils2.httputils2service }
** Service (httputils2service) Start **
(Intent) Intent { cmp=b4a.example/anywheresoftware.b4a.samples.httputils2.httputils2service }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>404 Not Found</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
background-color:#367E8E;
scrollbar-base-color: #005B70;
scrollbar-arrow-color: #F3960B;
scrollbar-DarkShadow-Color: #000000;
color: #FFFFFF;
margin:0;
}
a { color:#021f25; text-decoration:none}
h1 {
font-size: 18px;
color: #FB9802;
padding-bottom: 10px;
background-image: url(sys_cpanel/images/bottombody.jpg);
background-repeat: repeat-x;
padding:5px 0 10px 15px;
margin:0;
}
#body-content p {
padding-left: 25px;
padding-right: 25px;
line-height: 18px;
padding-top: 5px;
padding-bottom: 5px;
}
h2 {
font-size: 14px;
font-weight: bold;
color: #FF9900;
padding-left: 15px;
}
</style>
</head>
<body>
<div id="body-content">
<!-- start content-->
<!--
instead of REQUEST_URI, we could show absolute URL via:
http://HTTP_HOST/REQUEST_URI
but what if its https:// or other protocol?

SERVER_PORT_SECURE doesn't seem to be used
SERVER_PORT logic would break if they use alternate ports
-->
<h1>404 Not Found</h1>
<p>The server can not find the requested page:</p>
<blockquote>
69.28.199.180/~austr023/httputilstest.php?keynumber=12345678&amp;group=1 (port 80)
</blockquote>
<p>
Please forward this error screen to 69.28.199.180's
<a href="mailto:[email protected]?subject=Error message [404] 404 Not Found for 69.28.199.180/~austr023/httputilstest.php?keynumber=12345678&amp;group=1 port 80 on Friday, 17-Jul-2015 22:22:30 AEST">
WebMaster</a>.
</p>
<hr />
<!-- end content -->
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>404 Not Found</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
background-color:#367E8E;
scrollbar-base-color: #005B70;
scrollbar-arrow-color: #F3960B;
scrollbar-DarkShadow-Color: #000000;
color: #FFFFFF;
margin:0;
}
a { color:#021f25; text-decoration:none}
h1 {
font-size: 18px;
color: #FB9802;
padding-bottom: 10px;
background-image: url(sys_cpanel/images/bottombody.jpg);
background-repeat: repeat-x;
padding:5px 0 10px 15px;
margin:0;
}
#body-content p {
padding-left: 25px;
padding-right: 25px;
line-height: 18px;
padding-top: 5px;
padding-bottom: 5px;
}
h2 {
font-size: 14px;
font-weight: bold;
color: #FF9900;
padding-left: 15px;
}
</style>
</head>
<body>
<div id="body-content">
<!-- start content-->
<!--
instead of REQUEST_URI, we could show absolute URL via:
http://HTTP_HOST/REQUEST_URI
but what if its https:// or other protocol?

SERVER_PORT_SECURE doesn't seem to be used
SERVER_PORT logic would break if they use alternate ports
-->
<h1>404 Not Found</h1>
<p>The server can not find the requested page:</p>
<blockquote>
69.28.199.180/~austr023/httputilstest.php (port 80)
</blockquote>
<p>
Please forward this error screen to 69.28.199.180's
<a href="mailto:[email protected]?subject=Error message [404] 404 Not Found for 69.28.199.180/~austr023/httputilstest.php port 80 on Friday, 17-Jul-2015 22:22:30 AEST">
WebMaster</a>.
</p>
<hr />
<!-- end content -->
</div>
</body>
</html>
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
 
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

jobdoneashton001.png
 
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
Top