Skip to content

Setting up the package

Sarsa Murmu edited this page Sep 13, 2020 · 4 revisions

Requirements

  • Latest version of Android Studio
  • Android SDK Build Tools 29
  • API 28 SDK Platform
  • Latest version of Android Support Library
  • Java SE Development Kit 8

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 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 to 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 First Text input box write com.candybar.sample and in Second input box write your app's package name
  • Choose In Project
  • Click Replace All
  • Do Gradle Sync
Clone this wiki locally