How to import correctly an android app? - android

I have some apps in eclipse and I exported my apps, but when I import all apps again, and when I import it, I have 1 error in Androidmanifest.xml (for the package name) and the code has not appeared. I have not updated my SDK manager. Could that be the problem?
I tried to put the project name in the manifest, and I don't get more errors in it, but when I export, it doesn't save all my information/configuration.

I was having a similar problem. I am a novice to android studio and to creating android apps. I downloaded sample apps from the android site but could not get it to run inside of android studio. What I was doing was allowing the android studio ADT to convert the project. This was a mistake. I ended up importing the project but not allowing the ADT to migrate any part of the unzipped project file. Once I did this the ability to run the apps was there and I just had to link the dependencies via the project structure option under File in the top toolbar and then worked out minor issues that were mentioned in the console of the log. This is probably a different issue than what is discussed here but it does relate to the importing and running of android apps.

Related

Why don't we have a single file to open an Android Studio Project?

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.

Load AOSP Application to Android Studio

I found a few questions asking how to get the source code from the AOSP running in Android Studio. However, I could not find any explanation on how to import only a single application of the AOSP.
I am trying to do it for the Dialer application which can be found here. However, I had only minor success, I was able to import the code as a project, but didn't manage to set up dependencies and required libraries and all that.
Can anybody tell me if it is possible, and if so, how this is done?
UPDATE:
It seems impossible to achieve this with the code that i found and which was part of the full android distribution of google. But google decided to distribute the Dialer application just like any other application via the playStore. So there should be a possibility to find this code, IF it is also running under the open source project.
You can only open the whole AOSP inside Android Studio.
After you finish building the source do make idegen && development/tools/idegen/idegen.sh inside your root folder and then open the new android.ipr in your root via Android Studio.
AOSP code you are looking is not Android Studio compatible, It's an Eclipse project.

Unable to build android-support-v7

I've downloaded the Android SDK. I am trying to build the appcompat project. I've read that project is located here:
C:\Android\sdk\extras\android\support\v7\appcompat
I have imported the project into my workspace. It doesn't build.
I could go into great detail about which SDKs I have installed on my machine, etc. I could say that the values-v11, values-v14, and values-v21 folders all have errors, even though I have downloaded all three of these SDKs. But I am pretty sure if I import a project from the Android SDK website from the Android developer website, and I try to build that project, it should just work. I've followed the instructions here:
https://developer.android.com/tools/support-library/setup.html#libs-with-res
...and still not working.
So, why does this not work? I don't even care how to get it to work, I want to know why this does not work and why would I have to do any extra work or research to get it to build? Is this a problem with Eclipse? Should I be giving up on Eclipse and moving to Android Studio? This appears to be an incredibly simple thing to do and yet it does not work anymore.

How to build and deploy a phonegap app from within Android Studio without eclipse

I'm still struggling away with how to deploy my app directly to my phone via command-line. But when I used eclipse I could easily deploy and build directly to my device.
But android studio is meant to be all in one development software.
So far all I have been able to is either create a new project, unsuccessfully or try and import my phonegap project which then only displays:
So nothing really has been imported. In my mind I'm going to have to get eclipse back up and running, which seems counter productive.
All I'd like to be able to do is, work from within android studio and deploy the complied app, again from within android studio directly to my phone.
I am using Android Studio and it's pretty complete. You can very easily import any PhoneGap project. You just have to open Android Studio, Use import and follow the instructions. From there you can sign your apk and other tasks.
It is really easy to work with PhoneGap and Android Studio. Here is what I am doing:
Creating Phonegap project: phonegap create testproject com.testproject.name Name;
Enter Project directory: testproject;
Add Android platform: phonegap build android;
You have your phonegap project ready. Now open Android Studio. Select Import project and follow instructions. If you don't have any plugins added in your project it's preaty pushing NEXT till you get to the end.
That's all. If you need more information tell me will be happy to help you. Have in mind that as for phonegap <3.0 you had to import android sub directory of your phonegap progect, as for phonegap 3.0+ you include the main directory. In the example above will be directory TESTPROJECT, not /testproject/platform/android/ ...
If you prefer snapshot you can find a very easy to follow tutorial here: Phonegap and Android studio
I'm using 0.5.4 Android Studio on Mac OS and not sure about Windows one.
Select [Build] then [Generate Signed APK] from drop down menu.
Please make sure you set android:debuggable to "false" in AndroidManifest.xml.
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#string/AppTheme"
android:debuggable="false"
>
</application>
The guide to generate key store ishere.
If you are unfamiliar with Google Play, please refer here.

Cannot import phonegap project after creating android project

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.

Categories

Resources