Android read / access online xml file - android

I make a android application themed puzzles,
and the answers I put in the xml file,
in folder assets/file.xml, I add also proguard.
after I publish it on google play,
The application turns in reverse engineering by someone,
so that all the answers are there in the xml file unreadable
and distributed on the Internet.
I plan to move this xml file online
eg I put in www.example.com/folder/file.xml to make it more secure.
My question, how to read / access the online xml file?
thanks.

One method i hvae used is use of webservice to make requests and get xml response. I have achieved this using Soap webservice, i make soap request from my app, and get xml response from server then i can parse the results. This means that you will be storing your answers dynamically in your database, so no one can tamper with them unless they hack database. It is also advisable to use dynamic puzzle question, i.e, store the puzzle questions in an online database so that you can update them without having to go back and update code in the app.

Related

How to prevent the sensitive data used by app in android?

As we all know Android app apk file can be drilled down to get the Java codes and resources. The sensitive data used to populate lets say list view used as arrays in Java files can be easily hacked.
What are the secure ways to do it?
I guess downloading XML or JSON file from the internet and using in app? Or there any other techniques?
Thanks in advance.

Android - Google Drive REST API - Adding a row to a CSV file

This question concerns adding a new row to a CSV file that exists in Google Drive using the Google Drive REST API.
On my Android device, I have a CSV file that I am building locally. If I add a row to the local CSV, I want to also add that row to the CSV that resides on Google Drive.
I've got the fileId of the CSV, and I can PUT the file to do a direct replacement, but I'm trying to save bandwidth as the file size grows.
I have been looking into JSON Patch as the transport to perform this, but I cannot find a concrete example after looking for days. For instance, how does JSON Patch write to the CSV file? Is the "path:" parameter the column header? Is a "op", "add" needed for each column?
I just need to pointed in the right direction.
To my best knowledge, it is not possible. You are trying to append (modify) the content of a file and the only way I know of in both the REST Api and the GDAA is to get the content, modify it and upload. It is possible that GDAA may (one day) internally do some diff / incremental optimization, but I doubt it.
My rational for this guess is that the content is being shipped as base64-ed, gzip-ed, ... binary stream with no embedded knowledge of the mime type, so the 'append' functionality would get quite complex.
The PATCH functionality you'r looking into deals only with METADATA (title, mime, modi-dates, parentIDs, etc...). See the fields available in Try it! on the bottom of this page.
Good Luck
In case anyone else comes across this question, an alternative solution (which doesn't involve switching to using a Google Sheets file) would be to move the read-modify-write API calls to a small service hosted on Google Apps Script and call that service from your application using the recently-announced Execution API.
You would call the hosted script with the new row to be appended to the file, and the script (running in the cloud and with very fast access to the Drive API) would get the file content, append the new row, and then save the file back to Drive. This would save bandwidth between your mobile application and the hosted script.

Android App to talk to a web server, download a file and parse

I am new to this. I have the Android SDK installed with Eclipse. I can work with basic activities and layouts.
I am looking to write this Android application that will;
1) Allow users to sign-in using a pre-allocated password.
2) Login and change the password.
3) Every time the user opens the app, he downloads a CSV file from a server to the SD card.
4) The app parses from the file and displays them on several activities and small frames inside the app.
Think of it as an informational application. But, I'd like to add some intelligence on top of it after I get this done.
I have read many articles and topics but none of them give me a specific approach to do this faster. I have very little time for development.
If there's a similar application that you're familiar with, I'd like to take a look at the code.
I want to know exactly (the code) on how the communication between the app and a linux based server on the web needs to be established. Right now, there's only a CSV file (or an EXCEL file - which one's better to parse? How to decide?) there.
Also, when the CSV file is up to date, I wouldn't want it to download the file again. How to prevent it?
As I said, I am new - so please be patient.
Thanks
If you are new to this and want to develop something fast, why do it the hardest way, in java? There are so many easy toolkits out there, e.g. RFO.Basic, you will be amazed how much you can achieve, fast, that way.
(You asked several questions) Easiest to parse? If you don't have Excel installed on your Android device, the CSV is of course easier to parse, needing only text tools. However, if you have a choice of formats, why not use XML? If you have never worked with XML, there is a little learning curve, but there are lots of tutorials on the web. After that, you'll never want to go back to CSV.
Your last question: how to prevent download of unchanged file? Is this about a big file? In that case start with quickly downloading the hash (checksum) of the file, so that the client can decide if the file has changed.

How to fetch xml from web services and save it in assets

I am developing an android app and in that I want to use a XML file. I think its a kinda web services and i want to use it in my app. so first of all i am thinking that whenever I open my app it fetch the whole XML file from http://data.gov.in/sites/default/files/Date-Wise-Prices-all-Commodity.xml and save it into assets folder of my App and then after I will use this XML from my assets folder.
I know this stuff is not too much difficult but actually i am new to android that's why getting this type of problem.
Please help.
Thanks in Advance.
You can't. The assets folder is read-only at runtime.
Pick a different location to save your data, see Data Storage for more information.
As posted in other answer you have to choose different location.
Rest method is as following.
Make a method or class to make http request.
Get response from given request.
Make a xml parser (DOM Parser,Pull Parser or SAX)
these are the basic steps. hope it will help.
Check this tutorial

Can I use an sqlite database created for ios in android?

I would like to access the string-files stored in an sqlite database created for an ios application.
Any suggested methods to do this? I have searched all over the net but have not found anyone who has done this.
I know it is possible to convert a plist file to an xml file, but in the future the app I am working on will get all the resources (including strings) from a server.
I hope someone can help with this.
You could just include the SQLite database file as an asset in your app then use it like any other SQLite DB in Android.
You then mention that you will get resources from the server and I assume from your question that the data is currently in pLists so I think there may be 2 questions in one?
You might consider using JSON which, in many cases, is much faster than parsing XML. I recently used "Sublime Text" to convert a bunch of plists to JSON. It did a great job. v1 of my app parsed pLists. I tried SAX, DOM and the pull parser to find the quickest (SAX in this case) but, after conversion to JSON, v2 of the app is much, much faster. I haven't measured it because I don't need to. The user experience is enough. Where I previously had to use a loading progress dialog on a particularly large pList, with the new JSON parser, the UI is responsive at all times.

Categories

Resources