Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

New Forums: Nexus Player | Nexus 9
test: Reply
 
LinkBack Thread Tools
Old November 9th, 2012, 11:13 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Nov 2012
Gender: Male
Posts: 7
 
Device(s): Verizon Samsung Galaxy Nexus. Verizon HTC Droid Incredible
Carrier: Verizon

Thanks: 0
Thanked 0 Times in 0 Posts
psychodata91
Default Best Buy work schedule Sync

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.

Advertisements
PsychoData is offline  
Last edited by PsychoData; November 9th, 2012 at 11:18 PM. Reason: line break issues
Reply With Quote
sponsored links
Old November 14th, 2012, 02:50 PM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

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.
__________________
My blog, Inverted Keystrokes, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)
jonbonazza is offline  
Reply With Quote
Old November 14th, 2012, 03:29 PM   #3 (permalink)
Junior Member
 
Join Date: Feb 2011
Location: Orange County
Gender: Male
Posts: 91
 
Device(s): Google/Asus Nexus 7
Carrier: Not Provided

Thanks: 7
Thanked 0 Times in 0 Posts
Default

If you are not the developer of the database on which your work schedule resides, you won't be able to develop the app. You need to know the passwords, have permission, etc., and you need the field names in which the information is stored. Without that, you can't do anything.
StevenHu is offline  
Reply With Quote
Old November 29th, 2012, 11:37 PM   #4 (permalink)
New Member
Thread Author (OP)
 
Join Date: Nov 2012
Gender: Male
Posts: 7
 
Device(s): Verizon Samsung Galaxy Nexus. Verizon HTC Droid Incredible
Carrier: Verizon

Thanks: 0
Thanked 0 Times in 0 Posts
psychodata91
Default

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?
PsychoData is offline  
Reply With Quote
Old November 30th, 2012, 09:10 AM   #5 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

But your app isn't a browser, so you can't just parse the resultant HTML as it will never see the resulted HTML.
jonbonazza is offline  
Reply With Quote
Old November 30th, 2012, 10:24 PM   #6 (permalink)
New Member
Thread Author (OP)
 
Join Date: Nov 2012
Gender: Male
Posts: 7
 
Device(s): Verizon Samsung Galaxy Nexus. Verizon HTC Droid Incredible
Carrier: Verizon

Thanks: 0
Thanked 0 Times in 0 Posts
psychodata91
Default

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
PsychoData is offline  
Reply With Quote
Old December 2nd, 2012, 02:37 PM   #7 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

There is a WebView class, but using that would have little point as you could just as easily use a browser app.
jonbonazza is offline  
Reply With Quote
Old December 3rd, 2012, 01:48 PM   #8 (permalink)
New Member
Thread Author (OP)
 
Join Date: Nov 2012
Gender: Male
Posts: 7
 
Device(s): Verizon Samsung Galaxy Nexus. Verizon HTC Droid Incredible
Carrier: Verizon

Thanks: 0
Thanked 0 Times in 0 Posts
psychodata91
Default

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.





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.
PsychoData is offline  
Reply With Quote
Old December 3rd, 2012, 10:01 PM   #9 (permalink)
New Member
Thread Author (OP)
 
Join Date: Nov 2012
Gender: Male
Posts: 7
 
Device(s): Verizon Samsung Galaxy Nexus. Verizon HTC Droid Incredible
Carrier: Verizon

Thanks: 0
Thanked 0 Times in 0 Posts
psychodata91
Default

org.apache.http | Android Developers anyone familiar with this package?
PsychoData is offline  
Reply With Quote
Old December 7th, 2012, 04:51 PM   #10 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

Yes, but unless you know how to parse the response (which you probably don't have knowledge of), you won't be able to see the results.
jonbonazza is offline  
Reply With Quote
sponsored links
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:15 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.