0

I want to use a svg-android library to work with *.svg files in Android. For the same, I've installed the apache ant, created a folder in workspace called: SVGAndroid and then added

android.library.reference.1=C:\Android\workspace\SVGAndroid

to project.properties file.

There were no documentation for functions in ReadMe, so I'm wondering if the installation correct or not, how to reinstall an external lib in the second case and where are the examples of using svg-android?

Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
user2136963
  • 2,526
  • 3
  • 22
  • 41

3 Answers3

0

For your including of the project, just include the project into your workspace and in your respective application under the properties of that project just add a dependency on a library that references svgandroid. Make SURE to include the files and ensure that the compile class files are present in the final output of the apk. This typically means that you add the project to your build path/order.

Another approach is to just take the entire project and compile it into a jar file and then include that jar in your libs folder and add that dependency on the jar file of that respective project to your core application.

Useful links

How can I use external JARs in an Android project?

Community
  • 1
  • 1
JoxTraex
  • 13,423
  • 6
  • 32
  • 45
  • And how to add a dependency on the jar file and check if it is made right way? – user2136963 Mar 06 '13 at 11:19
  • check the final apk by decompiling or just ensure that its in your build order/path. – JoxTraex Mar 06 '13 at 11:20
  • @JoxTraex AFAIK it is not possible to compile an Android project into a `.jar` file. – niculare Mar 06 '13 at 11:23
  • The facebook project can be compiled into a jar file. And a lot of this is done with third party libraries, it's very common.. check chartboost, AdX, etc.. Each of these are third party android projects that come in the form of jar files. @niculare – JoxTraex Mar 06 '13 at 11:24
  • "And how to add a dependency"? – user2136963 Mar 06 '13 at 11:26
  • Please excercise your google-fu and look up these key words in a statement... http://stackoverflow.com/questions/1334802/how-can-i-use-external-jars-in-an-android-project – JoxTraex Mar 06 '13 at 11:27
  • @JoxTraex I have seen [this](http://stackoverflow.com/questions/9868546/android-how-to-export-jar-with-resources) about exporting an android project as a .jar file, but you say some projects can be exported. Are some special conditions for those which can be exported as a jar file? – niculare Mar 06 '13 at 11:43
0

I would rather suggest to not add the path to the project manually, but from Project Properties -> Android and you will have a list with all the library projects in the workspace from which you can choose the desired project.

Also I suggest adding in project.properties the following line:

manifestmerger.enabled=true

in order to have all the AndroidManifest.xml files of the referenced library projects merged into the main project's manifest.

niculare
  • 3,629
  • 1
  • 25
  • 39
0

If you want to include a library file in to your project follow the below steps;

  1. Download a jar file and save it in any folder.
  2. open your project.
  3. Right click--> Build path--> Add External Archives---> Add your external jar file to your project
user1835052
  • 455
  • 1
  • 5
  • 11