How to know whether an existing project was made using android studio or eclipse? - android-studio

I have got some open source projects which I want to have a try. But I want to use Eclipse if the project was made using eclipse; otherwise I would like to use Android Studio.
So how can I know by viewing the source code about the IDE used for the development of a particular project? Is there any metadata in any file which stores the IDE information?

I believe that Android Studio sometimes includes gradle related files. That's how I would check.

Related

How to configure an iOS Application for Kotlin Multiplatform in Android Studio?

I want to add a Run/Debug Configuration for an iOS Application for a Kotlin Multiplatform Mobile application in Android Studio 4.1.2. However, there seems to be a problem with the configuration for iOS.
In the screenshot below you can see the problem. In the dialog "Run/Debug Configuration" Android Studio complains about
Error: Please specify Xcode project location in xcodeproj property of gradle.properties
Using the "Fix" button does not solve the problem. Android Studio just adds an additional xcodeproj to gradle.properties and the complains about a duplicate parameter.
I also tried different paths (relative and absolute) for xcodeproj. No luck.
If I remember correctly, it used to work out of the box. A new Kotlin Multiplatform Mobile project was automatically configured for Android and iOS. I'm not sure what changed. Probably something was updated.
Is this a bug with the KMM plugin? Or is there something I can do on my system to fix this?
don't do that with Android Studio.
Just open Xcode, click on 'open another project...', locate to the iosApp folder that named it when creating your project on Android Studio.
after that, just click run and have fun.
If the project doesn't run right away even on opening it from Xcode and shows the shared framework is missing, Then try generating the shared framework for iOS platform using terminal. Navigate to the project folder and execute
Command: ./gradlew packForXcode
Now the shared framework should have a xcode-frameworks product and you should be able to build and run the project through Xcode.
I fixed it by downgrading the Kotlin version from 1.4.30 to 1.4.21. You can check this thread here. To downgrade, download the version you want from the plugin store and choose the install plugin from disk as in the picture below
Upgrading Android Studio version to 4.2.1, KMM plugin version to 0.2.6, creating new KMM project with KMM plugin, the problem can be fixed automatically.
If you don't wanna use Xcode:
Look like there is some IDE issues in this versions, one option would be to downgrade the Kotlin version.
What worked for me was to download the latest Canary Android Studio and setup my KMM project there.
Hopefully soon this will be stable for the next versions
Same as here: https://stackoverflow.com/a/66941077/3117650
Look like there is some IDE issues in this versions, one option would be to downgrade the Kotlin version.
What worked for me was to download the latest Canary Android Studio and setup my KMM project there.
Hopefully soon this will be stable for the next versions

Can scratches be shared between IntelliJ and Android Studio?

I'm working on a project in Android Studio 3.1. I first had to create a .jar file with dependancies in IntelliJ 2017.2. I chose to do my programming in the IntelliJ IDE because I knew that Android Studio is based on IntelliJ.
But now I have a bunch of scratches (lots of notes and code) for my project that I assumed would be available in Android Studio, but they are not.
Is there a way to tell Android Studio to use the scratches from IntelliJ? I will have to be jumping back and forth more and more between IDE's in the future as the project develops.
It's is possible to specify a location for scratches using Help | Edit Custom Properties... and adding the following property there:
idea.scratch.path=~/Scratches
It is necessary to restart the IDE after you make changes there. You could specify the same location in both IntelliJ IDEA and Android Studio. (You can of course choose your own path/location.) In this directory two further directories will be created by the IDE, "scratches" and "consoles". You can create these directories yourself if you already have scratches you wish to use.

Does Android Studio support Code completion for C/C++?

The code completion is fine on Android Studio java project. But I want to use Android Studio to edit some existing C file(.cpp).
for example, if i have declared some function, then i type the function in other section. But the android studio doesn't show up the code suggestion or some debugging.
Can Android Studio support Code completion for C/C++ like this:?
Yes it does, as long as the project is setup to use the NDK and the C/CPP sources are included in the project.
Try pulling the ndk sample repo and try opening one of the projects.
If you have a java project and want to edit some arbitrary C or C++ source, then no. It does not have enough information about the source file, include paths, compiler etc...
If your project uses Android.mk to build, it will be a bug of Android Studio. I have been reported.
Android.mk project cannot show code completion for cpp.
It seems that old version of Android Studio does not support code completion of jni native build (with Android.mk as configuration file), and that should already be fixed now.
But if you are using CMake in your project as external building tool and code completion still does not work, It's probably because you have more than one version of cmake installed. You can try to remove extra ones from SDK manager and restart Android Studio, it should work.
To see installed CMake version, you can open the SDK manager and check the 'show package details' on the right bottom. You can view cmake tools installed with different versions.

Android Studio referencing library seems overly complicated. Is there an easier way?

I'm trying to migrate to Android Studio from Eclipse.
In reading a simple example of using a library within another app:
https://developer.android.com/sdk/installing/studio-build.html
In eclipse to achieve this all I would go to the properties of the project and add a reference to the project. Simple, through the IDE and easy to check the build settings at a later date.
In Android Studio I've got to add an entry to my referenced library using ALT-ENTER after getting autocomplete to find the library, which seems to add an entry to the file 'app.iml':
<orderEntry type="module" module-name="app2" />
Then I've got to edit the gradle file:
dependencies {
compile project(":lib")
}
Is there not a better way, i.e. using the IDE. I don't particularly want to have to remember about this xml iml file or have to manually edit build files every time I want to do something.
?
Sorry,
After browsing for a while with no answer I found it just after posting:
How to create a library project in Android Studio and an application project that uses the library project
Why can't Google update their documentation to use the more normal way (presuming this dialog is a new addition)....

Android studio doesn't create project structure

I am new to Android studio. I tried to create my first project and there is no project structure only gradle files. What am I doing wrong? I keep getting these files with creation of another new project.
Update SDK via Android SDK Manager. You need all packages in Tools to be installed.
But even after doing so, I can't make it to auto generate resources. So I continue to deal with it...
I found what was my problem. I updated Android studio from version 1.x to 2.x. On official site is written that if you try to install version 2.x into same location Android studio might not work properly and there could be some unexpected behavior.
So just removing Android studio and then reinstaling it, worked perfectly.

Resources