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

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old April 8th, 2012, 11:37 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Apr 2012
Posts: 5
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default how to filter internet data -android development

i am developing an android application......and i need sum help

its a bit difficult to understand the situation so i am explaining it with a hypothetical situation..
say i am developing an application which uses Internet.....say a facebook application.....but i want to filter the Internet data...i.e i want to show only sum part of the information i receive but not the rest....say i dont want to show the friendlist but i only want to show the wall of the facebook.


i dont want to create a new website i directly want to filter it through the android application,so if any 1 knows how to do it plz share

also tell me what things i have to learn so that i may develope such an application......

thanxs

ankit662003 is offline  
Last edited by ankit662003; April 8th, 2012 at 12:16 PM.
Reply With Quote
sponsored links
Old April 8th, 2012, 11:59 AM   #2 (permalink)
AF Addict
 
Rush's Avatar
 
Join Date: Jan 2011
Location: Loganville, GA
Gender: Male
Posts: 18,523
 
Device(s): HTC ONE
Carrier: Sprint

Thanks: 2,850
Thanked 3,103 Times in 2,333 Posts
Default

Hello and welcome aboard. You are definitely in the right place to get some answers for your concern.

Hopefully someone with the know-how will chime in to assist you.
I hope this place will serve you well.
__________________
"Accept the things you cannot change, have the courage to change the things you can ...And have the Wisdom to know the difference".


Rush is offline  
Reply With Quote
Old April 16th, 2012, 05:52 PM   #3 (permalink)
Junior Member
 
Join Date: Apr 2012
Location: London
Posts: 98
 
Device(s): ZTE Skate, Ainol Novo7 Aurora
Carrier: Not Provided

Thanks: 2
Thanked 24 Times in 23 Posts
Default

Its not totally straightforward from an Android application. Web pages are typically represented as a tree structure called a DOM (Document Object Model). You would expect the Android SDK to provide you with access to the DOM so that you can easily modify a webpage once it is loaded. Unfortunately it doesn't. The easiest thing you can do is use the WebView class to load your page, and then you can use the loadUrl API to execute javascript and manipulate the DOM that way. For example you could hide the left hand sidebar in Facebook with the following:

Code:
webView.loadUrl("javascript:document.getElementById('leftColContainer').style.visibility = 'hidden'");
If you are just looking to mash-up Facebook you would be better off looking at the Facebook developer API rather than trying to hack the HTML, otherwise every time Facebook change their page your app will break.

-George
GeorgeN is offline  
Reply With Quote
The Following User Says Thank You to GeorgeN For This Useful Post:
ankit662003 (April 19th, 2012)
Old April 19th, 2012, 03:59 AM   #4 (permalink)
New Member
Thread Author (OP)
 
Join Date: Apr 2012
Posts: 5
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default

thanx for ur time dude .....but u didint tell what things i need to learn......i am a beginer in dis field and i know some java and c and m following a series of android development from youtube....its gud but the guy only gives d basic idea.......i dont know anything about java scripts.....plz tell me what part of it(java and java script)should i go thru...also suppose i am making a login page.....what shuld i know before hand....
plz if u r willing tell me the headings.....i will do the learning part
ankit662003 is offline  
Reply With Quote
Old April 19th, 2012, 06:50 AM   #5 (permalink)
Junior Member
 
Join Date: Apr 2012
Location: London
Posts: 98
 
Device(s): ZTE Skate, Ainol Novo7 Aurora
Carrier: Not Provided

Thanks: 2
Thanked 24 Times in 23 Posts
Default

I'm not really sure I understand exactly what you are trying to do, but the easiest thing would be to use the Android WebView class to do all the hard work and use javascript to change the page. You can use the websites existing logon page.

If you really want to do the logon stuff yourself then you have a bit of work to do. You will need an activity with text boxes for a username and password and a submit button. The submit button should connect to the websites logon cgi script. If you vist the websites logon page on your PC browser, right click it and select "View Page Source" you can see what the page does. You are looking for a HTML form, you need to read up on HTML GET and POST and then do whatever the form does in your code (see the WiktionarySimple sample app for an example of HTTP GET from an Android app). Make sure you are using HTTPS if you are sending passwords.

I still think you would be better off using the websites API if it has one though. The WiktionarySimple app demonstrates this.

