Can anyone recommend a good source (either a tutorial or book?) on how to generate a .doc file from an Android App?
I am completely new to programming and don/t understand most of what I read as answers here, hence the need for a recommendation: I need to learn!
What I'm after is to be able to produce a document based on a standard template, containing a choice of standard paragraphs with user insertions, which can then be emailed, all from a smart phone or tablet.
Unfortunately I think you have a research task on your hands. If your requirements allow you to create an Open Office XML document then its possible to insert the user's paragraphs 'by hand'.
An Open Office XML document is just a zip archive with XML files inside of it. Unzip the template document using java.util.zip and locate the word/document.xml file inside. Insert the user's text using the DOM and persist the file.
Another approach would be to try to get docx4j integrated into your Android project. My guess is that this project reference many libraries that are not included with the Android SDK.
Good luck and hope this helps.
Related
I'm using justinMind and I get .vp file.I am able to convert it in .html file but how can I convert it in .xml or .apk?I have tried to convert .html to .xml by using .tidy but It doesn't give me proper layout in my androidstudio.
I don't know this SDK, but from I quick search, I found this post on there forum :
https://www.justinmind.com/community/topic/can-justmind-export-the-prototype-directly-to-the-android-studio-project
For long term save, here is the two post :
Question : I can use the software for simple designing and prototyping. It will reduce the app build time if there is a way to export the files as an android studio project. Is this possible?
Answer
Hi there,
Unfortunately that is not possible. However, you can utilize the
generated CSS and Javascript, which may help reduce app build time.
Best,
Danielle
So you need to use the generetad HTML/Javascript/Css files with a WebView. So no, you can't create a project, only the HTML files.
My next project is writting an Android application that would support reading EPUB version 3 files.
I wont be able to use any libraries (that would support this) since i need to write everything from scratch and i cant find any good "starting point" of how to read epub files, how to show them in webview and so on.
So are there any tutorials or how to parse through this epub 3 format and show them in webview
in android.
Any help would be appreciated.
Thank you
I suggest breaking down the problem into smaller pieces that you can research individually:
EPUB uses zip as its container, so you'll need a way to read zip files. If you can't use a library for this, then you could roll your own unzip code. (Example)
Parsing EPUB. If you can't use a third-party library, then you'll need to read the source code for an EPUB library, learn the algorithm(s), and then implement them yourself. The format is based on XHTML, CSS, etc., and should be straightforward to display in a WebView once you understand the layout of the files.
Display the output in a WebView. You can either point the WebView at a local file or pass the markup for a given page directly using WebView.loadData().
I have an iOS App localized (with Localizable.strings files).
I've built now an Android version. I understand the way the i18n is made on android but I would like to avoid redoing the i18n, as almost all the Strings have the same meaning between iOS and Android.
Are there any tools that will do this conversion, or at least speed up the process?
Edit:
Ideally I would like to find a method/tool that would do the following
Input:
'iOS Localizable.strings files-(en,fr,it,pt,etc)'
'res/values/strings.xml'
Output:
'res/values-en/strings.xml'
'res/values-fr/strings.xml'
'res/values-it/strings.xml'
'res/values-pt/strings.xml'
'res/values-etc/strings.xml'
There is a specialised service here: Loco.
There are threads here on SO which deal with conversation:
Are there any tools to convert an Iphone localized string file to a string resources file that can be used in Android?
Any tool to convert Android's XML localization to iPhone's .strings file?
Another possiblity would be to use an online translation service. These services accepts text not only in Android and iPhone but also in many other formats. Upload the android text and download the iPhone text. A list of available services can be found on SO, see Any collaborative tool/website to localize an Android app? Some of these services are commercial, but even these provide a 30days test period. But note that the main focus is on translation and not on conversation.
Here is some code that does that: https://github.com/wrapp/LocalizedStrings2Android
Put it in a jar and it is ready to use.
You can use this tool I created on JSFiddle:
https://jsfiddle.net/danielgindi/x9njj9gj/
[StackOverflow requires me to write some code here because of the JSFiddle link]
Just paste in your localization strings inside the correct box, and you'll get the converted version in the other boxes (Between Android, iOS, and JS).
This tries to preserve comments too.
Cheers!
I am working on a client project for an android app and wanted to confirm if the designed solution appears to be utilizing the most appropriate technology and resources.
The application gathers data from the user via a series of questions, compiles the data into a single human-readable document, then sends the document out via email. My client requires the delivered doc to be in MS Word format. I am currently building my doc in the app using xml, setting the extension type as ".doc", then sending. Since the latest versions of MS Word seem to have no problem handling these types of files, this seems to be the most appropriate solution.
Is there anything obvious that I am missing? Should I be handling this another way?
You aren't writing DOC files correctly. If really need to save .DOC files I suggest you read this .pdf regarding thd DOC file format put out by the OpenOffice team.
As you are already writing the file in XML consider using Microsoft's Office XML format instead of writing the XML to a .DOC file.
Is there a definitive method of creating either a PDF or a MS Word Doc file within the app and email it immediately (and possibly, also store it).
I have been trying for quite some time and have found out the JAVA libraries: apwlibrary and iText. But both of them dont provide any tutorials of sorts.
Could anyone point me in the right direction?
EDIT: Come to think of it, is could an online PDF generator be used, first by sending the data to the service, then retrieve the result and save it on the phone?
I would recommend apache fop http://xmlgraphics.apache.org/fop/
you can use standard FOP to generate pdf.
Unless it is a core feature of your device to create a pdf file I would suggest not to do it yourself. Adding PDF creation is going to be quite a lot of work potentially depending on your performance needs. Java libraries will be easier to add but less performant. Native libraries combined with Java will be more hazzle to maintain build and bug fixing wise.
If you just need to email some information why dont you create a message text in html and use a intent to email it with the build in email program instead? Or if you want you could e.g. put the PDF generation on a server and just email a link..
I'm working right now with JasperReports, an open source library to create reports in Java and export them to PDF, DOC, XLS... Using it in conjunction with iReport to create a group of templates makes it really easy to create files filled with content from different types of sources (I'm using JavaBeans).
If you don't like the idea of having static templates (That's a bit annoying depending on your needs), you can always take a look at DynamicJasper (The examples on the website are great).
Good Luck!
I have used Apache POI. It seemed to work well. http://poi.apache.org/
This actually, http://poi.apache.org/hwpf/