Skip to content
Advertisement

Android Studio php connection

I’m trying to get information from db using php in android studio java. The php code works 100%. The problems is that when I open the app from the Android emulator the app closes itself almost instantly.

JavaScript

This is the error message I get in run Logcat is empty The Build is also error-less From what I see there is a problem in the onPostExecute so let me show you how it looks

I have a class

JavaScript

in it I have two functions:

JavaScript

and

JavaScript

Edit: About the db connection I made it so it displays me all it reads in the file just to be sure and this is what is says

JavaScript

My PHP code:

JavaScript

Advertisement

Answer

I fixed the problem. So actually I double checked the error log and found it had something to do with apache library I searched the error and found I had to add it to AndroidManifest.xml too it should look like this:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement