Skip to content

Setting up the package

Sarsa Murmu edited this page Jul 17, 2021 · 4 revisions

Requirements

  • Latest version of Android Studio
  • Android SDK Build Tools 31
  • API 30 SDK Platform
  • Latest version of Android Support Library

1. Download sample project

First, download the sample project. Click here to download the ZIP, save it.

2. Import Project to Android Studio

  • Find the file that you have just downloaded. Extract it (You can find something like Extract Here if you're using WinZIP or WinRAR). Rename the folder with whatever you want. This folder is our project folder.
  • Open Android Studio. Choose Open Existing Android Studio Project. Choose your project folder.

Let the Gradle sync for the first time. Wait until it finishes.

3. Changing package name

  • If you're using Android View open the following directory app/java. If you're using Project View open app/src/main/java.
  • Right-click on it. Choose New > Package
  • Enter package name, and this will be our app's package name. Ex. com.yourname.appname.
  • Select activities, applications, licenses and services packages. Cut them (Ctrl+X). Paste them into your newly created package. Delete the blank package.

4. Changing package name in other places

  • In Android Studio go to Edit > Find > Replace in Path
  • In the first text input box write com.candybar.sample and in the second input box write your app's package name
  • Choose In Project
  • Click Replace All
  • Do Gradle Sync
Clone this wiki locally