How to create your own library for Android development to be used in every program you write?

后端 未结 5 1386
Happy的楠姐
Happy的楠姐 2020-11-28 02:37

I am a Delphi programmer and have written, over the years, hundreds of classes and routines which I can use in every Delphi program I write.

This library

5条回答
  •  情歌与酒
    2020-11-28 03:09

    If your library is in .java files composed of java code. There's a really detailed tutorial of how to use the library at mobile.tutsplus.com. Link below:

    http://mobile.tutsplus.com/tutorials/android/android-essentials-creating-android-compliant-libraries/

    For Example I wanted to use the Pull To Refresh library by Chrisbanes at Github.com here https://github.com/chrisbanes/Android-PullToRefresh/tree/master/library. The library's structure is in the form of an Android app. It has the form like below:

    res/
    src/
    AndroidManifest.xml
    pom.xml
    project.properties
    

    How to use on Eclipse:

    1. Create new project in Eclipse. Give a name to your project. Select "Create project from existing source". Select the location of the root folder containing the above mentioned files in "Location". Select your target and click finish.
    2. Select properties of the newly project you created. Select "Android" option. Select the "Is Library" checkbox if it's not already selected. close properties.
    3. Add a reference to the library from the project that is going to use this library. Select your project that uses this library. Open Properties. Select "Android" option. At the bottom on the "Is Library". Don't select checkbox of "Is Library". Click "Add" button on the right. Your project that you created on step 1 and 2 should be listed ready for selection. select it and click apply. close properties.
    4. You're ready to reference the classes from your project.

提交回复
热议问题