Thanks Mark! I'm guessing the that creating the library as an Android project is simply to allow a dummy front-end for testing?
On Oct 2, 8:21 pm, "Mark Murphy" <[email protected]> wrote: > > I'm building an app where I want to architect the app layer separately > > from the service layer (not android services). So I'll create a > > service interface(the apis) and then create a class(es) that implement > > that service interface. Inside the android application layer, I want > > to code to just that service interface. > > I think this is similar to how the google maps apis works. the api > > interface and stubs are in the framework, then each device actually > > provides the implementation. > > I don't need to go that far, but I am wondering how I package this > > up. > > One, where would I put these interfaces, so I can code to them in the > > app layer (like Activities). Second, how do I tell Android where the > > implementing classes are? I'm guessing this is somewhere in the > > manifest? > > For now I think I would probably just build the service implementation > > with the application source code, if that's easier. Eventually I'd > > like to break that out and drop it in as a 3rd-party jar. > > > Thanks for any guidance/insight! > > For something like that, it's not terribly special. Here is the recipe I use: > > Step #1: Create an Android project for the reusable library. > > Step #2: Create the library, plus a sample app for testing. > > Step #3: Add a "jar" task to the Ant script to package up the compiled > classes in JAR format. > > Step #4: Reuse that JAR the same way you would reuse any JAR in Android > (i.e., put it in libs/ of the target project, and if using Eclipse add it > to the build path). > > All of the CommonsWare Android Components (CWAC) follow this model: > > http://github.com/commonsguy > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > Android App Developer Books:http://commonsware.com/books.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

