Sending Data From Android?

Jun 2, 2011

I am new in using android.I want to sent the data from android device to php.i have tried but where i am wrong i dont know...can any one correct this..this is the android code that i have done.

public class php_connect extends Activity {
InputStream is;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main1);
JSONObject json = new JSONObject();
try {............

ADVERTISEMENT

Sending Android Data To Script?

Jul 16, 2011

I am developing an application that will involve interaction with a MySQL database whereby the posted data is handled using PHP. From an Android app, i send HttpRequests to a PHP file [at localhost], which creates a connection to a MySQL database and drops some data in a table.

The problem that I am having is that I have installed XAMPP [Apache server, MySQL] but when I start the Apache service, and start the Android application it doesn't fetch any data. What are the best requirements that will help me get out of this mess so that I may connect my Android app to a MySQL database then do some scripting using PHP?

View 1 Replies View Related

Detect Android Phones And Android Tablets Differently Using The User Agent Header?

Oct 17, 2010

For my site I need to be able to tell the difference between when an Android tablet visits and when an Android phone visits. It needs to be detected before the page is sent to the user so using JavaScript to check the screen res isn't an option. At the moment I use this to detect an android device:

stripos($ua, 'android') Is there anything unique thar a tablet has in it's user agent?

View 1 Replies View Related

Sending Notification (few Data) From Server Side App To Android Client Side App?

Jan 3, 2011

How can I send data from my PHP server side App to Android Client Side App in terms of Notification or something else i dont want to use C2DM ,is there any other Alternative.I want to send such data on a particular event happen on server like a new row inserted in some table or existing row deleted by user A but also shared to user B.So i want to notify user B by sending some notification on his mobile.

View 2 Replies View Related

Android Market Web API Or XML

Aug 31, 2010

I am having one php website. where user register and add android application id from android market.e.g. com.GalleryXYZ... I just have to check that whether this id is valid or not on android market? I found below link: [URL] Is android provide any API or XML so that i can check with it.?

View 2 Replies View Related

Android - How To Link Json 100%

May 4, 2010

Im trying to create an rss feed that my droid app reads but i have some holes that i can figure how to fix the json link page is [URL] when reading the json i can see where the icon is missing on some and cant figure out why. mainly only for citys like ney york and chicago(cities with two names) and the code i have for the php is as follows:

[Code....]

View 1 Replies View Related

Send Data To Android Set?

Jul 13, 2011

how to send data from a php page that is open in browser to a particular person who has android set with him.The person is connected to the Internet and me also.i know the person IMEI number.

View 1 Replies View Related

Android - Get Html From Webpage?

Jan 17, 2011

I'm writing an android application that is supposed to get the html from a php page and use the parsed data from thepage. I've searched for this issue on here, and ended up using some code from an example another poster put up. Here is my code so far:

[CODE....]

Like I said before, the url is a php page. Whenever I run this code, it prints out the first first message, but then prints out the error error message and then finally the end end message. I've tried modifying the headers

[CODE....]

View 3 Replies View Related

Encryption Of String In Android SDK

Jan 28, 2011

I need to encrypt String & send to sever which is in php. Below you will find encryption code and function to encrypt it.

[CODE....]

I tried out some classes in android but did not work at all. the functions or classes in android which support this functionality?

View 1 Replies View Related

Do A HTTP Post In Android?

Dec 17, 2010

i am new to android app development, what i need is i have two textbox username and password,it will post to server and check it with the DB using a php page, if the login success then go to next screen else show a msg box showing login error how can i do that?
EDIT

public void postData() {
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("url");
EditText tw =(EditText) findViewById(R.id.EditText01);
try {
// Add your data
List nameValuePairs = new ArrayList(2);
code....

View 3 Replies View Related

Android Frontend Use Backend?

Jun 28, 2010

I'm working on a chess site and I've implemented a rule checker in PHP and I use that on my main site at http:[url]..., but, I'm working on an Android frontend in the meantime. However, after I've added the event and drawing correctly to my project, I would like to use my foo.php from my bar.java, calling the rulechecker to generate slots.

View 4 Replies View Related

Logging Into A Website From Android?

Jan 29, 2011

Basically I have a form in my android app that lets the user enter his/her username and password and then this is POSTED to a very simple login page made in PHP online. I then need to access a second pae which pulls down data from an xml file - in order to access this page the user must be logged in. The xml page that the user sees is dependent of their username.

On my login page I have
session_start();
session_register("username");

At the beginning of each page that checks login I have

<?php
session_start();
?>

and to check if the user is logged in I use a simple if statement if(!session_is_registered("username")){?> display whatever How can I make this work in my android application? I am unable to go to the xml page after I have logged in because it does not recognise me as being logged in.

View 5 Replies View Related

Fastest Communication Between A Android?

Apr 1, 2011

Im building a android application that requires data from a PHP server. Lets say i have a text input on my web application. Whenever the users trigger a "onkeydown" i want to send the character to the Android application and my Android application will just output the current character. The web application will constantly send small "commands" to myAandroid application. I would like to know what is the fastest possible way to receive those send / receive those commands.

I see a few options on how this could be implemented.

1) My android application constantly polls the server to see if a message has been written.

2) My Android application would setup a socket server that the PHP script would connect and push the message to.

3) I guess this is extremely slow and inaccurate, but i guess i could use push notifications.

Is there any other alternatives ? and what would be the best solution?.

View 1 Replies View Related

IPhone And Android GPS Coordinates ?

Mar 23, 2010

I'm am curently doing an application with Google Maps, where I am checking the position of the user with the javascript API, but I would like to know if there is a way to check the GPS variables in a PHP file ?Some kind of GET parameter, but it seems nothing like that exists.

View 1 Replies View Related

Xml - Get Version From Android .apk File?

Jun 10, 2010

I am trying to create PHP script to get app version from Android APK file. Extracting xml file from APK (zip) file and then parsing XML is one way, but i guess it should be simpler. Something like PHP Manual, example #3.

View 1 Replies View Related

Sending Mail: Choice Between Sending Receipt, Or HTML Formatting

Jan 6, 2007

I'm using PHP's mail function to send out a message via email.

I would like for this email message to send a receipt when read as well as send an HTML formatted email. Both aspects are important to me.

I know this is a product of the mail header. This is the format I currently have:

mail(to, subject, body, "From: name <email>
Disposition-Notification-To: name<email>
Content-type:text/html;charset=utf-8");

This prompts the email program to send a reciept, but the email message is not in the HTML format, and even contains "Content-type:text/html;charset=utf-8" at the top of the body.

If I switch the order to this format:

mail(to, subject, body, "From: name <email>
Content-type:text/html;charset=utf-8
Disposition-Notification-To: name<email>");

This sends the email with HTML formatting but does not prompt the sending of the receipt. I also get "Disposition-Notification-To: name<email>" at the top of the email message.

This tells me there is a problem in the transition between the headers, which currently is "".

What am I doing wrong?

View 1 Replies View Related

Eserve Using Php An Upload From Android Device?

Jul 7, 2011

i am new in android, but checking the web, and some books i make an app that must send an image and two more params. I just want to make a php serve script that checks if the data was uploaded/sent fine.So this is my code:

public void executeMultipartPost() //throws Exception
{
try {

[code]...

View 1 Replies View Related

Apache - Connect Android To Database

May 31, 2010

I am doing a school project where we need to create an android application which needs to connect to a database. the application needs to gain and store information for people's profiles on the database. But unfortunatly we are a little bit stuck at this point because there are numerous ways to link the application such as http request through apache or through the SOAP/REST protocol.

View 2 Replies View Related

Android - Get Mobile Devices Location?

Feb 28, 2011

I am wondering if there is a way to get the current location from a mobile device in PHP? By current location I mean the last known location.

View 2 Replies View Related

Get Android Application Login To A Server?

Apr 3, 2011

I want to ask about the best way to let an Android application log in to a server (PHP). Do I have to use a session? I want to log in and send some information to the server and save that information in the database.

I currently use this:

HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(path);

And then use JSON to send the data. I want a good way to verify the Android app identity to my server page.

View 2 Replies View Related

Change Name Of Via Text / Android / Facebook - Allow One Name For Each?

Nov 19, 2010

i was wondering when you update a status using twitter api, can i change the name of the via text, i.e. via android, or via facebook, or deos twitter only allow one name for each app

View 2 Replies View Related

Android - Use The Json_decode/json_encode In Script?

Jun 22, 2011

I am trying to pass the username/password from android and checking the value in MySQL through PHP. While using json_decode and json_encode, json_decode works but json_encode doesnot work.But when i remove the json_decode json_encode works but i want both of them to work in my program.

Here is my code:

$a=$_POST['userpwd_value']; //accesing value from android
$b=json_decode($a); //decoding android value using JSON
$username=$b->{'username'}; //assigning username from android to a variable
$password=$b->{'password'};//assigning password from android to a variable................

View 3 Replies View Related

Send A Data In Web Server From Android?

Apr 14, 2011

i want to send a data to my php page using android

View 4 Replies View Related

Android - Webservice Is Always Returning A Value Of Null?

Jul 13, 2011

I was playing around with code that I found here. The I can only get my database to return a null json object. Here is my code.

public class TableTalkSplash extends Activity {
private InputStream is;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);................

I have an apache webserver currently running a website and the .php file is in the same directory as the index.html file. I have a mySQL database that is running on the same box as the apache server. I really know very little about databases, but I do know that when I run SELECT * FROM dinner_info WHERE row_id = 1; It returns the correct information. So I am guessing my error is in the php. I've tried to replace the "host" with localhost and "username" with my username and "password" with my password. Any Ideas? if you need more information let me know

View 1 Replies View Related

Android - Connect App To Server On Localhost?

Apr 19, 2011

how can i connect an android app (on my phone) to a php server (EasyPHP) that i am running on my machine (localhost). Are there any tutorials out there that document this. I need to test the app on an actual phone not an emulator (because the emulator contains bugs for certain activities).

View 2 Replies View Related

Native Android App Authenticate With Web Backend?

Sep 9, 2010

I'm working on developing a native android application to retrieve data for a user from my company's website. Because the data is specific to the user, I need to authenticate with our web server, but I'm unsure of the best way to go about this. I've been reading about REST/SOAP/HTML form auth, but I can't really find any definite 'this is how its done' anywhere. I know mobile apps do this kind of thing all the time - just look at facebook/skype/any email app - you have to login before you can do anything.

My question is - how should I architect the server side code (php) to easily allow me to authenticate a user from my android device? I'm fairly new to the 'web service' arena - does this fall into that category? Are there any tutorials you guys would recommend looking at?

View 1 Replies View Related

Android Can Use Like Apple Push-notification?

Jan 26, 2011

i use php to post to apple ..


$message = $error_msg;
$deviceToken = $dtoken;
$badge = 1;[code].....
and andriod have similar way to post with php?

View 1 Replies View Related

Android - Web Server Connectivity And Authentication

Apr 28, 2011

I need my app to be able communicate with a web server. The problem is I want web server to respond only to requests made from real android phones. So, is there any way to make sure, that server works only with real phones? It should reject anything else to prevent spamming database from computers or emulators. Is it possible without sms verification? And how good is socket support in Android? If I want to write server software in C will it be able to communicate with Android based devices? Or I have to use php, or something like that?Maybe OpenSSL, but still I'm not sure.

View 1 Replies View Related

Send The Contents Of Android ArrayList?

Mar 12, 2011

I am working as a PHP developer (intermediate level) and do practice some android stuff at home.

I have created and array list which will fetch into an sqlite db inside my Android app and populate a ListView. Now I am trying to take that one level further.

I want to send that array list content to my PHP server where I can store the data given into mysql and fetch back to my app.

View 2 Replies View Related

Java - Access Database From Android?

May 26, 2010

I am working on a Android app and I have a dilemma. I have a list of Objects. I have to update each of these objects with a database. I have 2 methods:

Method 1: I can loop through the Objects. For each object I can connect to the server, update it, and then move on to the next Object, and so forth.

Method 2: I can store the Objects in a list, send the whole list to the server, update it on the server side, then return a list of updated objects.

My questions are:

Which method is faster? Which method is easier on the phone's battery?

View 2 Replies View Related

Running AMP ( Apache Mysql ) On Android?

Jul 4, 2011

I currently work on an open source e-commerce platform [URL]. and I am trying to work out if I can deploy an offline version that can run on an tablet. I was hoping to use an iPad but this has proved very difficult (impossible?)

a) Does anyone know of an AMP (apache mysql php) version that will run on a tablet - eg. Android?

The idea is to have a local version of the online store that sales reps can use when selling to wholesale customers that will store the orders locally until they find a WiFi or 3G signal at which point it will merge the new records into the webserver.

If I could get Apache, MySQL and PHP to run locally (like it does using WAMP, MAMP, LAMP, etc.) it would be great as the app would be usable without an internet connection.

View 1 Replies View Related

Connect Webserver To Android Mobile?

Dec 9, 2010

i want to store images which is in android application it is send to webserver .The server side is php language .i want to type any php coding for this?

View 1 Replies View Related

Android - Refresh The Page In Webview?

Jun 16, 2011

how i can refresh the page in the webview . I am using this

<META HTTP-EQUIV=Refresh CONTENT="3">

to refresh my php page but its not working . For the server it is working well.

View 2 Replies View Related

Apostrophe In Communicating Script From Android?

Jul 14, 2010

I am communicating with PHP web services in Android application. All the requests send from android are encoded with UTF-8 and the php scripts decodes it with utf-8. But when any request is send with apostrophe ' the decode function of php doesn't seem to work the way it should. For example, if I send the request as "Today's Horoscope" then its utf-8 encode will be "Today%27s+Horoscope". I tried to decode this with Android and it was successful. But in php it gives the same text after decoding.The database is MySql. Is this a problem with database or php? I am not sure about it but is there any workaround to this problem?

View 3 Replies View Related

Develop Android Apps Using JavaScript?

Jun 15, 2011

I want to develop Android apps using PHP and Javascript. I am working on Windows XP SP2. Do i need the complete Android SDK or just the Android Scripting Environment (ASE)? I have downloaded the SL4A.apk (Android Scripting Environment), PhpForAndroid.apk and Android emulator (just the emulator) but it runs very slow and i dont know how to install SL4A.apk and PhpForAndroid.apk on it. What else would i need for app development? I dont want to develop in java so i dont think i should need Eclipse or NetBeans. Also, how i can i create an AVD(Android Virtual Device) for the emulator?

View 2 Replies View Related

HTTP Requests For Pages From Android?

Apr 15, 2011

I am trying to request for a php page from my android app. The response text is supposed to be in an EditText view. Well there is no response text. I dont know what am doin wrong but in a normal java class when i system.out.println the reponse, it actually shows. What is it with android? Here is my code:

package com.httprequests;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

[code]...

View 1 Replies View Related

Download File From Android Browser

Mar 31, 2011

when the user clicks a button on the website, we want the user to be prompted to download the video. So after Googling for a while I figured out how to write a short php script using content-disposition:

<?php
$fn = 'videoFile.mp4';
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header('Content-Description: File Transfer');
[Code].....

So the button on the website points to this script. PC browsers seem to start the download with no problem. But the main focus of this is for Android phones. When you click to download the file on the default Android Browser, it fails and all it says is "Download Unsuccessful". Another thing is that on my computer (using Firefox), the download starts and at about 200MB, it just stops. It doesn't show any signs of failure, it just looks like it finished downloading. The actual file size is about 1GB.

I have played around with the content-type quite a bit, hoping that was the problem. I used "video/mpeg" and "application/force-download" and neither of them worked. Is there something I'm not doing write? Could the 2 problems be related? Should I be going about this a different way?

View 1 Replies View Related

Uploading An Image From Android To A Server?

Sep 26, 2010

I'm trying to upload an image from android to a PHP server by using MultiPartEntity but i have trouble to find the source of the problem , the progress dialog steel downloading without providing any response here my code :

public String postFunction(String s_v1, String s_v2, String s_v3)
throws ParseException, ClientProtocolException, IOException {
HttpClient httpclient = new DefaultHttpClient();

View 2 Replies View Related

Upload An Image To A Server In Android?

May 24, 2011

i am trying to send an image over a PHP server. The problem is the php programmers say that it should be sent as an data. Following is the code which i am currently using, convert the image to a data and get a response from the server.

InputStream is;
private int serverResponseCode;
private String serverResponseMessage;

[code]....

View 2 Replies View Related

What Will Be The Android / Java Equivalent Of MD5 Function

Mar 31, 2011

I am calculating the MD5 in Android/Java as follows:

byte raw[] = md.digest();
StringBuffer hexString = new StringBuffer();
for (int i=0; i<raw.length; i++)
hexString.append(Integer.toHexString(0xFF & raw[i]));
v_password = hexString.toString();

However there's a mismatch with PHP's md5() function.

MD5 - PHP - Raw Value - catch12 - 214423105677f2375487b4c6880c12ae
MD5 - JAVA - Raw Value - catch12 - 214423105677f2375487b4c688c12ae

How is this caused and how can I solve it so that the both Android/Java and PHP generate exactly the same MD5 hash?

View 1 Replies View Related

Android - Scrape Data From LocService?

Jun 28, 2010

I'm looking to scrape geolocation data from LocService (a solution to track GPS pings from an Android phone) and host it in a MySQL database as a PHP cron job. The login system uses HTTPS. I'm having trouble returning anything through cURL.

View 2 Replies View Related

Android - Upload Image To Application?

May 4, 2011

I want to start the camera and click a photo and store it in the SD card and it should automatically choose the particular file and give an option to upload with the image being displayed on the screen.On click of upload it should upload to the server. I wanna know how to handle the file uploading in PHP via Android application too.

View 1 Replies View Related

Login System On Web Browser To Android App?

Jul 6, 2011

I have a php login system that was not developed by me, it is live and now i'm asked to make it into an app but, from the login in the web, the source code does not reveal.For example, the id of the person who logged in. Also the source code does not reveal the query of the php to get the info related to that person, but i'm still asked to do it, what should i do?

View 2 Replies View Related

Android - Updating MySQL Table

Jun 3, 2011

I'm sending some data through to a mysql server via android in an attempt to update some details. Currently the php side looks something like this:

for($i=0; $i<(10); $i++){
for($k=0; $k<(10); $k++){
mysql_query("UPDATE sometable SET data_".$i."_".$k." = '10'
WHERE id = '".$_REQUEST['id']."'");
}
}

I have to use a loop becuase I'll be building up lots of generic types of data with the style "data_x". Unfortunately, this layout doesn't seem to update any fields in the database. Does this method create some type of space, or just simply disrupt a complete variable when read in a statement?

View 2 Replies View Related

Java - Parse An Array From Android SDK?

Feb 17, 2011

I dont like others do my duties, but i'm not a RegEx expert and i think you.I'm building a newsletter Android app which consumes an array exposed in a http like this:

Array
(
[Last_News] => Array
(
[last-news-1] => Array
(
[ID] => 711
[Title] => Here goes the title text

[Code]...

But then, when i run my app, i can see all the text downloaded from my httpclient implementation. Someone can give a example of how i can print the arrays inside [last-news-1]?

View 1 Replies View Related

ADVERTISEMENT