how to make server who receive file from android app? - php

I am android developer and zero at back end process. Whats stuff/tools require for making a server/website that receives files from android app. I listen somewhere that php code is required as backend on server side. Is is true?
hoping for detailed explanation. Sorry for my english.
Thanks.

need php file for coonecting with database.use phpmyadmin(xampp)
tool for creating database.then create phpfile n post on server or localhost. after that use url in android.like our php link is localhost:80/phpproj/trial.php
and pass value to database using asyctask method.

Related

Flutter web must I http to mysql

Good day. I am new to flutter web. If someone can assist or point me where I can get the correct info I would appreciate it. I need to save data in mysql on the same server that the flutter web app is uploaded to. What I want to know is if I must do a http request even though the mysql and webapp is on the same server? I guess I need to create a .php file to post and fetch data from the mysql database. But if you are on the same server do you http to the .php or is there another way? Thanks in advance.
If you meant with "HTTP to MySQL", to directly from Front-end access MySQL through some Web-API, then no there is no such thing supported by MySQL.
But you can create your own Web-API Back-end (a .php script), which redirects requests to MySQL, and then Front-end only needs to communicate with said Back-end.
The Front-end may seem to be on same server,
but the Front-end logic runs on the user's Browser, which is far away from server.

Android Php Server Connection

I am trying to make an android app with php in a backend. In this login page I am trying to send login credentials to php file so I can echo that and store that value in variables. And also My php file is stored on server of www.myurl.com/myfolder/login.php. I know a lot more about web development but this is my first experiment with android app. I even referred several online tutorials for this. All I see is using JSON and json_encode in php but that is not solving my problem. I think I am making some other mistake or is not able to locate an error.

upload image from android UI to php server side api

i got two questions.
1) i want to upload image into php server and the front end will be android. and i want all processing to be done by php api like checking image and name extension and even error checking .
All the tutorials that i surfed has done in such way that most of the processing is done in android and only for storing uses php api. so any suggestion which supports above requirement will be of great help.
2) $_FILES["fileContents"]["type"] this line in php api is directly used with android uploadimage . i know that it initates file browse option but how to pass parameter value ['fileContents'] from android code.
thanks

Webview in android able to run php

I am working on a Android Application that has web view where i need to load html, jquery and js and php also. Now i am able to load html jquery css javascript , But my problem is i am unable to load php in web view in offline is there any way to execute php in web view
Please Help Me Thanks In Advance
You almost certainly don't want to run PHP on your Android. But in case you do, then you would want http://code.google.com/p/php-for-android/. Better link: http://phpforandroid.net/
PHP is a server side language. It cannot run inside the browser. It helps you to build the dynamic web pages.
You can call any web page in the webview when you are online. it doesn't matter what is the server side language.
When you are offline, you cannot send request to any server. so no question of executing any page.
You can do it easyly with AndroPhp, just search it in Google play and install.
Its like WampServer for Php+Mysql. You should run it than just create your PHP project under www/ folder and call it from Android webview 127.0.0.1:80/yourproject
This way you you have local server on your Android, you shouldnt code in Java for Android all you can code in PHP. Maybe it is not a elegant way to code for Android but works !!

How to upload images into my remote server with PHP?

I have an android app, that connectos to the remote database with PHP+json
but now, i have to store photos of the users on the remote server. I need to do it storing the URL of the uploaded photo in a row of the USER TABLE. That is not the problem. The problem is that i have not idea about with a given path of a photo, how to upload it into a dir of the remote server of my app?
as i know, i need two things, a function that connects with a PHP and gives to the PHP the photo, and a PHP that receives the photo and uploads it into a dir of the remote database.
Well....¿can someone help me to do it?
I checked a lot of tutorials of doing this with PHP but i can't find a easy one that how to do it with android+php+mysql, all i am finding is too hard for me.
can someone give me the code i need to do it?
thanks
EDIT:
there does not exist a simple function and a simple PHP code that does it? Simple ones, the examples you are giving me are very hard for my skills with this and i can't apply to my android app and my remote server
For the Android part, its just straight Java, and there are loads of examples of using HttpClient to perform file uploads.
How to upload a file using Java HttpClient library working with PHP - strange problem
google search
For the PHP side: http://it.php.net/manual/en/features.file-upload.php (there are a lot of sample)
For the Android side: this article explains hot to use DefaultHttpClient for make and upload via HTTP

Categories