using android studio,Android Library Project using Android Studio

Purpose: Android library at single place - Share across multiple projects

Following are the steps:

Create new Android studio project. I have created one with name "Libraries"

Create one new module File->New->New Module

As shown in pic below, I have added one new module named "androidutils"

We can create as many modules as we want. Each module will be like different library.

Open the other project in Android Studio, where you want to use the library "androidutils"

Change the navigation view to "Project"

Open settings.gradle and make it look like below and Sync the gradle

In above picture, we are telling gradle to include the module androidutils and also telling where to look for that module

After syncing gradle, you would see your module in the navigator

But at this point you won't be able to use it in your app.

Open your app's build.gradle. Highlighted one in below picture

and add following line in dependencies section and sync again

compile project(':androidutils')

Now you should be able to use your library in your project

Tip: Keep Libraries project open in separate instance of Android Studio

HIH

RD

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值