-6

I am working on android application that searches food from http://www.myfitnesspal.com/food/calorie-chart-nutrition-facts. However I am very new to JAVA, and I am doing a lot of reading but I am still unsure. I believe I have to do something with POST requests but I have never done such thing as I have little programming experience. I currently using JSOUP in my android app and I don't know if that is all I need to do this. I simply need to make my program fill out the search field, submit the search and go to the first result(link) that is provided. Any help would be greatly appreciated.

9
  • are you extracting the data from html page using jsoup ?
    – droidev
    Aug 19, 2015 at 4:49
  • After submitting the search and clicking the link, on the resulting page i would be extracting data...which I know how to...I am just unsure about the whole searching part.... (Why so many downvoted...just want help :( ) Aug 19, 2015 at 4:50
  • your question is not clear, thats why you got down votes,
    – droidev
    Aug 19, 2015 at 4:51
  • however is that your website ?
    – droidev
    Aug 19, 2015 at 4:52
  • The website i want to use is myfitnesspal... Aug 19, 2015 at 4:53

2 Answers 2

2

The easiest way to do this requires getting an API key since MyFitnessPal's API is private.

You will want to submit a request to http://www.myfitnesspal.com/api and check 'Pull from MFP food database' in the "API Interest: " section.

If you're approved and get the API key, then you will want to learn about basic HTTP. Your task requires a GET request, not POST (e.g. you want to GET data from the database, not POST data to the database). And once you're at this stage, you'll want to go back and check out Sumighosh's link again.

1
  • Yes i have submitted a request...but i heard it takes very long or sometimes the never respond...I am wondering if there is any other way :( Aug 19, 2015 at 5:19
0

if you have an access to the database of the provided website, you can make direct api calls from your android application and receive response from the server. or if you are not having access to database jsoup is the best option for parsing the html form

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.