If you use the Firefox browser on your PC you can play around with javascript. Go to facebook, then select "Tools->Web Developer->Web Console". Now you can type in javascript commands and see what they do to the page. If you type:
Code:
document.getElementById('leftColContainer').style.visibility = 'hidden';
The side bar will disappear. You can get it back by typing:
Code:
document.getElementById('leftColContainer').style.visibility = 'visible';
Read up on:


GeorgeN is offline  
Last edited by GeorgeN; April 19th, 2012 at 06:56 AM.
Reply With Quote
The Following User Says Thank You to GeorgeN For This Useful Post:
ankit662003 (April 20th, 2012)
Old April 19th, 2012, 02:53 PM   #6 (permalink)
New Member
Thread Author (OP)
 
Join Date: Apr 2012
Posts: 5
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default

"You will need an activity with text boxes for a username and password and a submit button. The submit button should *connect to the websites logon cgi script*."


thanx dude....dis was what i was talking abut...i needed to know how to do it.....i mean i know hot to connect to d internet with an android app...but i was unable to take info from the user.....i made a browser for andorid which could show the webpage....but couldn't take the information from the user..like the browser was able to show the google page.. but i was unable to type in d "search" field of google....

also say i make a fb app exactly same as the default fb app with comes pre installed with
the phone....first the login activity comes......there r only 2 fields in dat activity....one for email nd oder for password.......any1 can to do xml layout part but what i need to know is how will d data dat i type in dese fields.....i.e email nd password fields,wud connect to the fb website and allow any 1 to log in.


and also how to modify pages ....i mean the facebook app....it shows the information the way the developer wants...not the complete websit....
or say the go facebook chat app for android ....i mean it does nt show whole of the fb website.....but only the "chat" part ...

thnx by d way for ur help ....although any more help wud b appreciated..
and pardon me for my english....english isnt my 1st language.
ankit662003 is offline  
Last edited by ankit662003; April 19th, 2012 at 03:06 PM.
Reply With Quote
Old April 21st, 2012, 12:09 PM   #7 (permalink)
Junior Member
 
Join Date: Apr 2012
Location: London
Posts: 98
 
Device(s): ZTE Skate, Ainol Novo7 Aurora
Carrier: Not Provided

Thanks: 2
Thanked 24 Times in 23 Posts
Default

The Android facebook app isn't just loading the facebook page and then modifying it, it probably doesn't even use a web view at all. It will use the facebook API I mentioned below. When you use the API it will just send you the data you ask for (like your contact list or you wall posting) without any HTML formatting etc.. You then have to build a complete UI of your own using that data. If you want to do that then you can read up on JSON, but it is a huge amount of work.

How does the web browser you wrote work? Is it a WebView? By default the WebView doesn't do a lot - it won't store cookies and JavaScript is switched off.
GeorgeN is offline  
Reply With Quote
The Following User Says Thank You to GeorgeN For This Useful Post:
ankit662003 (April 26th, 2012)
Old April 26th, 2012, 05:02 PM   #8 (permalink)
New Member
Thread Author (OP)
 
Join Date: Apr 2012
Posts: 5
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default thanx

okay so i have to read about API and Json....thanx

and yea i used web view in my browser and i turned on java scripts but dunno how to turn on cookies and dunno how to take input from the user....i mean dat google thing...i was unable to type in search field of google....du u know how to fix it??(i.e.the problem i mentioned in my previous post)
ankit662003 is offline  
Reply With Quote
Old April 27th, 2012, 05:13 AM   #9 (permalink)
Junior Member
 
Join Date: Apr 2012
Location: London
Posts: 98
 
Device(s): ZTE Skate, Ainol Novo7 Aurora
Carrier: Not Provided

Thanks: 2
Thanked 24 Times in 23 Posts
Default

Some people had the same problem here:

Android WebView refusing user input - Stack Overflow
GeorgeN is offline  
Reply With Quote
The Following User Says Thank You to GeorgeN For This Useful Post:
ankit662003 (April 28th, 2012)
Old April 28th, 2012, 06:32 AM   #10 (permalink)
New Member
Thread Author (OP)
 
Join Date: Apr 2012
Posts: 5
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default thanx

thanx dude..u r like a god to me.....plz give me ur email id so that i can add u on facebook......so that i can ask any more questions ...only if u want to.....
or if u want to send d reqst...take mine
rixxx22@yahoo.com
ankit662003 is offline  
Reply With Quote
sponsored links
Reply
Tags
android development, facebook, internet data filter


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 04:14 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.