Read, write and print xlsx file in raw resource folder android - android

I want to make an app which can print bill invoices. I had made a basic layout in xlsx(excel) format leaving the places(cells) for inputting data according to different bills. For that I had put that xlsx file in raw folder and with help of apache poi library, I can easily read the file data. But now i want to update specific cell data in same file(in raw folder) and then print that with help of my app i.e. So that there will be no need to open excel file at all, just fill the information in edittext and press button to print bill. Is there a way to do so? I have browsed through lot of existing stackoverflow threads but none of them are helpful.

Related

How to add markdown's image folder in a sqlite database?

I'm writing an Android application that consists in a collection of university notes taken in markdown.
I would like to save these notes into an sqlite database, in such a way that, when I will write new notes or modify old ones, I'd need simply to upload the new files in the database and update the db version in the app.
I'm able to add a table in my database whose tuples contain the plain markdown I wrote.
Though, I would like to be able to load in the database the "image" folder in which I have put the images I refer to in the markdown files.
----------------------------------------------------- EDIT 1 ---------------------------------------------------------------
In case I've not been clear, let me give you some context:
I have a folder in my PC in which I've put many markdown files.
In the same folder I've created a folder called "imgs", and whenever I want to add an image in any of the markdown files I write something like this within the markdown file:
<img src="imgs/image_name.jpg">.
Let me show you what it looks like:
the folder where I've put all my markdown files and the image folder
So, suppose I've just downloaded the picture of a cat and called such picture cat.jpg.
Suppose I want to add this picture in the markdown file called 1_introduction.md.
I would simply put the image in the folder imgs and write in 1_introduction.md the following:<img src="imgs/cat.jpg">
What I've explained above is simply what I've always done on my PC for the last couple of years: I wrote plain markdown files and saved images into a folder (as probably 99% of people do when dealing with markdown files!)
NOW I want to store these markdown files (and obviously the imgs folder as well) into the database of an Android application.
MOREOVER I want to be able to modify the content of these markdown files (locally, in my PC. I don't want users to be able to modify these files) and give the possibility to the users of the Android app to retrieve the updated content simply by updating the app (NOT reinstalling it).
my final questions are:
is there any approach suggested by the Android community to handle this scenario? In case, what is it?
In case there is not, is it possible to save the imgs folder in the database, along with the markdown files? and, if it's possible, how should I modify the html tags <img src="imgs/image_name.jpg"> in order for it to work?
The other alternative would be to save the folder that contains both the markdown files and the imgs folder in the folder assets, but wouldn't the user need to redownload the app in order to witness the changes I'd make?
Thank you in advance!

Most efficient way to store text and media in android development

I have an application that I want to develop. The android application is more or less like a book that will allow the users to select a chapter and it will display the whole text in that chapter and a media file for the chapter. Where do you think I can store the text and the media. Should I use json format or sqlite database or I should store both text and media in a folder and access it there. Am really confused because I still want to be able to perform some query on the text search for the text in my application.
You can use binary files, where you load the data sequencial.
Or you use zip-files, in which format many programs store data. Eg .svgz is a zipped version of .svg used by Inkscape, .odf is an open source format used by eg. OpenOffice or LibreOffice (the specification says it could be either a XML- or ZIP-structure.) You can store the text in a file, where in the text it references to other files like images in the zip, like a html-file references to other files on the server in the directory. This can be a json-file or an xml-document or a binary-serialization of an object-structure. There are many zip-libraries out there,. It is a big security risk, if you do not check in the file for references to other files outside the zip, like '../../Documents/myPasswords.txt' (when you are on Windows for example and you use the %temp% directory, this may reference to 'C:/Users/BOB/Documents/myPasswords.txt' when the directory where you unpack to is '%temp%/randomName/'), when unpacking the data to a temporary directory and load a file (however different operating systems treat this differently, Android is more secure than Windows, but the app can crash if you do not check...).
But if you do not care about filesize and if you store the data directly within the app (and not download them from the internet), you just include it in your data-folders.

How to Use Android SkyEpub content provider to use an stream

I want to use skyEpub SDK in my Android application to show my Epubs.
I'm Encrypting my epub files in SDCard and never want to extract them in any physical place (because of security reasons)
I know how to read and decrypt my file into a byte array. But My problem is that I don't know how to send it to the sdk. I've traced the sample project and found that it extracts the epub file into a directory and then use it , but I don't want to extract raw files in sdcard ever!
I founded that I should implement ContentListener and do something in it but don't know what exactly should do.

understanding Android application cache files

I understand that the cache is data that is temporarily stored from a specific app. Opening /data/data/com.blah.blah/cache/ using a root file explorer reveals these cache files to me. I am able to open and view those that are an image, but when opening a non-image cache file - usually with a text editor - I get a bunch of Chinese looking characters... I know that basically the apps cache is only viewable by said app, but is there any way to convert file to a human readable text file?
but is there any way to convert file to a human readable text file?
Contact the developers of the app and ask them.
There are a dizzying roster of possible file formats, even among "standard" types. Any given computer program might use one of those file formats, or invent their own, or use one of those formats but encrypt the file, etc. There is no requirement that all computer files contain human-readable material. For all we know, the developers of this app are storing random numbers in these files, specifically to confuse people who try to reverse-engineer their stored data.

Creating an array list of names on SD Card Android

I am in the process of developing an android app, and I need a way for the user to enter a Name and then save this name to a .txt file in the SD card. When the user adds another name, this file should be modified to include that name. I was thinking of an array list, but I've been trying for some time on things to use but I'm not sure how. (I don't think an object output stream would work(?)). Also, I need the user to be able to read and access this file within the app.
Thanks in advance for the help.
Is there a certain reason why you are using a .txt file? I would suggest you use a SQLite database for this particular project.
EDIT: Here is the one of the best articles you can find on building SQLite in android.
Building a Database For Android

Categories

Resources