Click here to Skip to main content
15,867,686 members
Home / Discussions / Android
   

Android

 
AnswerRe: Root SONY XPERIA Pin
Richard MacCutchan1-Feb-19 21:27
mveRichard MacCutchan1-Feb-19 21:27 
GeneralRe: Root SONY XPERIA Pin
Member 141374782-Feb-19 5:37
Member 141374782-Feb-19 5:37 
AnswerRe: android application Pin
Richard MacCutchan2-Jan-19 1:56
mveRichard MacCutchan2-Jan-19 1:56 
QuestionAndroid development Pin
Member 1410247528-Dec-18 1:00
Member 1410247528-Dec-18 1:00 
QuestionRe: Android development Pin
Richard MacCutchan28-Dec-18 1:54
mveRichard MacCutchan28-Dec-18 1:54 
AnswerRe: Android development Pin
Member 1410298328-Dec-18 16:57
Member 1410298328-Dec-18 16:57 
GeneralRe: Android development Pin
Richard MacCutchan28-Dec-18 21:40
mveRichard MacCutchan28-Dec-18 21:40 
AnswerRe: Android development Pin
Mycroft Holmes29-Dec-18 11:34
professionalMycroft Holmes29-Dec-18 11:34 
AnswerRe: Android development Pin
David Crow2-Jan-19 6:16
David Crow2-Jan-19 6:16 
Questionprogress Bar for download manager in android Pin
Member 140819737-Dec-18 23:19
Member 140819737-Dec-18 23:19 
SuggestionRe: progress Bar for download manager in android Pin
David Crow9-Dec-18 13:38
David Crow9-Dec-18 13:38 
QuestionListview item to textview Pin
Member 140794445-Dec-18 20:46
Member 140794445-Dec-18 20:46 
AnswerRe: Listview item to textview Pin
Richard MacCutchan5-Dec-18 22:12
mveRichard MacCutchan5-Dec-18 22:12 
GeneralRe: Listview item to textview Pin
Member 140794445-Dec-18 23:45
Member 140794445-Dec-18 23:45 
GeneralRe: Listview item to textview Pin
Richard MacCutchan6-Dec-18 0:24
mveRichard MacCutchan6-Dec-18 0:24 
QuestionRe: Listview item to textview Pin
David Crow6-Dec-18 4:52
David Crow6-Dec-18 4:52 
QuestionPOSTING DATA FROM ANDROID TO PHP SERVER Pin
Member 1407048128-Nov-18 4:47
Member 1407048128-Nov-18 4:47 
QuestionRe: POSTING DATA FROM ANDROID TO PHP SERVER Pin
David Crow29-Nov-18 17:46
David Crow29-Nov-18 17:46 
AnswerRe: POSTING DATA FROM ANDROID TO PHP SERVER Pin
GiteHrudaya14-Dec-18 0:17
GiteHrudaya14-Dec-18 0:17 
AnswerRe: POSTING DATA FROM ANDROID TO PHP SERVER Pin
GiteHrudaya27-Dec-18 22:31
GiteHrudaya27-Dec-18 22:31 
Android – sending and receiving data from a php page
29
JAN
It is very important for a mobile application to talk to web based applications. There are various scenarios where we need to fetch data from web pages .

The code below will enable your android app to talk to a webpage.

Note : You also need to enable uses permission for internet in the android.manifest file.

<uses-permission
        android:name="android.permission.INTERNET" />
Code for android app


public void postData(String toPost) {
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.URL.com/yourpage.php");

//This is the data to send
String MyName = 'adil'; //any data to send

try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
nameValuePairs.add(new BasicNameValuePair("action", MyName));

httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

// Execute HTTP Post Request

ResponseHandler<String> responseHandler = new BasicResponseHandler();
String response = httpclient.execute(httppost, responseHandler);

//This is the response from a php application
String reverseString = response;
Toast.makeText(this, "response" + reverseString, Toast.LENGTH_LONG).show();

} catch (ClientProtocolException e) {
Toast.makeText(this, "CPE response " + e.toString(), Toast.LENGTH_LONG).show();
// TODO Auto-generated catch block
} catch (IOException e) {
Toast.makeText(this, "IOE response " + e.toString(), Toast.LENGTH_LONG).show();
// TODO Auto-generated catch block
}

}//end postData()

php code

<?php

//code to reverse the string

$reversed = strrev($_POST["action"]);

echo $reversed;

?>

QuestionDetect VPN From Android App Pin
Kevin Marois26-Nov-18 4:04
professionalKevin Marois26-Nov-18 4:04 
AnswerRe: Detect VPN From Android App Pin
Richard MacCutchan26-Nov-18 5:04
mveRichard MacCutchan26-Nov-18 5:04 
GeneralRe: Detect VPN From Android App Pin
Kevin Marois26-Nov-18 5:25
professionalKevin Marois26-Nov-18 5:25 
GeneralRe: Detect VPN From Android App Pin
Richard MacCutchan26-Nov-18 6:53
mveRichard MacCutchan26-Nov-18 6:53 
GeneralRe: Detect VPN From Android App Pin
Kevin Marois26-Nov-18 7:26
professionalKevin Marois26-Nov-18 7:26 

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.