Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Best way import module from other repository

I have to import a project from a Github repository as a module inside an Android Studio project that it committed into another repository.

The project I have to import from Github will be updated constantly so it means that I'll have to refresh every now and again for having the latest changes done on the module.

Since the new module as the base project will have independent development, which is the best way to import the module? should I check out the Github repository inside the Android Studio folder?

Thanks

like image 896
Jose M Lechon Avatar asked Jun 12 '15 08:06

Jose M Lechon


People also ask

How do I import code from another repo?

In the upper-right corner of any page, click , and then click Import repository. Under "Your old repository's clone URL", type the URL of the project you want to import. Choose your personal account or an organization to own the repository, then type a name for the repository on GitHub.

How do I import an existing repository?

Select Repos, Files. From the repo drop-down, select Import repository. If the source repo is publicly available, just enter the clone URL of the source repository and a name for your new Git repository.


1 Answers

I'd advice to use Jitpack

Jitpack: Easy to use package repository for GitHub, just include it inside your gradle, and now you can deal with github project as a module

Thanks Jitpack <3


For example: we have this repository: https://github.com/florent37/MaterialViewPager

and with Jitpack in your gradle:

repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
        compile 'com.github.florent37:MaterialViewPager:1.0.5'
}

And you can use it with private repositories, but it require signup/login

like image 115
Mohammad Ersan Avatar answered Oct 09 '22 03:10

Mohammad Ersan