1

I'm sorry if this has been asked, but I can't seem to find it. Coming from iOS, in Xcode, you can create a new Framework (SDK) project. In Android Studio, I cannot for the life of me figure out how to do that. I can create a Project, and then create a new module, Android Library. Is that the only way to do it? To do it with an accompanying "app"? I couldn't seem to find any other way.

Also a side question, is there a reason why if you name a project my-project, it creates packages as com.mycompany.my_project. Is there any way getting around that besides naming your project as MyProject?

halfer
  • 19,824
  • 17
  • 99
  • 186
Crystal
  • 28,460
  • 62
  • 219
  • 393

1 Answers1

1

The "Android Library Module" is actually equivalent to Xcode framework concept.

Android Library Module

Is that the only way to do it? To do it with an accompanying "app"? I couldn't seem to find any other way.

At the moment, yes, creating a project then creating a new library module and deleting the app module is the easiest way.

This link Android Studio Rename Package tells how to rename the package name.

For how to change application ID, see here: https://developer.android.com/studio/build/application-id

android {
    defaultConfig {
        applicationId "com.example.mylibary"
        minSdkVersion 19
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    ...
} 

Also note that, Android Library project does not have applicationId.

shizhen
  • 12,251
  • 9
  • 52
  • 88