Android Studio only: How to Create a Service-only project? - android-studio

When creating a new project in Android Studio, I am presented with Activity-only type of projects:
https://developer.android.com/studio/projects/create-project.html#Step3AddActivity
I would like to create a Service-only project with Android Studio. How do I do that?

In step 3 select "Add no activity". Android studio will create an empty application. Then add your service(s).

Related

Cannot create new Flutter project

I'm trying to create a new flutter project and start the fist app. When open android studio and click "create new Flutter application", set project name, then click next. At this point, Android Studio freezes.
Click create Flutter App
Set project name and select flutter sdk path.
select design pattern
then click finish
Android studio freezes when I get to the fourth step.
That might happening because of your system configuration. This is the minimum system requirement Google decided for installing android studio:
If your system doesn't meet the minimum above try Installing Visual Studio Code (VSCode) from here. And try to configure your first project through this tutorials.
Alternatively, you can create a new project in terminal..
flutter create <name>
Hope it helps..!
Flutter doesn't tell you, but if you try to run any flutter command such as "create project" or "doctor" without administrator rights your CLI or IDE will freeze.
Try running Android Studio as administrator.

How to set the project type to Flutter in Android Studio

I'm having a problem understanding how to configure a Flutter project in Android Studio. I've done all the Flutter/Dart install steps and I can successfully build Flutter projects. My problem is setting the project so the Project View window in Android Studio sees my projects as Flutter projects and not an Android project. For example, here's a screenshot of a Flutter project I created:
Android Studio Project View Java folder
Notice the Java "coffee cup" on the flutter_app folder and the "[flutter_app_android]" on the android folder. Here's an example of a Flutter project that seems to correctly be identified as a Flutter project in Android Studio:
Android Studio Project View Flutter folder
I've tried creating new Flutter projects in Android Studio and by the flutter create command line. This is driving me nuts and is probably something trivial but I can't find the setting that makes my project recognized as a Flutter project.
Actually I typically use the project view as you have shown in your first image. The Flutter code is in the lib folder. Being able to see the 'android' and 'ios' folders can be helpful if you need to configure something specific like Firebase Cloud Messaging or you need to add channels to your Flutter app to call native iOS or Android code.

Gradle window in missing in android studio for my flutter project

The gradle window is missing in the android studio for my flutter project but it is available for my Kotlin project.
I have to generate the signing certificate SHA-1 to register my app in Firebase.
Here is how you find the gradle section in Android Studio for a Flutter-Project:
Open the build.gradle file in app/src/
There should appear a small bar at the top of the code-editor and click Open for Editing in Android Studio
A new window will open, showing the option for opening the gradle section in the side-panel, as expected.
This answer is giving you a quite extensive explanation for then generating the SHA1-fingerprint.
The problem for Android Studio is that the android(gradle)-project is not top-level.
You can right-click on project- or android-folder, select Flutter->'Open Android module in Android Studio' .
After that the gradle-tab appears on the right and you can use it as intended.

How to develop MobileFirst shell component using Android Studio

I am trying to understand on how to build a shell component native code on Android with MFP 7.1 using Android Studio instead of ADT.
I got the MyProject/components/ShellComponent/android/native folder created after build the component, but there is no option to Run As > Android Studio project. I wanted to add Java classes to run under src. The ADT version uses a separate project tree, but with Android Studio, there is no separate tree.
I also tried to open native folder as an Android Studio project and it shows an empty project.
I ran the ShellDevelopment sample on Android Studio and it works fine.
Open the project in Eclipse -> Right Click on Android environment -> Run As -> Android Studio Project. When Android Studio is opened DON'T MIGRATE PROJECT TO GRADLE!
Anyway it is not recommended! if you want to make changes - use Eclipse to make these changes.

Unable to open existing Android Studio project?

I am trying to open an existing project developed on Android Studio. But it doesn't show me Android app folders.
Can any of you please guide how do I open an existing project on Android Studio.

Resources