I am trying to develop an Android application that extract blog post from a blog http://heroesofmalaysia.blogspot.com/ to display in the application. Is there any way to do this?
Thanks!
As BVB said, you can use the Google Blogger API.
1) Use this link for the how to use https://developers.google.com/blogger/docs/3.0/using
2) You will need to authenticate you app with the api to be able to communicate with using OAuth
3) Use the URL format as described in the link to construct your request e.g. get a specific post, create post, get replies....etc
4) Receive the response in a JSON Format and parse it to display whatever you want.
I hope it helps
Use JSoup to parse the HTML you get from the server: http://jsoup.org/
I have done that but not in the way you want!
Actually I have added 20 articles in my app.
HOW
webView = findViewById(R.id.articleWebview);
webView.setBackgroundColor(backGroundColor);
webView.loadUrl("file:///android_asset/articlesExplore/astral_projection.html);
As you can see i pasted the HTML files in the assets and then it it show in webview.
Let's have a look,
And also, you can do that using google drive or firebase storage or onedrive. Save those file in the cloud storage and paste the link in the loadurl(LINK); Whenever you want to edit the pages, then edit them in blogger and paste the code in the html files. This is useful when you have like 100 posts (I had seven only).
Related
is that possible in Android to go though whatever link and get main content from that page(f.e.text) or whatever i want to get? If yes, how i can realize that?
There is couple ways to get data from websites.
First and maybe the most popular way is parsing RSS feed from webiste. Java and Android are providing couple parsers and ways to parse xml or in this case RSS Feed. You can take a look in this examples:
https://developer.android.com/samples/BasicSyncAdapter/src/com.example.android.basicsyncadapter/net/FeedParser.html
https://www.tutorialspoint.com/android/android_rss_reader.htm
Second way is getting needed informations from API if it is provided from webiste and offten that API will be in JSON format. For example https://openweathermap.org/ will return JSON file filled with informations of weather which you can pares into your app. Also Android and Java are providing couple ways to get informations from JSON format. You can take a look on this one:
http://www.androidhive.info/2012/01/android-json-parsing-tutorial/
Third you can use support library called Jsoup for parsing HTML from particular webiste/s. You can find examples how to parse HTML on their offical webiste: https://jsoup.org/
Maybe there is more ways certanly you should look up for them.
I want to create a web page so that it can store some data offline. I want to use this file in tablets as well as smart phones. can any body suggest some offline data storage for HTML and also its examples and tutorials. I have Googled about websql in html5. But didn't get any simple answer.
If you're using HTML 5 here's an example pulled from W3Schools:
// Store
localStorage.lastname = "Smith";
// Retrieve
document.getElementById("result").innerHTML=localStorage.lastname;
[Source]: W3Schools
For a more comprehensive guide visit DiveintoHTML5
Or here: http://www.html5rocks.com/en/features/storage
You have three main choices for storage:
Name/Pair Storage within the browser (see the W3 link)
IndexedDB [Source]
Web SQL DB [Source]
I hope you find the best solution for your project!
Is there an easy way to extract the raw data from a Blogger "page". For example, please see the following page:
http://ftaca.blogspot.com/p/get-support.html
I'd like to scrape everything from "Get Support" through "p 82 ACA text" (essentially, the meat of the page without the surrounding navs and such) for use in an Android app that is related to this website. Are there any querystrings that I can append to the URL to just get the raw info (i.e. something like http://ftaca.blogspot.com/p/get-support.html?raw=1)? I've tried a few things, but none work. Mind that this is a Blogger "page", and not a post per se.
Thanks,
Chris
I believe that this is what I need:
http://ftaca.blogspot.com/feeds/pages/default?alt=rss
Thanks everyone for your assistance!
You'll have to ask the web site developers whether they support query strings for page subsetting. That isn't really Android specific.
If they don't, you'll probably have to write a HttpClient client (search here and you'll find lots of good examples) to get the raw HTML for the page, and then subset it within your Android app.
i am new to android and wanted to read data from a url .
MY aim is to parse a one single page of a particular website and store it locally.
i have heared json can be used for this purpose but i am unable to find a suitable article that explains how to read using it.
It would be really helpful if somebody posts a beginner introduction of parsing a web-page in android be it with json or any other technology.
i am programming android in Eclipse IDE
Check out this article: Registering via Intentfilter. It illustrates how to get html source from a webpage and display it to the user. Developed in Eclipse.
I am looking into developing an App that will convert a website into more readable data for an android app. I am at university and have an online notice board which can be viewed on the web but if possible I would like to transfer this into an app on android to make it more easy to read on mobile devices.
What I thinking is that the app would go to the website where the notice board is held and read in the html code to display each notice in a list adapter view. Each notice is within its own div so I assume I could use that to split each notice up into its own button on the list adapter view. Is this possible and if so how I can go about doing this. I have tried google for an answer but I have not yet found a solution to this problem.
Thanks for your help
It seems overly complicated to me. I wouldn't handle all that using Android. I'd crawl the data on a machine (server) and then I'd convert all needed data to JSON and have the Android (client) fetch the data using a simple JSON parser.
In my opinion that would be the easiest solution if you don't have access to the server the website is hosted on to get it generate a JSON feed for you directly.
EDIT: In answer to your comment Boardy.
Here is the official website of the JSON project in order to get an understanding of what it is. Then if you have access to the webserver providing that page (I assume it is a PHP based site) and want to modify or add the functionality of providing a JSON feed then you should also take a look at the PHP JSON documentation.
To parse JSON on Android check out this SO question and also don't forget to take a look at the official Android documentation on their JSON implementation.