#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    11
    Rep Power
    0

    Question about using an HTTP Request to run PHP


    I know this isn't the best place to talk about android applications but please read on.

    Background:
    Myself and two of my class mates are developing an android application as part of one of our senior projects for a class. My job in the development is going to focus on the back end. I will need to log in to a website and return information found after logging in like school schedule, nothing illegal. This will all need to be done through coding, the user will not actually be on the website.

    Thought process:
    I was planning on making an http request to PHP script that I have stored on a web server which will do all the heavy lifting and then pass the required information back to my partners who will use the information in the application we're developing. I have limited experience with http requests which is why I'm trying to learn this part early on in the semester.

    I've done something very similar to this using html and Javascript. But I'm not sure if what I'm planning is even possible in android development which is very much like Java. What I did last time was use an http.open(get, url) type of operation to send information to a php file. I did not send any information back once the php script was done running so that is something else I will need to learn to do.

    My question:
    Does anyone know if what I'm planning will work on an android platform?
    Is it even possible to pass info to a php file and then pass info back?
    I have not been able to find much info on the http.open method in other languages, does this method exist in java or a similar method?

    Resources I've found:
    Android HTTP documentation: developer. android. com /reference/org/apache/http/package-summary.html
    (broken up because new users can't post urls, figured this was helpful to people reading my post though)

    If anyone could push me in the right direction or pass me some reading material that would be very much appreciated.
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Moved to the android dev forum.

    Does anyone know if what I'm planning will work on an android platform?
    Yes, android apps can fetch external URLs if you give it the "network access" permission.
    Is it even possible to pass info to a php file and then pass info back?
    Well...of course. Encode it in the URL or POST it.
    I have not been able to find much info on the http.open method in other languages, does this method exist in java or a similar method?
    fURL.openConnection();

    -Dan
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    11
    Rep Power
    0
    wow thxs for the quick reply. I'll do some more research now that I know I'm going in a possible direction.

IMN logo majestic logo threadwatch logo seochat tools logo