• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Best Buy work schedule Sync

PsychoData

Lurker
Nov 9, 2012
7
0
32
Hey Guys. I am looking at making a app to check my work schedule and place it into a Google calendar. I know some java and I can get my activities to write to a file and such.

Basically, the parts I'm struggling with are reading from the web page where i get my schedule. I want to work on that first and basically parse the returned website into separate days and hours scheduled.

I'll upload some screen shots and source code for the web page. Of course, I cannot give you my password and username for you all to test these for yourself, but I have checked and I may let you use the source code.







Just to give a quick overview of how to use website. I navigate to mytlc.bestbuy.com which redirects me to https://mytlc.bestbuy.com/etm/ once there i must enter my password and username. By hand for now, programmatically later. After that I hit submit and it takes me to https://mytlc.bestbuy.com/etm/login.jsp then I Hit "Work Schedule" which takes me to https://mytlc.bestbuy.com/etm/time/timesheet/etmTnsMonth.jsp and there i can view my schedule. I've posted screenshots and source code of the three steps to get to the work calendar.
 
Mmkay, I am willing to bet that your calendar is generated via javascript using a database of some sort, which means that it isn't pure HTML. Because of this, you can't really parse the web page. You would need to find out the database information, such as address, username, and password (Which I highly doubt Best Buy would give you) and then perform queries on that database to retrieve the information you need.
 
Upvote 0
well i mean i know that best buy isnt going to give me access to this information. but I can see the code that is returned after the javascript is executed. It shows as html tables in the webpage. once i enter the username and password in the field and click the button. then click another button then right click view source it shows in plain html. is there any way to get it?
 
Upvote 0
i know the app isnt a browser. but i know that there might be a webbrowser class out there. For instance i am also working on a desktop version of this and vb.net has a webBrowser object. i can tell it to navigate to the site through code, enter my login information programmatically and click the button programmatically. after that I can get a list of htmlElements in the webbrowser object and iterate through those to find what I need.

WebBrowser Class (System.Windows.Forms)
this is the vb.net version that i am using. I havent really started looking for a java version yet, but i can probably find something similar
 
Upvote 0
well for example i have a computer version working insofar as opening a window, navigating to the page. then the program can get logged in all the way to the calendar and read it no problem just using a getElementByID method.
A WebView has several customization points where you can add your own behavior. These are:

Creating and setting a WebChromeClient subclass. This class is called when something that might impact a browser UI happens, for instance, progress updates and JavaScript alerts are sent here (see Debugging Tasks).
Creating and setting a WebViewClient subclass. It will be called when things happen that impact the rendering of the content, eg, errors or form submissions. You can also intercept URL loading here (via shouldOverrideUrlLoading()).
Modifying the WebSettings, such as enabling JavaScript with setJavaScriptEnabled().
Injecting Java objects into the WebView using the addJavascriptInterface(Object, String) method. This method allows you to inject Java objects into a page's JavaScript context, so that they can be accessed by JavaScript in the page.

So it looks like i could enable javascript which would make it able to at least run the webpage and sign in. I'll have to do more reading on it to see what i could do about loading the values into the fields.

maybe i could download the html, parse, insert values, render it and then execute javascript and then click the button. idk lots more reading to do and at this point it sounds like even then it would be a popups window that went through these in 10 seconds or so. not something in the background lke i was hoping to make.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones