Click here to Skip to main content
15,913,939 members
Home / Discussions / Android
   

Android

 
AnswerRe: how to write POST methdod to PHP Pin
sadaiyappan_6-Oct-17 18:54
sadaiyappan_6-Oct-17 18:54 
GeneralRe: how to write POST methdod to PHP Pin
Richard MacCutchan6-Oct-17 22:02
mveRichard MacCutchan6-Oct-17 22:02 
GeneralRe: how to write POST methdod to PHP Pin
sadaiyappan_6-Oct-17 22:05
sadaiyappan_6-Oct-17 22:05 
GeneralRe: how to write POST methdod to PHP Pin
Richard MacCutchan6-Oct-17 22:13
mveRichard MacCutchan6-Oct-17 22:13 
QuestionRe: how to write POST methdod to PHP Pin
David Crow7-Oct-17 14:45
David Crow7-Oct-17 14:45 
QuestionShow a ProgressDialog inside a Fragment that is injected in a Tab Pin
Vimalsoft(Pty) Ltd30-Sep-17 5:54
professionalVimalsoft(Pty) Ltd30-Sep-17 5:54 
QuestionRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
David Crow2-Oct-17 3:09
David Crow2-Oct-17 3:09 
AnswerRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
Vimalsoft(Pty) Ltd2-Oct-17 7:11
professionalVimalsoft(Pty) Ltd2-Oct-17 7:11 
QuestionRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
David Crow2-Oct-17 7:14
David Crow2-Oct-17 7:14 
AnswerRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
Vimalsoft(Pty) Ltd2-Oct-17 7:25
professionalVimalsoft(Pty) Ltd2-Oct-17 7:25 
QuestionRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
David Crow2-Oct-17 7:30
David Crow2-Oct-17 7:30 
AnswerRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
Vimalsoft(Pty) Ltd2-Oct-17 7:37
professionalVimalsoft(Pty) Ltd2-Oct-17 7:37 
QuestionTiming and fragment creation Pin
David Crow29-Sep-17 7:44
David Crow29-Sep-17 7:44 
QuestionAndroid.Content.ActivityNotFoundException: Unable to find explicit activity class Pin
Vimalsoft(Pty) Ltd28-Sep-17 6:43
professionalVimalsoft(Pty) Ltd28-Sep-17 6:43 
SuggestionRe: Android.Content.ActivityNotFoundException: Unable to find explicit activity class Pin
Richard MacCutchan28-Sep-17 9:44
mveRichard MacCutchan28-Sep-17 9:44 
GeneralRe: Android.Content.ActivityNotFoundException: Unable to find explicit activity class Pin
Vimalsoft(Pty) Ltd28-Sep-17 22:44
professionalVimalsoft(Pty) Ltd28-Sep-17 22:44 
GeneralHow are chat application in Android used? Pin
Salfishya Mary28-Sep-17 3:58
Salfishya Mary28-Sep-17 3:58 
GeneralRe: How are chat application in Android used? Pin
Richard MacCutchan28-Sep-17 5:20
mveRichard MacCutchan28-Sep-17 5:20 
GeneralRe: How are chat application in Android used? Pin
Sienna Amelia3-Oct-17 2:07
Sienna Amelia3-Oct-17 2:07 
QuestionSQL server connection in Android Pin
Malashree Halade19-Sep-17 20:26
Malashree Halade19-Sep-17 20:26 
AnswerRe: SQL server connection in Android Pin
Richard MacCutchan19-Sep-17 22:11
mveRichard MacCutchan19-Sep-17 22:11 
AnswerRe: SQL server connection in Android Pin
Vimalsoft(Pty) Ltd25-Sep-17 4:12
professionalVimalsoft(Pty) Ltd25-Sep-17 4:12 
QuestionAccess MySql using php script from Android app.. Pin
Member 1341654718-Sep-17 16:03
Member 1341654718-Sep-17 16:03 
Hello,

I have a super simple php script that runs successfully when I paste the url into a browser (windows, chrome).
(http://xxx.xxx.xxx/myscript.php)

My php code has values hardcoded in it and these values are successfully inserted into mySql database (running on a WAMP).
At this point EVERYTHING is hardcoded in the php.
I appreciate any help, I think I am missing something fundamental (new to android development).


Problem:
I can not access/run this same script from my andoroid app. Do I need to run it async? I simply have the below code in a function that is run when the button is clicked on the phone (using an emulator so phone displays app while I am in debug mode in Android.)

Clues:
It bombs out on the last line. Strangely debug (IOException) value is blank.
Manifest has:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />


*************Code Snippet
URL url;
HttpURLConnection connection = null;
url = new URL("http://xxx.xxx.xxx/myscript.php");
connection = (HttpURLConnection) url.openConnection();
connection.setReadTimeout(3000);
connection.setConnectTimeout(3000);
connection.setRequestMethod("POST");
connection.setDoInput(true);

connection.connect(); <---DIES HERE

************End Code
QuestionRe: Access MySql using php script from Android app.. Pin
David Crow19-Sep-17 9:47
David Crow19-Sep-17 9:47 
AnswerRe: Access MySql using php script from Android app.. Pin
Member 1341654720-Sep-17 16:03
Member 1341654720-Sep-17 16:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.