Click here to Skip to main content
15,897,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to send strings and images from android to php (JSON would be more preferable)
Posted

1 solution

You would definitely need to work with some networks for sharing the data from Android to a website that is running in PHP language. PHP side is totally un-relational for the Android, because PHP would be handled as a server-side language which Android has no intention to care about. Android would just care about sending the data and getting the response.

The first approach can be to make this process as simple as possible. How that can happen? That would be to load the website's web page in the Android application. Just like using the WebBrowser in any .NET application, you can use the WebView for downloading the web pages using the Android's default browser and then rendering it over the screen. It is a simple way, because you won't have to write any code for uploading, or downloading the data. All you would have to do would be to create a simple HTML page whose events would be controlled using PHP scripting language. For this approach, you would be interested (and would find it helpfull to move) to read this Android developer guide page[^]. You will find entire guide for creating such an application. It is better to use the built-in functions if you're not an expert.

You can use the JSON notation, to transfer the data. As I have already said, Android won't care about the type of data from type of website running over type of server-side language. All it would care about would be the data to be sent, and the data that is being recieved over the network. You can surely convert that data to a JSON notation. If you want to learn JSON, you should go to http://json.org/[^].
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900