How to create an Android Studio project from a subdirectory in a github repo - android

I need to create an android studio project from this directory on github. I tried VCS -> Checkout from Version Control in Android Studio, but there is no url for this directory in the repo, so I'm not sure hot to clone just this subdirectory.
I also tried downloading the whole repo, doing File -> New -> Import Project in Android Studio, and selecting the messaging subdirectory as the folder to import. This showed a build progress bar, but after it finished, there was no imported project.
How do I do this?

I am not sure if its the correct way, but i resolved it with the following steps on Android Studio 4.1.1 :
Run Android Studio until the Welcome to Android Studio screen shows up.
Select Get from Version Control.
Paste the URL.
Press Clone button.
This will import the complete repository , but you won't be able to run the app yet (exactly as mentioned in your question) .
Now close and re open Android Studio
On welcome screen, select import Project (Gradle, Eclipse ADT, etc.)
Navigate to the folder where the project was downloaded and select the required Sub-folder
Press OK and let the Studio build your project.

I get it now. Go back to this. Then hit Download Zip and unzip it. In Android Studio go to File -> Open -> then to the quickstart-android-master and then down to messaging. Do NOT open quickstart-android-master go down to messaging and open that.
EDIT
Be aware you will have to follow these instructions to get the project to build and run.
Add google-services.json in android studio

Related

Android Studio : Open Android Module in Android Studio option is missing in flutter project

I am developing a flutter app for both iOS and Android. When generating the APK, I prefer to use Android studio (my default IDE is VSCODE). However, when I go to Tools > Flutter I do not see Open Android Module in Android Studio option. I do see Open iOS Module in Xcode.
I followed couple of SO answers, even tried replacing android.iml file from a working project. Nothing happened. I re-cloned my project from BitBucket because sometimes the Android Studio was fine when the project is freshly from repo, but this time, that didn't work either.
I Also tried opening the gradle file and looking for the option (as explained in one SO answer), that didn't work too.
However I noticed, few issues.
In the folder structure, the root folder is replaced by the flutter icon. in projects where I have no issues with, the folder icon is folder.
In here I see .dart_tool folder. In working apps with no issue, I do not see this folder.
I do not have an android.iml file. In other projects I did.
Below is my folder structure in a nutshell. Whats going on here and how to fix this issue?
When you don't see any options to
open module in android studio
because of missing .iml files caused by .gitignore file, follow simple steps.
Click on File and choose Open..
Now in the opened dialog choose android folder of example flutter project under your plugin module. For e.g if test is your plugin with example as it's app then you need to select and click Ok
test\example\android
3. Then wait for Android Studio to sync and download necessary jar files.
Simplest solution
Open flutter project
Go to android folder
open manfiest file
On the top right you will see option open module in android studio
click on this option
Solution 2:-
Import your android project as a project in android studio
The easiest way is to use this command in the root directory of your project, it will create some missing files and it will definitely work.
flutter create --platforms=android .
Now just right click to Android folder

How To Open an Existing Android Studio project in Android Studio without launching last opened proect

I want to open existing Android Studio Project without launching Android Studio with last closed project.
i.e When I launch Android Studio then it opens last closed project on it.
Then I have to close it or go to
File menu -> Open -> Open File Or Project
Rather than i wants to open it from windows file explorer/finder or from terminal where project is stored.
like Xcode, Unity and other IDE does.
Or we can say.
can we create a special Android Studio Launcher icon for separate Project in that project directory.
That isn't possible. Other IDE projects create a "project file" that associates the contents of the project to that specific IDE.
Netbeans for example is not one of those, and so is Android Studio.
There are only two ways to open a project for Android Studio.
Hopefully in the future they will implement a simpler way to do it!
We can launch android's specific project in android studio from command line tool studio.
Go to directory where project is stored
user#:~/AndroidStudioProjects$ studio MyProject
If the commands don't work you can run in Studio > "Tools" -> "Create Command Line Launcher..."

How To Open an Existing project in Android Studio

All the questions dealing with this are now outdated. I am simply trying to open an existing Android Studio project.
I have cloned a repository for a project from http://blog.stylingandroid.com/material-part-2/
I have all the files, I choose "Open an existing android studio project" and then choose the "Material" folder which is the root directory of the project. When the project loads, it is called "gradle" and there are no files showing in the project frame.
I am using the latest version of android studio and the latest build tools as of 19 Dec 2014.
How do I import a project?
From the Android Studio welcome screen, try "Import Non-Android Studio project". It sounds like exactly what wouldn't work, but it does.
On 1.5.1, there's no Import Non-Android Studio project as the accepted answer says, but chosing Import project (Eclipse ADT, Gradle, etc.) does the trick. Open an existing Android Studio project does not work. Still quite weird.
Click on file, then click on Open. select the main file that contains the project's name without opening the file.
then Gradle loads but still nothing happens and the welcome screen is shown. press the combined keys of Alt+1 then the project files will appear on the left side of the screen.
Sometimes it is tricky to open Android project. My tip is try to use
File -> Open... -> <path_to_settings.gradle>

