Android: How to let my users print data from the app - android

I have some data in my app that consists of text and image. I want to allow my users to be able to print that data.
Here are the options that I am thinking of:
1) Convert data into HTMl format and allow users to email and they can print from their desktop. This will be zip file with html and images. Pros: can be easily coded. Cons: not sure if users will know what to do with zip file.
2) Convert to PDF. But I have read on forums that iText won't work on Android. So any other options to convert to PDF? Pros: PDF can be easily printed. Cons: have to figure out a way to convert to PDF.
Anybody has tried allowing their users to print data? What are the options

There is an Android app called PrinterShare that allows you to print from the phone, but I think that just prints whole documents.
To do this yourself you would want to have some sort of server on your desktop machine which uses the Java Printing API to send your document to a configured printer. I am just brainstorming here... there are a lot of details to fill in. :-)
Good luck and I hope this helps a little.

Related

How should I approach being able to retrieve images and description data in my React Native App offline?

I am building an app which will contain a large number of photos (200+) and about 100 descriptions of text. I need to be able to fetch and retrieve the photos and text and display them in my app however my client wants the app to be able to run offline without having to connect to the internet. I'm assuming I will have to embed the images and text data into my app itself. But I'm still new to this and was wondering what are my approaches to this and what kind of Backend I will need. The Images are in a form of png, and the text can be given in any form (pdf, docx, csv, it doesn't matter as I can always convert it).
Sorry if I am not being to specific, I'm still new and trying to figure out how to implement the data into my app.
Thank you so much!
You can store all of your stuff in arrays - or if you’re accessing them by name, objects. Text should be strings. For images, I usually put the .pngs in a folder and in array use
[`require “(pathToImageFolder/imageName.png)”,require”(pathToImageFolder.png)”]

Converting PDF to text and reading it from android

I am currently working on an android application that will allow people to read the constitution, issue is I have only managed to get my hands on a soft copy pdf document. Ideally, I wanted an API that would allow me to fetch the document by Topic, issue or paragraph, I thought of multiple ways of getting the job done
1. Is by putting the document on the server, when user opens the app it downloads the pdf and allows them to read it(Problem with this is I won't be able to mess with the content like bold some text etc).
2. Is copying the content of the pdf into the databse and just fetching the text with a query(issue with this is I wont be able to do pagination given I put the content in one field)
Here is the link to the Constitution I needed a way in which I can load the data from the database in a way that I will be able to paginate, load a single paragraph or topic at a time. Can anyone whose been in a similar situation help me figure out the best way possible.
You don't to convert it to text, you can integrate MuPdf in your application check this answer I've found integrating pdf reader

Codenameone creating printable documents

In my codenameone app (ios/android) i want the user to be able to print out what is rendered on the screen. This could be tabular information or maybe a certificate of their achievement.
But what options are open to me get that screen content onto A4 paper?
FYI to generate the formatted screen, the app will have received the JSON data from a Dropbox MySQL database, and then formatted as normal.
From reading this forum, I know that direct print is not a feature of apps, so my next route is to use the ShareButton object in CN1 and get the user to basically export the screen content to a 3rd party app, which can print. But this is limited to text strings or photos (not both) and so a tabular screen would not export correctly. I also expect that doing this from an iPhone to the Mail app would not be fit for A4 size.
The mobile browser does this very well by being able to export to the PDR reader but that PDR reader isn't an option when exporting from apps.
Thanks in advance.
Recent versions of Share allow sharing both text and an image as far as I know so this should work. Generally the most common approach I've seen is to generate a PDF on the server and then use Display.execute() to run the PDF file which launches the OS native viewer.
I know some folks did some work on print integration based on questions asked here and in the forum but I don't know if they succeeded. There is nothing contributed back as far as I know.

Building an offline android app with data from pdf

I have data in the pdf format(Not in english). I want to load the data to my app and app will be offline. What are the elements i shall be using in android to make the app which is like reading data chapterwise? As the data i have is huge,how to load it offline from pdf? What is the efficient way?
This is reference link for the app:
https://play.google.com/store/apps/details?id=com.winjit.hclite&hl=en
Getting the text of a pdf is a hard task in android. You can check this other similar questions to this topic which all have no straight forward answer: Link, Link, Link.
If you cant workaround this there are commercial libarys out there which you can find pretty easy with your search engine of choice (I don't want to promote them here).

Android - write Website HTML to text file

It is my beginning with Android and I would like to write an app to connect with certain website, then save whole html of this website to some text file. I need this to later purposes such as extracting some info from html and so on. Do I need to do it using WebView?
Details: The website contains job offers. I need to make a connection with fields responsible for description and location of a job, so my application can fill those fields. Next step would be listing all the results.
Please lend me some advice :)

Categories

Resources