Parsing dota2.gamepedia.com - Android - android

I would like to get all information about Dota2 items I can get. Essential ones are their prices, names, thumbnail picture URLs, but other information are also welcome, like the way you buy them (for instance, you buy a Moon Shard by buying two Hyperstones).
There is a Dota2 Wiki page and there is a way to parse Wiki pages, but this didn't work. Apparently Wiki's APIs doesn't work on http://dota2.gamepedia.com.
I need this information on Android platform.
Any help?

I have actually been actively researching this same thing.
Scraping from a wiki is far too brittle (layout/website updates), why not get the data straight from valve's mouth? They have an online item viewer which consumes json item data, I was able to track down where exactly this gets published and plan on using it in a future android app as well.
The json data can be retreived via this link.
Once you have that look into something like retrofit to parse this data directly into objects.
Personally however, I would consume it through some other method and store it in your own database so your app isn't dictated by the structure of the data they push.
Hope this helps!

Related

News feed. Best way to store info

I'm doing a news feed in android, and to make it work faster and avoid download the same info many times, I need a way to store strings to title, url, pub_date, and the image of each post, from different sites and later be able to organize them per date. So what would be the recommended way to save this info?
There will be no single correct answer to your question. But I would go with implementing a content provider that would be backing the caching of your feeds in a local SQLite database.
You might be interested to watch
Google I/O 2010 - Android REST client applications

Storing Data on and accessing data from a website

This is a total noob question. Sorry in advance if it is vague, but I'm looking for advice on how to start out. I have an app that I've developed that interacts with a local sqlite3 database. Everything works great, insofar as the data is local. Now, I want to move this data away from the local device and onto my website so that the app has to call out to that URL to get/set this data.
What topics should I be looking into? I need to understand how to 1) house this data on my website, and 2) modify my app to interact with it. Again, sorry if this is vague - just looking for topics to begin my search.
Thanks!
EDIT: I'm finding lots of resources out there that describe how to retrieve data FROM the site. What I am really spinning my wheels on is how to modify data stored on a site. This is back end data. No one will ever see it directly. JSON format sounds like the way to go, but I don't know where to look for ideas of how to update this data after a user initiates a change from the app. I need to update the data on the site, not just on the local database. Thanks again!
JSON JSON JSON! JSON is awesome, and is IMO the easiest way to communicate between the web and any other platform. You can look here and here for more info on the android side. Depending on what platform you are using for your website, there are many awesome libraries to help export your info to JSON. Happy Coding!
Check out the Volley library as it will simplify and speed up greatly your network communications (get it here).
You probably want to use JSON to retrieve and send data to your web-service as it is very light and compact.
An example using Volley and JSON

Retrieving Movie Ratings from Websites/Blogs for Android App

Is it possible to retrieve movie/songs rating from different website or a blog and show it in android application as to which blog or website has given how much rating to a movie/song and show it in one place.
P.S: I am beginner at android application development and got this idea to make a app which could fetch ratings for a particular songs or movie . So if it is possible it will be great if you give me a little headstart as to how will it will be done .
Thanks.
I would recommend something like a external server or database that does crawling work for you.
You would need something like a list of websites/blogs you get your ratings from and you would need to write something like a crawling script for each website. That means downloading the HTML-file of the site and parse it for your information. This data must be stored in your database or the server must do this dynamically.
Now your device connects to the database/server to get the analysated data. If you let your device do the whole parsing-work, it would kill the net-traffic and would take ages to load.

Passing multiple sqlite rows to mysql?

I was brainstorming how I should handle this. This is how the application is going to work:
User enters multiple pieces of data into app
App stores data into SQLite database
User hits SYNC button and app will pass all new/updated/deleted info to site PHP and update MYSQL.
I was thinking I can do a loop where it sends (and receive) one row at a time to mysql or I can use a string builder to build a XML, and pass (and receive) the XML string to PHP to process. The xml will have tag data specifying if the element is to be added, deleted or updated.
I figure the XML is a better option, but I'm coming here for opinions how I should push multiple rows to be added/deleted or updated to my MYSQL because I feel there's probably a more efficient/easier way of doing this.
Thanks!
--UPDATE--
Here's some helpful links I found of JSONArrays for those seeking similar information as I am about Android SQLite to PHP MYSQL.
Nice tutorial about JSONArrays in PHP: http://webhole.net/2009/08/31/how-to-read-json-data-with-php/
Another tutorial about JSONArrays in Java: http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/
Ah, opinions. Painful things though: everyone has one and everyone thinks their opinion is better than the next persons'.
I've implemented a system that is pretty much identical: I used JSON for it though. There is no intrinsic issue with using XML: whatever translation layer you are comfortable with is probably fine. JSON was (for me) a bit more compact than XML, required less code on both sides (json_decode is your friend) and seemed to me to be an easier row to hoe than using XML. However PHP's simplexml would probably work fine as well.
If you're doing this from scratch you might want to look at one of the systems with automatic data syncing like Mobile Couchbase (see http://www.couchbase.com/products-and-services/mobile-couchbase): would require a fair bit more tooling and a bigger server/client resource footprint but might get you there faster.

Offline accessible RSS feed with images

I'm new to android since a short period and after looking around on different forums (including this one) i couldn't really make up what the best way would be of parsing my RSS feed.
Here's my problem:
I'm creating an application that is to be used on the north and south pole. Places with basicly no connection.
I will be putting available a dictionary of all the animal life on both these poles.
The point of the application is that it has to be able to be synchronized when back on the mainland. (Because this dictionary keeps growing and changing)
The information will be put available trough an online RSS feed.
Now my question is, what is the best (and possebly easiest) way of doing this?
This is how the RSS feed will be build up
I have a few years knowledge of Java programming (Worked with netbeans), Now i'm using Eclipse. I already managed to create a local database with the columns i need to store the information in (SQLite). Now my next challenge is how to bring the content from the web to this local database (including the enclosured image if possible)
Hope someone can help me with this problem. In the meantime i'll be browsing further in search of an anwser.
Awaiting your reply
Regards
Check out the answers here: https://stackoverflow.com/questions/1253788/simple-rss-parser-for-android
If that ship hasn't sailed yet get them to publish the data as a JSON string. Takes only ~30 lines of code to grab the string and populate a Java data object with it.

Categories

Resources