How to import android source code(AOSP) into Android studio?

I know how to import android source code into eclipse, but is there any way to import android source code into android studio. Because I want to change my IDE from eclipse to android studio.
I know this was already answered, but I wanted to add onto this for anyone else that sees this.
For Android studio:
Open terminal (*nix system) call the following:
{AOSP root}/make idegen && development/tools/idegen/idegen.sh
This will generate an android.ipr file in the {AOSP root} directory.
In Android Studio, select 'Open project' and select the generated android.ipr file.
Note: this will take a long time to index all the files (~2 hours). Be patient. If a dialog box that says 'Framework detected' appears, select that and hit 'OK'.
Now you have the entire Android framework loaded into Android Studio.
I found the answer from my colleague, he told me that , use the file in
sourcecode/development/ide/eclipse/.classpath
this file is for eclipse to import android source code . but there is a way to transfer this file into a intellij project import file . sorry , I also don't know how to transfer. but my colleague email me a *.iml file.yeah ,this is the file that can help you crate the intellij module .
After you get the file ,copy that *.iml file to the root of your sourcecode,then you can open the intellij,create a empty project ,import module from existing module ,then in the window ,chose the *.iml file ,after that ,the only thing you can do is wait . it takes much time to import it.
so ,you can develop the android source code in intellij . enjoy it!
Follow the steps to Migrate to Android Studio:
Export from Eclipse
In Eclipse, select File > Export.
In the window that appears, open Android and select Generate Gradle build files.
Select the project you want to export for Android Studio and click Finish.
Import to Android Studio
In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.
Click Import Project.
Locate the project you exported from Eclipse, expand it, select the build.gradle file and click OK.
In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)
That's all you need to do. For more you may refer to official doc.
check this link
http://effie.io/opening-aosp-with-intellij-part-3/
this has all the steps to open AOSP In intellij or Android studio, with some additional steps to fix some errors.

Linphone Android how to import the library project?

I am working on SIP application and using Linphone Library.
I am trying to make and run the build on the device but getting few issues
I have setup the Android SDK and NDK set up on my Mac.
Now when i copy the repo via Terminal using command
$ git clone git://git.linphone.org/linphone-android.git --recursive
And than to Makefile ran this code:
$make
and Then it show's Build Successfull.
Now i need to import this project into Eclipse and when i do this imported project (folder named "linphone-adroid") into my Eclipse it shows me alot's of projects i am confused which one should i use and if i choose all of them then it gives me lot's of errors in other's (Shown in image below)
liblinphone-android --> Ran this on Device runs fine but when i call the numbers it changes it's view and shows duration 0:00 and does not calls the numbers then i have to press hang off button to dismiss the call. (Not able to make call's)
Please suggest me how should i import this project into my eclipse and what else scripts i need to run on the terminal to make it run.
So far what i have did is right or wrong?
Yes , it worked finally.
After build using "make" command.I installed in my device using "make install". Also generated sdk using "make linphone-sdk"
And then simply imported in eclispe just like normal android project.
Without any error it worked. - thank god.
In windows8 cygwin created many issues, so i did build the code using "make" command in MAC. And then simply imported in windows eclipse. (some admin permission issue in MAC)
Note: android-ndk-R9c was failed my build. So then i tried with android-ndk-R9 without additional toolchain it worked great. Android-ndk old versions available at
(http://page2rss.com/0dc3a880ab1762303011d69d18408917).
after building the library you have to import it in eclipse
File -> New -> Other... -> Android -> Android Project from Existing Code -> Browse_your_project
Now open your application (Project which have activity) and assign linphone library which you have earlier loaded....
Right click on your project -> select Android tab from left hand side -> from the bottom library section, click on "Add..." -> you will see the listed library which you have in your eclipse workspace -> select correct one -> click "OK" -> now refresh and clean the project -> build and try to run
check complete guide on linphone android on coders hub.
As suggested by #bhavana
I was doing wrong while importing the linphone-android project into my eclipse.
The correct process is explained below-
Importing into Eclipse :
After i have made the build then now i just need to import the project into eclipse.
Step1: Go to eclipse click on File Menu then Import then select
Existing Android Code into Workspace
Hit Next and Browse to the linphone-android project folder
And Only tick linohone-android folder and Leave copy project into workspace untick
Like the below image:
And hit finish.
Now i right clicked on "linphone-android" (project name) and go to Properties and Java Build Path and then Order and Export and then reorder them as my image below and untick gcm.jar
Hit OK
And Boom No errors
Now just run it on device or emulator. (Cross check minimum target SDK matches with the device or emulator.)
The above steps worked fine for me.

Categories

Resources