I would like to develop an Android Studio PLUG IN that appears in the New Project Wizard.
I am using Android Studio
Android Studio 3.4.2
Build #AI-183.6156.11.34.5692245, built on June 27, 2019
JRE: 1.8.0_152-release-1343-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.6
The Standard Android Studio New Project wizard is accessed via
FILE > NEW > NEW PROJECT... > "CREATE NEW PROJECT" WIZARD
The wizard presented has five Tabs
"Phone and Tablet", "Wear OS", "TV", "Android Auto", and "Android Things"
I am unable add an additional project in the "Phone and Tablet" window or add an additional Sixth Tab.
I have been success in adding an additional "Activity" type to an existing project.
Is it possible to achieve my desired result?
Or is the "New Project" wizard "Locked Down" for Googles use only?
Old question but since it took me a while to find the answer as well I will leave it here too. There's an extension point you can use now to add your own wizard. Here's what you need to do:
Create a Jetbrains plugin project (use the Github template or something similar).
In the resources/META-INF/plugin.xml add the following extension:
<extensions defaultExtensionNs="com.android.tools.idea.wizard.template">
<wizardTemplateProvider implementation="your.template.provider"/>
Create the template provider class.
The template provider could be something like this:
class MyTemplateProvider: WizardTemplateProvider() {
override fun getTemplates() = listOf(myTemplate)
}
val myTemplate = template {
name = "My Template"
description = "Foo"
documentationUrl = "example.com"
minApi = 21
category = Category.Other
formFactor = FormFactor.Mobile
thumb = { Thumb(path = { <URL to an image> }) }
screens = listOf(
WizardUiContext.ActivityGallery,
WizardUiContext.FragmentGallery,
WizardUiContext.MenuEntry,
WizardUiContext.NewProject,
WizardUiContext.NewModule,
)
recipe = { data: TemplateData ->
val config = data as ModuleTemplateData
// TODO generate the template project
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With