I've created a simple android browser. I have used EditText for URL and Webview for loading webpages. Although the browser works fine when I put the complete URL path, I need a functionality by which I can get predictions/auto-completion of partially put URLs. Please let me know if following options are valid -
Using AutoCompleteTextView instead of EditText with a database of all the available websites on the internet(More than 1 billion websites!! Where can I get such dynamically updating database??)
Saving URLs which are frequently being used by the user and use them as a prediction in an AutoCompleteTextView.(How can I add these URLs in a dynamic AutoCompleteTextView/Database??)
Currently I am using google search as a workaround. Please provide your views on how this can be achieved.
Related
I am currently working on an android application that will allow people to read the constitution, issue is I have only managed to get my hands on a soft copy pdf document. Ideally, I wanted an API that would allow me to fetch the document by Topic, issue or paragraph, I thought of multiple ways of getting the job done
1. Is by putting the document on the server, when user opens the app it downloads the pdf and allows them to read it(Problem with this is I won't be able to mess with the content like bold some text etc).
2. Is copying the content of the pdf into the databse and just fetching the text with a query(issue with this is I wont be able to do pagination given I put the content in one field)
Here is the link to the Constitution I needed a way in which I can load the data from the database in a way that I will be able to paginate, load a single paragraph or topic at a time. Can anyone whose been in a similar situation help me figure out the best way possible.
You don't to convert it to text, you can integrate MuPdf in your application check this answer I've found integrating pdf reader
I have an app that has a web-view which has a basic web-form that has a few fields and a submit button. I would like to figure out in my app if the form has any input in any of the fields. I cannot change the form from the server side, and I can't be certain much about the fields (ids / names in the html).
In iOS we accomplish this with an interesting process of pulling all the html out when loading the form, and comparing it to the html at any given point, if they don't match, the user must have entered something into a field. I believe we were able to get the html by injecting and running some javascript into the web-view. I'm not sure exactly how to approach the problem on android, or if android has any better tools to get whether a form has been edited.
Anybody have any ideas / pseudo-code how I can tell if a form has had input in any of the fields in a webview in android?
Unfortunately, there are no special form-related tools in Android WebView either. You can use the same approach as you have described for iOS.
A couple of links to get you started:
Read HTML content of webview widgets
Android Web-View : Inject local Javascript file to Remote Webpage
I recently begun working with android.
I have created registration form with some basic fields. its working fine, but here task is to upload pic along with this form fields to the server. Pic can be choose from existing or can capture with cam. Please any one suggest me best way of doing this task.
You might be able to do this using a html form in a webview, I don't know if its the best approach, but it could work for you.
The html form will include a set of inputs, and an image upload button.
The form can then be posted to your database/other application
A couple of friends and I are setting up a little app business, and we are creating our general app for finding out all the latest news about our other apps. But we have a small problem.
We have a layout xml file with a table row in it. In the table row we want to show two textviews. One that says Current App version (Which we have done successfully) and the other one will show a few numbers from an HTML page which is live now.
I want to know, how would be able to get the text from the HTML document on the Web to that text view, or any other thing we could use.
(We know that the manifest will have to allow the internet)
Thanks
So in this TextView, you want to show the content of the HTML page? If this is the case, the best thing you could do is to replace the TextView with a WebView, where you could load the HTML page via its url.
If not this is the case, you can make a GET request to that HTML (i.e. using an Async Task), get the results and present them in the TextView.
Hope this helps!
I have read the example for Rss Parsing from the ibm site.(http://www.ibm.com/developerworks/opensource/library/x-android/).
In this example,the rss are shown in a listview and then,if you press one announcement you can see it in the web browser of the device.How could i see them in the app,with no use of the device browser?
Thanks a lot
Create a layout with a WebView then load the URL from each "announcement" using WebView.loadUrl.
I'm a little confused but you seem to have answered your own question.
You say you don't want to use the web browser on the device but the example in your question doesn't use the browser. It does exactly what you're asking for.
The idea is that you download the html from the website and then use the parser to break it up into separate "announcements" and store them in list view items in your program.
I have done a bit of this type of thing myself in android. I used jsoup java library, which makes breaking the html into the bits you want to display really easy.
If you want some more help I can give you an example of an app I made that pulls movie times from google.com/movies as an example. here are links to the classes where I did the html download and parse:
ScreenScraper.java
HtmlParser.java