Http error connecting to the WAMP server - php

I am getting this error when I am trying a make a httppost call from my Android app to WAMP server for log in validation. I am using android phone for the debugging
NafHttpAuthStrategyDefault(10430): (thUse=67032) It is impossible to support GBA now (many possible reasons: no Android Context, current client is GBA service, etc.), then it will be just usual HTTP.
Any suggestion please......

Related

AWS EC2 server refusing Ionic/Capacitor/Android connections to PHP files

I have recently begun building an Angular Ionic app which connects to PHP scripts on an AWS EC2 server. Everything works fine except for when I try to connect through Android once the app is built on my phone.
The response is a simple 404 response with no additional information. When I look at the log on Android Studio I see the following response:
E/Capacitor: Unable to open asset URL: [api address]
I have reduced both the HttpClient call on the frontend and the php file on the backend to their most simple forms and yet still nothing:
<?php
echo "Hello";
?>
I know that Capacitor was updated to 3 only a couple of months ago and am concerned that it is related to that. I am using PHP 7.
UPDATE
The issue was indeed cleartext but the issue was made more complicated by the fact that HttpClient was not catching the error and so I was simply getting back an unknown failed response.
In order to first see that it was cleartext I first had to change HttpClient for the Native HTTP plugin and check the logs whilst testing on my phone (HTTP will not work through the browser).
Only then did I notice that I hadn't changed the config file correctly.
As long as your PHP web server is not running on the Android device directly trying to connect to localhost / 127.0.0.1 won't work and you need to use another domain / IP your web server is available on and which the Android device can access. You can also check this by simply opening the URL in the browser of the Android device.
If that is not feasible for you you could also use port forwarding via adb to forward a port of your web server to a local port on the Android device.
If you use another domain / IP make sure your web server is not listening to local connections only and is not blocked by a firewall or similar.
Also if you are using an unencrypted connection (i.e. http instead of https) you might need to enable the cleartext config option in you Capacitor config.

Smack connection close during file upload via retrofit

I'm developing an XMPP client on Android using Smack library and Ejabberd as my XMPP server.
so far everything is working good, but whenever Users start uploading large files and sending lots of messages rapidly, their connection got close from server.
I get following from debuger:
connection Closed Error Parser got END_DOCUMENT event
uploading is handled via retrofit library
I checked Ejabberd config, so user are allowed to send messages rapidly and config of php upload server allows large files uploading.
also Ejabberd and php upload server are not in the same host.
I just can't get where the problem is, is it from smack, ejabberd or even android itself.

SOAP web service is not working only for IOS device, it is working in soap ui and Android devices

We changed PHP version to 5.4.45 from 5.4.25 and installed MS SQL Driver on Server. Before server change, everything was working but after server change, I am facing web service issue. Our authentication Soap web service(written in Zend framework1) is not working only for IOS Devices. It is working for Android and from soap UI even we tried multiple times from Android and SOAP UI. It works every time.
if we uninstall the app in IOS device and reinstall then for the first time authentication web service works fine but if we call this service again then we are getting HTML data inside the response body which is not the actual response.
Same input request we are sending from ios and Android device.
Please suggest...
I figured it out. The issue was because of "debug mode". It was set to "true" in development environment. Now I set it to "false" and found web service is working for Android, IOS and from soap UI.

Wamp server connection

I have developed an android app that connect mysql database using php. when making https request to scripts php from other computers located on the same local network no problem, but when trying to request the same scripts from my android phone it gives tcp errors.
There is however a far better solution. You can access your host machine with the IP address "10.0.2.2".
This has been designed in this way by the Android team. So your webserver can perfectly run at localhost and from your Android app you can access it via http://10.0.2.2:8080.
What error do you get? If it's a forbidden error then it could be your httpd config file blocking your android. Can you tell from the error whether the problem is in your android application or a network connectivity error?

Web service PHP + Android application

Using eclipse i create a simple abdroid application which communicate with MYSQL data base using PHP scripts, i start writing my PHP Web Service and i put those files under 'www' of my Wamp server.
in fact Wamp server is using two servers
1.web server ( Apache)
2.Mysql
after doing those steps i run my android application under eclipse ide and i get all things works..
I m trying to understand the process behind all that.
My Android application by runnig send an HTTP request to the PHP web service, then ,the apache Web server in Wamp Server executes the php script and do some oparation on the data base ,after that the result is reterning to the Android application ( the result in Json format), and finaly the application decode the Json object and display the result
is it right? please correcte me if i m wrong
This is correct if you want it to be a simple request-driven web service (such as HTTP in your case).

Categories