Reputation: 351
i am making an android app for a word press website. I am almost done. I am just stuck on a small thing. This is the link for the particular website page i want to make in the app: http://abinet.org/contact-us/ . The user shall fill the required fields and click on submit and the message has to go to website admin (the same way as it happens in the website).
I can make xml layout, get the texts and all but don't have a clue of what to code in the "submit" button. I wasn't able to search on Google about this as i am not sure what exactly to search. i don't know what this is called. I don't want coding. i just want to know what topics i need to read to achieve this. Any start would be helpful.
Upvotes: 1
Views: 540
Reputation: 2303
You want to POST data to a WPCF7 form from your android app.
You can search SO or even the web for this but here's some quick tips:
Consider a more durable solution: just for the contact form, you can use a WebView to load http://abinet.org/contact-us/ and inject a custom css to change the look and feel. So just in case the website needs to add more fields, it can do so without breaking your app.
If this seems too complicated, you can make your own custom layout and bind the submit button to a task that: gets the hidden fields from the website and include them when posting.
Update:
Network tasks and all other IO-related tasks should not and cannot (depending on the OS version) be done in the main UI thread. To perform these actions either a new thread is created and run or -- in a more Android way -- an asynchronous task is executed in the background. To make use of an AsyncTask
in your "Contact Form Activity":
extends AsyncTask
onClick(View v)
method (for a very good example see how to asynchronously download a webpage)POST
submission of the contact form.This will probably not be a detailed solution to your problem, but your problem "is complicated" ;) You now should know how network-related tasks are performed in Android (how to go about performing HTTP POST requests to generic sites) and how to GET form CSRF tokens and other hidden fields (consider all web forms as having them). If you need help with any of these issues please, ask another question.
Upvotes: 2
Reputation: 2142
what you are looking for is andriod sending a post data to a web url
/contact-us/#wpcf7-f595-p444-o1
this is the action url from your current webpage.
make sure to include all the required post values the values to past are their name="xxx" inside the html
Upvotes: 1