Android - Java Packages & Libraries

152 views Asked by At

I want to be able to use the Open Source AOSP Material Design Calculator into my own app where the calculator is one of various other features on my app. I found the code here. My question is the following:

  1. Is it possible to add this open source calculator to my app by simply installing it as an additional package in my app codebase? If so I would like to request some basic overall steps on how to do so. Should I just import it in my project as another package? What do you foresee being some of the steps on how to achieve this (Android Studio specifics).
  2. As the calculator is consider to be AOSP and open source, would it be ok for me to add this package my my codebase? If so what are some of the notifications I as a developer must put on the app to inform users that I'm using an open source project as part of my app. I'm assuming this is required.

In the end my app will have many features where the AOSP Calculator will be one of them. This calculator will be reached via an intent and the user should see the calculator with the same functionality except it will be visually redesigned. The whole point of open source projects is so that developers don't have to reinvent the wheel every time, with that in mind I look forward to any feedback you may have about these questions.

1

There are 1 answers

0
George Daramouskas On BEST ANSWER

I was having a similar issue in the past. The following steps will ensure that you can integrate this app as a library in your project.

1) Clone the project in your local machine (git clone ...) 2) The project is build using Gradle. Before you do anything go to the build.gradle file and create this task at the end of the file:

task copyDeps(type: Copy) {
    from configurations.runtime
    into "${buildDir}/libs"
}

3) Now fire up a terminal and navigate to the root of the Calculator project. Type gradle --refresh-depencencies in order for gradle to fetch a couple of jars needed by the Calculator project. When this finishes, type gradle copyDeps in order to copy the dependencies to the project's libs folder (if the folder does not exist create it).

4) Now that the project is ready open your IDE (mine is Eclipse but the steps are pretty much the same). Import the project and then mark it as a library to your project

5) Now upon deployment the Calculator will be packaged with your application and you will be able to fire Intents and open it (check the calculator's manifest file.

As for the Calculator project, yes you have to include somewhere a simple notification. For more check here.