Reputation: 6371
I want to add library, android pdf writer to my project to create pdf documents in the app. Below link has some files associated with the library. http://sourceforge.net/p/apwlibrary/code/HEAD/tree/
I would like to know, 1. How do I access/add these files to my project? 2. Since I only want to generate a pdf document there is a file in there called PDFWriterDemo.java, could I just add that to my project or do I have to add all the files in the library?
Sorry I couldn't find the documentation on how to add them to project to use these files. Thanks
Upvotes: 0
Views: 4897
Reputation: 1539
(Using AS 1.2 Beta at time of writing)
You first need to download the source code since there is no jar. To do that:
Then, to add it to your project, it depends on if you are using Gradle.
From there, an Android module is created with all of the necessary resources. I chose to delete all of the extra file that AS creates for you but that's your call. Make sure to keep the manifest (I emptied it though to just have the Manifest tag since nothing else was useful). You can then declare the dependency on this module from your main one like you would normally.
From there, the Android module is created (make sure that the Module SDK is an Android one) and you can add a dependency the normal way as well.
This isn't the best way to do things, but I see no alternative for this particular library. Hope this helps !
Upvotes: 1
Reputation: 9
There is no jar file. You have to embed source files directly. You should include all the source files except for:
You don't need any additional jar file.
I write detailed instruction here: http://karino2.livejournal.com/293016.html
Upvotes: 1
Reputation: 10839
Get the jar file and add to your project. Just adding PDFWriterDemo.java will not work as this class has dependency on other classes like Page and you might have to include all of them.
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile files('libs/xyz.jar') } Assuming you are using Android Studio, follow these steps to include .jar into project:
.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/xyz.jar') //xyz.jar is the filename of your jar
}
Upvotes: 0