Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make an app use a module outside of its own folder, by linking to it (instead of copying)?

This is a very short question:

I've made a module that exist in one folder, and I'd like an app I've made use it, without the need to really copy its content.

In short I do not want duplicate folders of the module.

Is there a way in Android-Studio to make an app's project link to a module, so that changes in the module's code will immediately be reflected for the app's project ?

like image 637
android developer Avatar asked May 28 '15 22:05

android developer


People also ask

How do I import library to Android?

To use your Android library's code in another app module, proceed as follows: Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Library Dependency in the dropdown. In the Add Library Dependency dialog, use the search box to find the library to add.

What is external libraries in Android Studio?

You are developing an Android app on Android Studio, sometimes you want to use an external library for your project, such as a jar file. Common langs is an java library with open source code which is provided by the Apache, it has utility methods for working with String, numbers, concurrency ...

How do I get a list of audio files in a specific folder on Android?

id. mylist); myList = new ArrayList<String>(); File directory = Environment. getExternalStorageDirectory(); file = new File( directory + "/Test" ); File list[] = file. listFiles(); for( int i=0; i< list.


1 Answers

Yes you can!

Inside your settings.gradle add:

include ':myModule'

project(':myModule').projectDir = new File('../../MyOtherProject/modules/myModule')
like image 75
einschnaehkeee Avatar answered Oct 10 '22 01:10

einschnaehkeee