Download PDF file for offline viewing - java

I'm trying to cache PDF files on the user's device and open them within my app at a later time.
With this package: https://github.com/barteksc/AndroidPdfViewer
I use pdfView.fromUri(uri) which loads the file from the URL every time the page is loaded.
Is there a function I can use to cache these files for offline viewing?

Download the PDF yourself, using your favorite HTTP client API. Then, use fromFile() rather than fromUri().

Related

Include better data export option in Web service

We have Java Vert.x project. We have implemented the download button in our Web Service for our users. When user clicks on download button, we would convert the huge data in our database that the user asked for, to excel file, then upload it in AWS S3 and then the URL from the S3 would be sent in response to the user's download request. But this whole method takes time (Especially generating the excel file). Everything is don in backend. Please suggest better approaches than this to implement download option in the page(User has both option to download filtered or complete data that he is accessible to).

How to download file from a "Download" folder using postman or API

In my application, after clicking export icon, the report excel has been downloaded/generated in our local download folder in the system. I have tried to validate this action using service side (API)-postman. When I hit the export api (Application specific) , the response has not contain any path/file name that downloaded in the downloads folder. Is there any way that we can hit the downloads folder using api or any java programming way to get the downloaded excel.
I just want to read the excel data and compare with my input data using postman. First priority that I need to do it using api.
Select "Send and download" action in Postman. According to manual here:
If your API endpoint returns an image, Postman will detect and render
it automatically. For binary response types, you should select “Send
and download” which will let you save the response to your hard disk.
You can then view it using the appropriate viewer. This gives you the
flexibility to test audio files, PDFs, zip files, or anything that the
API throws at you.

Retrieving data from web browser's download manager using java

I want to try creating a program that can automate the storing of web address that is available on every downloaded file on a web browser.
My problem is I don't know where to start.
What am I planning to do is just save all the downloaded file's web addresses in a excel file.
Sample image using google chrome
I think Firefox stores the download history in the places.sqlite file in your Profile folder. You would need to open and read that file, but you probably can't while Firefox is open (it has the file open).
http://kb.mozillazine.org/Places.sqlite
From there, you can process the data in your Java app and then write an Excel file, perhaps using Apache POI (the Java API for Microsoft Documents)
https://poi.apache.org/
Where and how, download history is stored varies from browser to browser . In case of Chrome on Mac it is store in the path
~/Library/Application\ Support/Google/Chrome/Default/DownloadMetadata
as SQLite format.
You need to write an application to parse the data and create xls

Where and how does GAE blobstore stores a file (or blob)?

I am new to Google App Engine. I ran (locally) the sample of GAE bolbstore application given in the below link:
https://developers.google.com/appengine/docs/java/blobstore/
It launched a page to choose and submit a file. When I choose a file clicked the submit button:
i) the browser automatically downloads the same file. Why is it again downloading the same file?
ii) it created two files inside the folder 'appengine-generated'. They are:
d06-XwWoSZVw9HRcnLjZiA
local_db.bin
What are these files and where did my file store as blob?
Don't worry too much about what happens locally on the dev server.
i) It's just part of the demo, it serves you back the file you just uploaded because of this line:
res.sendRedirect("/serve?blob-key=" + blobKey.getKeyString());
ii) The first would I guess be the file you've just uploaded, the second would be the local copy of mySQL the dev server is using to emulate the datastore itself. Try comparing sizes to the original file you uploaded?
Once you have stored the file you have to access it via the api's provided, what form and where the file is actually stored no longer matters.

Android + SQL Server + jTDS

I'm trying to build an android app with connection to our SQL Server. I have downloaded the jTDS JDBC Driver. I have an jar file and have to copy it to my application's classpath. But where is that? I have copied to my workspace in the project directory where the file ".classpath" is. But it seems not to work.... everytime if I'm at the code where I load the class with
Class.forName("net.sourceforge.jtds.jdbc.Driver");
it says:
The source attachment does not contain the source for the file ClassLoader.class. You can change the source attachment by clicking Change Attachmend Source below"
Any ideas? I'm new to java AND android...
no need of that much of mess.
Simply for Mysql Server Data Access or any live server data access.
Make Use of Web Services
Its like prepare a dynamic page that have all the fetched data result from the server. Your android application need to hit that dyanamic page URL and then simply read the content from the streams and use them in your application.
Genrally large amount of data is expressed in xml format which is then parsed from the application See on google about SAXParser
In short its like a web page that will echo your server data after your app hit the url of that web page to read the data.

Categories