Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Mimic Website Functionality in a Java App (Android)

Options
  • 04-08-2011 2:35pm
    #1
    Registered Users Posts: 9,126 ✭✭✭


    Decided to get into Android development. Currently working as a C# developer but would like to both get some Java back on my CV if I decide to switch and also some mobile development would be good too.

    Have decided on a first project. I have a linux NAS box at home I use as a home media server. There's a webtool for managing the box but it's a bit clunky and doesn't work very well on my android phone, would like to do up an app that provides the same functionality but with an easier to use interface.

    Is it possible to just use the existing website functionality? As in the app just loads up the website in the background, clicks whatever button is needed etc. I know it seems like a slow way of doing things but all the actual functionality I need is already there, and it would be a good way to ease myself into Android without having to worry about the logic of what my application needs to do.


Comments

  • Closed Accounts Posts: 460 ✭✭murraykil




  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Does the NAS vendor provide an API? If not you should look at the HTML forms used by the webtool to control the NAS, found out what actions they use and POST to them from your android app. Also look at GETs etc. and replicate them.

    Actually who is the vendor?

    @murraykil - an link to an HTML parser hardly qualifies as an answer, any chance you could explain what you're trying to suggest as a solution?


  • Registered Users Posts: 9,126 ✭✭✭Royale with Cheese


    It's made by D-Link. You get nothing out of the box with it that helps with programming, although I've installed a script that somebody else wrote that gives you ssh access.

    I've already had a poke around with the web files. The forms call cgi scripts as their action, and when I open the cgi file the vast majority of it is unreadable. Also I've never used cgi scripts so I'm not sure what it's possible to do with them.


  • Closed Accounts Posts: 460 ✭✭murraykil


    Is it possible to just use the existing website functionality? As in the app just loads up the website in the background, clicks whatever button is needed etc. I know it seems like a slow way of doing things but all the actual functionality I need is already there, and it would be a good way to ease myself into Android without having to worry about the logic of what my application needs to do.
    Evil Phil wrote: »
    @murraykil - an link to an HTML parser hardly qualifies as an answer, any chance you could explain what you're trying to suggest as a solution?

    I'm suggesting that the OP uses the HTML parser to load "up the website in the background" and click "whatever button is needed etc".
    Document doc = Jsoup.connect("http://example.com")
    .data("query", "Java")
    .userAgent("Mozilla")
    .cookie("auth", "token")
    .timeout(3000)
    .post();


Advertisement