Skip to content

Create a Package

Patryk Michalik edited this page Apr 11, 2022 · 7 revisions

The package name is an internal namespace for your code such as com.example.app.

Add a Package

Right-click on /app/src/main/kotlin and select NewPackage. Name the package:

  • Segments are separated with full stops.
  • In segments, only alphanumeric characters and underscores are allowed.

Note
Segments are translated to directories, so com.example.app becomes .../com/example/app.

Move Files to the Package

Expand /app/src/main/kotlin/dev/jahir/frames/app (that’s dev.jahir.frames.app—the default package) and cut all four files located inside. Paste these in your package and delete the default package directory.

Connect the Package

Edit package in /app/src/main/AndroidManifest.xml to connect the newly created package.

package="dev.jahir.frames.app">

Note
In case of issues, select FileInvalidate Caches, check Clear file system cache and local history, and click Invalidate and Restart.