I have a website with a button that when clicked displays a message.
My site example: http://catcheat.net/Test/test.html
I am creating an application which should show the message that the button of my site has generated.
I wanted to know if there is some way that allows me to press that button (and then generate the text) without having to open the browser??
And most of all I wanted to know if you can take the text that was generated from the button and show it in my app (without opening the browser of course)??
I'm not sure I quite understand your question, but here I will try
As said JSoup is a Java library providing a set of API to extract and manipulate HTML files. There are several methods to read and parse an HTML page; in our case we want to retrieve it from a remote server and then we have to provide an URL.
For more information visit link
Related
We have a phone gap cross-platform built app and we are building the same app in native.
The app has pages/views with text with embedded hyperlinks in them where it sends the user to other pages in the same app. Of course because this is HTML based so this is possible using phone gap apps. But what if we changed that to native how can we have links inside a text where it redirects users to other views or grabs other data from the database and pushes them to the UIViewController?
How will the backend send us JSON strings with hyperlinks in them that will be able to replicate what the phone gap built app does. Is this possible?
Ok maybe we can send embedded HTML in the JSON data. But how will these <a> links open or grab other data from the server?
I find it very complicated or maybe not doable at all. Anybody has ideas on how this could be solved?
A screen shot of what i mean. This is a phone gap app.
All right first and foremost you need structured data.
Lets say I opend a main post with id '14'. Api will fetch data from server for id 14.
JSON structure can be like this:
{"title":"What are origional sin?","content":"Although Adam & Eve had been given. God has given man free will.","inlineLinks":[{"startIndex":"8","endIndex":"18","contentId":"141"},{"startIndex":"55","endIndex":"64","contentId":"142"}]}
Now using spannable string in android and attributed string in ios you now have id for specific inline link content and start and end index which you can use to add clicks to specific inline links. Once user clicks these link you have id of that specific content which you can open in your app.
Since you know the spannable string I hope you dont need the detail code.
Wish you have started your question with Spannable String problem.
Please ignore the indexes incase they are wrong ;)
How to get a specific text from a web page Android Studio?
First of all, you need to find "HOW THAT WEBPAGE IS GETTING THAT DATA?",
1-If it is hard coded you can hardcode it in your android application.
2-If it is coming from any web service you need to parse JSON data into you application.
That's how you get the specific data from any web page.
Got a pretty hectic task for myself here and i'm done with googling it ..
Im presently working on an app that has to take an
input , (String )(EditText) from the user end .
Use that string and pass it on to a webview , so that the search is done based on this string , (for eg: lets take youtube as an example so the passed content is a Songs name).
Once the search has been made the app has to pickup the url of the present search made .... i.e in youtube when we search for something we get the url as
"https://www.youtube.com/watch?v=zS4F49XqLWo" so the app has to store this url .
Paste the url onto another site and then Click on some buttons on that site (The major problem part -- how do i get the app to automatically click on buttons on another site ??)
Im just a novice at Android Development , espacially at the html side of it ... so kindly bear with me !!...
I have a small problem. I want to somehowe invoke a button in a webpage from an android application and send some information to this page. This is the part of the webpage I want to interact with.
In this form you write your name, e-mail and a comment. By clicking the button "Изпрати коментар" (which means "Send your comment") you can post a comment in the webpage. So I want to make the same functionallity, but from an android application (to write comments into the webpage).
Does someone of you have any idea how can this be accomplish?
Thank you in advance!
Let's say there's website X. Website X has a search function that'll return articles/documents/whatever. Whatever it returns will include a link so the user could click on it to go to said article. All of this would be without an API. Would it be possible for an android application to query a search on a random website, get the results and display them in the app, without the user actually seeing the website?
Yes, of course. All you want to do is write the app such that it performs the query to the website on behalf of the user; that way it gets the HTML response. When it gets the HTML page as a response, you parse that and reformat it into something more appropriate for the app.
Look at this SO question if you want more information on HTML parsers in Java: Parse HTML in Android