Offline accessible RSS feed with images - android

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.

Related

Android OCR result matching with database

So I am trying to use a OCR to translate text that I record with my phone's camera to a string, I am currently using Google vision OCR for android and have implemented the OCR correctly, the problem is that sometimes the result is not as good as expected thats why a solution I think might work is matching the result given by the OCR with my database. For example if my camera reads "How you?" then I would find in my database a entry that is similar "How are you?" and would display this instead. So the real problem is that the OCR is constantly reading from the camera, so that means that I would need to make an HTTP request to a server and query the database for a similar match every second or two and wait for the response, that could be very bad execution if there are many users overloading the server. One solution that I thought was downloading the list of all strings in the database and make the matching locally, but what if the data changes after that in the database? What would be a good approach to this?
I'm using this to read text from supermarket products such as name and description, so what I thought was match the products name and then query my database for all complementary information. Its important to note that this is going to be used by visually impaired people so reading bar codes is not a good choice right now.
Here is my 2 cents.
One solution that I thought was downloading the list of all strings in the database and make the matching locally, but what if the data changes after that in the database? What would be a good approach to this?
It depends how big is your database. If it is not too big then you can download it on user's device. If there is an update to the database, then you can implement a push mechanism using FCM, letting the app know that there is a new version of database to fetch. Then you can fetch it in the background and update your local database. Also I understand that since you are creating the app for visually impaired people, it might not work if you just ask your users to take a picture and perform OCR on it. This way it would have prevented the calls every second.

Parsing dota2.gamepedia.com - 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!

android quiz game method selection

I am new to android and i want to build a quiz game for practice. I thought of creating question packages, each containing up to 1000 questions which the players will be able to download. I am thinking to insert the questions in a database (SQlite database) so each time I get a random number from 1 to 1000 for example i ll just use a query to search for the question with that id.
Some friends told me I should use xml files for the questions cause it would be easier to download the packages to each players device. But wouldnt that force me to search for the question with the right id in the entire xml and thus take alot more time than simply asking for a record with a specific id from a database?
Other consern is the communication with my server. What i m trying to say is, i read i should be using a a RESTful service but here is my question. I know that its easy to download an app from the store and view its source code. So whats stopping the guy who does that from seeing my database credentials inside the apps code and being able to have access to my remote server where all my clients data will be stored?
I am sorry if my questions are confusing but i just need some guidlines from where to begin...
thanks in advance
You're mixing up two questions here:
How to store the questions on the server
How to transfer them to the device.
SQL is a good choice for the server side, you'll need to come up with some possibility to insert questions to your database, you'll probably not want to insert them with manual SQL statements. You can for example create a small Java applet that let's you insert them.
XML or JSON via a REST api seem to be the options that make the most sense. Serializing and deserializing them with SimpleXML or Gson is easy-peasy.
On how to secure your app/game against people just downloading all of your questions (and probably answers), can't really tell. I would guess that 'serious' quiz games use some forms of encryption and authentication there.

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

Best Database design option for Android application with huge data

I am new to Android Application Development and a new member at stackoverflow. I am currently trying to design a recipe application. I have decided upon the features of the app and the scope it will cover. The scope is very vast for me in terms of covering all the recipes from all over the world. I am to deal with a lot of data in this process.
I am currently trying to figure a good and efficient way of handling the data in my app. So far, as per what I have read in different forums, I believe that I have two options in terms of a database choice : 1) SQLite 2) Database on remote server (MySql/Postgre)
Following are some of the thoughts that have been going on in my mind when it comes to taking a decision between the two :
1) SQLite : This could be a good option but would be slow as it would need to access the file system. I could eliminate the slowness by performing DB data fetch tasks in the AsyncTask. But then there could be a limitation of the storage on different phones. Also I believe using SQLite would be easier as compared to using a remote DB.
2) Remote Database : The issue that I can see here is the slowness with multiple DB requests coming at the same time. Can I use threads here in some way to queue multiple requests and handle them one by one ? Is there an efficient way to do this.
Also I have one more question in terms of the formatting of my data once I pull it out from the above DB's. Is there a way I could preserve the formatting of my data ?
I would be more than thankful if someone could share their knowledgeable and expert comments on the above scenario. Also this is not a homework for me and I am not looking for any ready made code solutions. I am just looking for hints/suggestions that would help me clear my thoughts and help me take a decision. I have been looking for this for sometime now but was not able to find concrete information. I hope I will get some good advice here from the experienced people who might have encountered similar situation.
Thanks for reading this long post.
What about combining both approaches?
A local SQLite database that has the least recently used receipes so you don't need network all the time. Network is way slower than accessing the filesystem.
Some remote database accessed via some HTTP interface where you can read / write the whole database. And if you want users to be able to add receipes for other users to see you'll need an external database anyways.
SQLite : This could be a good option but would be slow as it would need to access the file system.
Accessing a local database is pretty fast, 5ms or so if it's just a simple read only query on a small database.
But then there could be a limitation of the storage on different phones
Depends on your definition of huge database. It is okay if it is only 2MB which would be enough to store lots of text-only receipes.
Also I believe using SQLite would be easier as compared to using a remote DB.
Yes, Android has a nice built-in SQLite API but no remote database API. And you don't need to setup a database server & interface.
The issue that I can see here is the slowness with multiple DB requests coming at the same time.
A decent database server can handle thousands of requests. Depends on your server hardware & software. https://dba.stackexchange.com/ should have more info on that. Required performance depends on how much users you have / expect.
I'd suggest a simple REST interface to your database since it's pretty lightweight but does not expose your database directly to the web. There are tons of tutorials and books about creating such interfaces to databases. There are even hosted database services like nextDb that do most of the work for you.
Is there a way I could preserve the formatting of my data ?
You could store HTML formatted data in your database and display it in a WebView or a TextView (via Html#fromHtml()) - both can display formatted text.
Databases don't care what type of text you store, for transfer over the internets you may need to encode the text so it does not interfere with the transport formatting (XML, JSON, ...).
A simple way is to integrate Parse into your app. They have a nice framework that easily integrates into iOS and Android. Their plan is freemium, so you'll be able to use up to 1 million API request for no charge, and then its 7 cents for every request after that.
You'll have 1gb to store all your data sets / images, etc.
I don't use parse for everything, but I HIGHLY recommended it for large data schemes because they do all the scaling for you. Check out the API, I think it would be worth your time.
I just started to work on a few of my own projects, and I'm using Parse again. I have to say it's improved a lot over the last 6-8 months. Especially with the Twitter and Facebook integration.
The key issue here is the size of the data - any significant database of recipes would be too large to store on the phone imho,thus you seem stuck with the remote database solution.
As opposed to trying access the remote database from android I suggest you use a a go between web application that will process requests from the application and return JSON objects that you need.
It totally depends on your software requirements. If you need to deal with a small amount of data then you may choose SQLite, but for a huge amount to data better use a remote DB.
SQLite: It works fine with little amount of data & I experienced it response time is good.
Remote DB: I think you may use small server side app to submit the data to your client app. It will solve/reduce your thread related issues/complexities.

Categories

Resources