How do I open open-source projects in Android Studio? - java

I'm very new to Android programming, and I wanted to try learning by example. I found this open source project on Github: https://github.com/android/platform_packages_apps_contacts
I was hoping to open this in Android Studio so I could modify certain elements and see the result by running it, eventually learning how the process works as a whole. The problem is when I download the zip file and try to open the folder inside with Android Studio, nothing shows up. Any help would be appreciated!

In Android Studio, close all open projects until you get the "Welcome to Android Studio" screen. Choose "Check out project from Version Control", and in the popup, choose "GitHub". Screenshot:
Follow the UI from there.

Try to checkout it directly into Android Studio, VCS->Checkout from version Control->Git

Open all projects using:
Import project (Eclipse ADT, Gradle, etc)
I usually open my project that is saved in Google Drive in other computer, and the next option never work to me:
Open an existing Android Studio project
I always use the first option to avoid problems.

Use Open an existing directory in Android studio.
Navigate the project you wish to open to the directory containing such folders as:
manifest
java/src
res
...etc.
Now, Open.

By default, on Android Studio 2.2.2, when you open an existing Android Studio project, you land on an empty page showing only the name of your project on the top left (just below the open, save, refresh shortcuts icons) but side panels that contains your project structure and details are hidden.
You can open these panels either by pressing "alt + 1" as suggested on the background of the "starting IDE page" or by clicking on menu: "View" -> "Tool Buttons".

Related

Android Studio Cannot Install Any SDK (Im Beginner)

Im starting Android Programming so Im installing Android Studio.
When Im trying to run the wizard, I get an error: "Missing SDK"
I didn't download any SDK and I know that Android Studio can download and install SDK's itself.
Then, I click on Next to see what's happening:
I know this page should has a Todo list to download SDK's and it will download and install them if I click on "Next" Button.
Then, I click on "Next" and sadly I see this page:
So Why??! It should has a list of SDK's to download! but it hasn't!
If I click on "Finish" button, it should download and install SDK's normally, but it says "Nothing to do!" :(
I know I never downloaded SDK's! "Android SDK is up to date."??
Then, I looked for emulator and I downloaded it from developer.android.com original website.
emulator archive page of developer.android.com website
I extracted downloaded zipped file into C:\Users\USER\AppData\Local\Android\Sdk and I tried again.
I didn't see many differences, except in these pages:
(a warning in bottom)
(error fixed)
Sadly, I have the same problem yet.
Then, When I click on "Finish" button at last page (or when I close the Wizard Page any time) Program sends me to the Android Studio's Main Page! But I can't make a new project:
Then, I open the SDK Manager to fix this problem. So I will see another problem!! :(
Then, I click on Edit button to fix this problem:
It sends me to the previous page!!!! :|
You know that I dont have any SDK:
And I really don't know that why Android Studio says "Android SDK is up to date." :(
Can anyone help me please?
(As you can see, Im using Windows 11 in a x64 based cpu.)
To download Android SDK, you should use a VPN or set DNS.

How can I restore my Android Studio project?

I changed the name of the Android Studio project folder in the Windows Explorer before I started Android Studio. Bad idea.
Now I get the error:
Gradle sync failed: No toolchains found in the NDK toolchains folder for ABI with prefix: mipsel-linux-android
And all my Activity files are replaced with one MainActivty that doesn't contains the things I've made.
Unfortunately I can't get a previous version with "show history" in Android Studio and i can,t get an older version via windows explorer "restore previous version"
I also tried to decompile it from the .apk on my phone. I got the layout and xml files but can't find my java classes.
I worked since weeks on this project and don't want to lose it.
Can anyone help me either fix the error or restore the .apk?
Thanks so much for all suggestions and ideas
First close the broken project this can be done with File > Close project
Then you have to reopen the project from the new location ie. the renamed folder.
File > Open... browse in your filesystem for the project, select the folder and press OK
Wait for the gradle to sync and hopefully you won't have any problems!
I have the same problem when updating ndk-18. You updated the NDK to version 18 and it is missing the folders/files. You can download ndk-v17 manually and extract the search folder "toolchains" to copy the missing folders/files to your folder android-sdk/ndk-bundle.
From github.

Eclipse incorrectly generating new Android project

I am attempting to create an android project through eclipse as I have many other times, but today Im having a strange problem. After choosing new project - Android project - setting my name and target SDK - icon/empty activity etc. When I have to name the empty activity I enter a name and if I click Finish nothing happens and the name activity menu stays there. The next button is greyed out.
The only thing I can do is cancel out from there. In my project explorer the project HAS been created though. There are no src files, no activity or anything really. A small manifest file and some empty resource files.
Im not familiar with the icons associated with these files and folders. I dont know why this is happening. I have tried "Help" -> "Install new software" and install from url: https://dl-ssl.google.com/android/eclipse/ and have also tried updating and install all current SDK's but nothing seems to work.
Has anyone else experienced anything similar?

Android SDK Eclipse AndroidManifest.xml not created

I've downloaded the ADT Kit from the Android Developer Website, but if I try to create a new Project (New-> Android Application Project), the Manifest file is not created. In the console window, I get the message:
'[2013-12-13 15:50:08 - package name] AndroidManifest.xml file missing!'
How can I solve the problem?
I already tried to clean the Project and run again, but the xml file isn't created. I tried also to uninstall (delete) the SDK and download it again, but there is the same mistake.
I found the solution:
First, I Updated my SDK, but it wasnt the problem. The problem was the character 'ö' in the project / package name. Eclipse didn't create the Manifest because of him.
It's a German App...
To fix this problem, right click the project or edited resource and select “Refresh”.
If you edit outside of Eclipse a lot, you can enable auto-refresh by going to Window->Preferences menu, then in the Preferences dialog box, select General > Workspace.
Check the “Refresh automatically” box.
and even in the eclipse in the top menu bar you can find search-->check the automatically build

Failed to run android sdk manager in Eclipse

I'm trying to code an app for android and I ran into a problem with the sdk manager. When I try to run it in eclipse, it says "Failed to run android sdk manager. Check the Android Console View for Details." Then in the console it says:
[2013-01-30 21:27:45 - SDK Manager] Missing %s file in Android SDK.
[2013-01-30 21:27:45 - SDK Manager] android.bat
I reinstalled eclipse, the sdk and tried everything any other posts about the same problem but nothing works.
I was able to restore the missing items in File | New... quite easily by performing the following steps:
Switch to the Java perspective, either via the perspective switcher
toolbar at the top right of the main Eclipse window, or via the
Window | Open Perspective menu item.
Reset the perspective by either right-clicking on the Java
perspective icon in the perspective switcher toolbar, or by clicking
Window | Reset Perspective...
As to why they weren't there in the first place, the most likely cause would be that the ADT contributes various things to the Java perspective, and these changes don't take effect until the perspective is reset after installing the ADT. As an Eclipse plug-in developer I learned it the hard way, that changes to perspectives don't get picked up unless you explicitly reset them.
Ensure that your SDK has the android.bat file. By looking in the directory the SDK is in.
Maybe you can try: chmod +x <ADTFolder>/sdk/tools/android
Unzip your sdk zip somewhere, copy entire contents of tools directory, replace it with your actual sdk tools folder contents.
Restart eclipse if needed.

Categories

Resources