Hey I am trying to build an android application regarding google adsense.
I want to import the android sample.
https://github.com/Ishaan-Kumar/googleads-adsense-examples
Since I am only interested in android I want to import only this.
https://github.com/Ishaan-Kumar/googleads-adsense-examples/tree/master/android
I tried to import via VCS in android studio by url https://github.com/Ishaan-Kumar/googleads-adsense-examples.git
But it imported the whole project including all the platforms(PHP,dontnet,ruby).
The thing is I want the android only plus the android files are not detected (I think there is not gradle file in here)
How do I overcome this problem?
Often programmers explain that in there Git Page, some time don't explain. like it
Many way to import Github project into your android studio project like this ways
use zip git file Like this Step Answer [here]
use clone or git in android studio See this
use JitPack site for better performance and jump filters can help you
But
some programmers in Github don't like customizing them project
they try to damage files or redirecting for block modify
Step 1: Download Zip. Don't Fork the project or use git command or VCS in android studio.
Step 2: Open Android Studio->New Project->Open->Select android directory.
Step 3: Android Studio tells you this is a eclipse project (Convert it to gradle blah blah). Hit Next. This is the time I came to know this is an eclipse project and why android studio is not detecting it.
Step 4: Done.
PS: Thanks to comments(Comment Author has deleted his comment).
Related
Why don't we have a file similar to the .xcodeproj (for XCode applications) or an .xds (for Sencha Architect Projects) for our Android Studio Project?
I'm pretty sure a good number of you here have experienced the frustration of trying to import a project you see online in order to piece it apart better and learn how it works. I get that we are supposed to Import Android Projects built using Eclipse and Open Android Projects built using Android Studio.
However, why is it that we have to go through File -> Open -> then pick out the directory of the Android Studio app that we want to open? And the thing is, Android Studio doesn't seem to know it's an Android Studio project until it tries to open and build it. In the screenshot I have below, I have the sample Android Studio projects of ARToolKit, but I've only imported two of them.
As you can see, only those I've imported "can be seen as an Android Studio Project" as indicated that they have the Android Studio logo instead of a Folder.
This can be an issue for those just starting to develop in Android Studio on their own and they try and use existing projects (build from Eclipse or Android Studio) and they hit a snag with just trying to import the projects for reference. They might not know that they should import the folder and not the projectname/src subfolder. It adds to the "steep learning curve" that Android Development has if opening/importing projects aren't streamlined to a degree.
To sum up, my question is:
Why don't we have a single file that we can open that would in turn open Android Studio and import and build the project if it isn't built yet?
Android is not iOS. iOS development is only possible in xcode, hence it makes sense they added a shortcut to open it in xcode directly with a .xcodeproj file. Make life easier for iOS developers.
Android development however can be done outside of android studio as well. Eclipse is just one example, there may be other IDE's that support this. This is possible because android has standalone SDKs and tools that third party applications can use. iOS does not.
Imagine you are working on an android project in android studio. Then your boss tells you someone from 3000km away is going to help you. This guy may be using android studio, but maybe he isn't. When there are multiple options that developers can choose from individually, you do not want to pollute version control with files that you are using, but others may not care about. Each their environment.
This is merely a logical conclusion that you can come to by comparing. The "real" reason why this was done can only be answered by the people that created (adapted intellij) android studio.
This has been very frustrating to me too.
I try to give you a "beta" answer, waiting somebody to confirm it to me.
An Android project is just the composition of many parts that in some cases are concurrent to create the apk file.
It's just like what happens for the whole java projects: you have the main/src/java, the main/src/test, the maver or gradle files, the gradle or maven wrapper, the manifest, the configuration etc.
So you won't have a single project, but a series of folders that can contain many "flavours" or "versions" of the product itself.
The only help it is given to us is the Android studio icon that appears if a folder contains an android project in its subfolders.
I don't know if I have really answered to you, I just have given you my impressions and my thought.
I'm facing a very serious problem. I've cloned a git repository from https://android.googlesource.com and can successfully import a project in eclipse (say, platform/packages/apps/Contacts). But, the project shows a large number of errors due to Private Android classes being referred by the source code. I need to have a compiled version of the source code by any means.
Does any one have an idea on how to solve this issue? Any kind of help is greatly appreciated
Try these steps:
1) Clean your project.
2) Check your projects build target. Right click your project , go to properties > Android and make sure the appropriate android API is checked.
3) If the imported project uses Google APIs, make sure you have Google APIs installed and your project build target is set to it.
I was only able to find guides on how to import an Eclipse project into Android Studio. But I am not using Eclipse, I am using IntelliJ IDEA.
How do I generate the new Gradle build files for my project?
EDIT:
To clarify. I know how to setup Gradle manually. But that's not what I am asking for. The question is: Am I able to let the Android SDK generate the Gradle files for me? Like the ADT does... But since I'm not using Eclipse, I don't have access to the export feature of ADT!
Have you started Android Studio yet? Because importing IDEA Projects is one of the possible selections you can choose in the beginning.
If you passed that initial state already, just go to File -> Import Project and select the folder of your project that you want to import. The rest is straight forward and pretty bullet proof as both are basically IDEA :D
Okay for everyone who needs to do this:
It's not possible.
But if you want to create the neccessary Gradle build file manually. Here it is: https://gist.github.com/Goddchen/5600345
You need to "Import Project (Maven, Gradle, ...)" and then select not the folder, but 'settings.gradle' instead. Then Android Studio will do everything by itself.
The phonegap create still makes a phonegap project but the eclipse no cannot see projects when you select import and browse to the folder. It says "No projects are found to import".
It worked fine before though because made projects before.
Why does this happen?
UPDATE:
Seems the problem is with my eclipse since tried to give the created phonegap project to a colleague and it is recognized in his eclipse. For some reason my eclipse stopped recognizing phonegap projects.
#jhdj Delete all the existing projects in the eclipse ide and import the project which you want i hope you will get it,
file->import->android->existing android code into workspace
hope this works,b/c it worked for me.
You can try.
Check are you trying to import from the right directory. You are looking in some wrong
directory.
There are so many posts available in So only for this kind of problem refer them.
No projects found to import
No projects are found to import - Helios eclipse
Why "no projects found to import"?
You also have an alternative which I was using when I was working on linux fedora.
Otherwise look into this tutorial to build phonegap application in eclipse itself
http://www.adobe.com/devnet/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html
See this section -- Creating the project in Eclipse
The tutorial is for the cordova-1.5.0.js version.
You can use the latest version or may the versuion you wan to use there is no problem in doing that at all.
So, this is not like other problems. I have basically one question
Android project build system uses the Android.mk files.
Is there any eclipse plugin out there that parses through the mk files and allows me to load those projects into eclipse ? essentially import Android.mk file project...
You can import the whole Android sources into eclipse. The instructions are here. Then you should make some modifications (for instance, include android-common_intermediates/javalib.jar instead of google-common_intermediates/javalib.jar) and you will have possibility to develop in eclipse.
Eclipse separates Android sources to several projects by itself(I think according to classpath entries). If you want to change this behavior you should look in this direction.
If you have tried eclipse instructions at Android source site, you probably would know by now that it leaves lot of details to imagination.
One thing you need to keep in mind is that AOSP build doesn't work with eclipse. As long as you build your code from terminal and use eclipse to edit/browse/debug purposes, you will have more productive sessions.
The article at Using Eclipse to browse/edit Android platform code explains this in step by step.