I am new to Android development. Using android, I am trying to go to a certain website which is not under my control(developed by someone else and I can't change), fill the data in form fields.
Using WebView control, i am able to load the given URL. But i am stuck with sending/filling data to form fields.
How do i proceed with that?
You probobly need to do somthing like in this question.
You should realy check with the person responsible for the website. If you can get a bit of co-operation then they are less likely to change the form on you and break your code. I have a similar senario and the other party is very happy and will at least inform me before any major changes occure.
Related
I'm developing a personal project with Android and struggling here with some doubts about the better way to develop it.
Well, my project consists of my app consuming a Rest Webservice (which I already developed with Java and Spring) and showing up a list of places on it. The thing is: This list could be huge, something like 2000- 3000 records with description and picture of each place.
I'm using volley and OKHttp to take care of my networking stuff, so far my list of places isn't that long, so everything is alright, but I'm afraid when the list starting to get big, I don't know how my app will handle this.
My questions would be:
1- Should I store the that list on my device and update the list every time I connect to the webservice?
2 - Am I doing correct, retrieving the entire list with just one request? If not, how's the best way to do it?
Thank you guys, I'm new to android stuff, and I'm developing everything by myself, don't have anyone experience around to ask that.
Cheers!
As mentioned in comments You need your app to do "paging" and to load some of the content every time you scroll down.
For example if you will open Facebook app and go over photos you will notice that the first ones always loading the fastest and as you keep scrolling some will be left blank for few moments, thats what paging is all about.
Make sure though not to overload the app with info, specially if you use bitmaps
You can read some good tutorials here
I know this is a long shot, but I really can't find any tutorials for what I want to do. I am in the middle of creating an Android app, and the next thing I want to do is embed a Google Form into a fragment [as my app uses swipeable views]. I found this, but this doesn't seem to be the entire code. Does anyone know what the entire code looks like, or have any other solutions?
Thank you!
You can create your own UI for all the fields and then send a POST http request with the data to the google form URL. You'll have to find the exact ids of the input elements and create a key value pair for the same. Here is an article which details the complete process with the required android code.
It's the very first time for me asking question on this forum, so hope that everyone won't be too strict.
This semester I've been doing Project and I decided to make android application that will be able to parse articles from websites(not one, but many) and save it in text file or SQLite Database. I've been doing this for already 5 months and I really don't know how can I get particular plain text from webpage without getting unrelated to particular article stuff, such as adds etc.
Through this forum I found out how I can parse data from one website using Jsoup(I'm using one in my Project). And I thought it might work with multiple websites as well, but since many websites using different html tags to represent content of certain article, I couldn't find any common parameters that can be used.
I'm not sure, but I think I saw somebody on this forum said this kind of thing is impossible, but then how we can explain existence of such kind of apps like Pocket(Former Read it Later), Instapaper etc. These apps are doing what ultimately I want my app to do.
So can anybody give any suggestions about what can I do about it? Thanks.
I'm not sure whether it's going to show whole story, but here is the code:
doc = Jsoup.connect("http://"+URLField.getText().toString()+"").get();
// get page title
title = doc.title();
doc = new Cleaner(Whitelist.none()).clean(doc);
Here I'm simply using Jsoup library and its Cleaner class, but I get a lot of text that I don't want to appear. I wanted to post image to make it clear(what I want), but this forum doesn't let me do that.
I can perform as a native application on android that contains a wall as the Facebook application, I have communication with the webservice using a mysql database but basically what I want to know is how I should send that information to place in my wall of my Android app, do not like the design of the wall, if I need the help of listview, or something else, also not like painting the data string in that wall, please help me, to be displayed as well as the wall facebook.
Your question is too open ended (and also a bit muddled). You can send down the data in whatever format you want (XML or JSON are the preferred ways). Of course you then need to read this data using some sort of serialization library (Jackson for JSON is a good one). Then you probably want to display the data in a ListView, creating a custom Adapter.
There are a lot of pieces to this kind of app, so you're better off building one feature at a time and asking questions about the specific problem you are having. I suggest you figure out how to get the data from the server into the phone first.
This one is puzzling me...
For my Android application I want to be able to return the current time in any location the user requests (right down to city level). The request itself comes from a voice command, so I cannot use alternative methods.
The most obvious way (so I thought) was to query Google, but I need your brains to help me solve how to extract the data I want please!
In Google, query:
"What's the time in China"
You should see a 'widget' at the top displaying the answer nicely. View the page source and search on 'China' and it's there - I thought great, this is going to be easy!
But...
"What's the time in London"
Although the display in Google appears the same, there is no result for 'London' when searching the source HTML...?
Using Google Chrome, I inspect the element of the 'widget' and can then view the contents I wish to extract in all cases.
So, my questions is firstly, am I missing something obvious (Google don't want us to be able to do this for example)? Or is there a way to 'force' the result to be in the HTML by structuring the query perhaps?
Secondly, is there a way to access the specific 'element container' and return the results to my Android Application?
I thank you in advance...
You should really use an API instead of parsing html.
I guess there are many many API which will give you the time in a given city.
http://www.worldweatheronline.com/time-zone-api.aspx for example (havnt tried it myself)
If you still want to extract data from the google result (which is html), check for html parsers like in this post : Parse HTML in Android