How to Create Android app - android

I created my project in cordova and its here
enter image description here
Here problem is i cant use cordova build function (it isnt work for me)
and now question is here :
can i compile it and make apk file from these files???
if yes how?
i have android studio installed but i dont know how to use it

same as answer by Jackowski.
but,Make sure you import the "platform/android" directory underneath your cordova project (and you want to Import Project, not Open Project).
http://codeofandroid.blogspot.in/2016/02/import-cordova-project-in-android-studio.html

Open Android Studio and select 'Import project' option. Then select your project location and you are ready to use Android Studio with your project.
More info at: https://cordova.apache.org/docs/en/5.0.0/guide/platforms/android/

Related

Cordova 5.3.3 Android Push-Plugin Eclipse - Missing packages

i installed the following plugin to my cordova project to receive push-notifications (and followed the given steps):
github.com/phonegap/phonegap-plugin-push
I also installed all needed resources by the sdk manager (extras-> google play services, support repository+libraries etc.)
But unfortunately i get an error in eclipse:
The packages com.google.android.gms.gcm, com.google.android.gms.iid, android.support.v4.app are missing somehow.. (or cannot be resolved)
i don´t know what i´m doing wrong..
is there any step-by-step tutorial for implementing the push-plugin in a cordova 5 app?
or is there any solution to this?
thanks!!
Screenshots:
http://abload.de/img/unbenannt-11qbf4.jpg
and
http://abload.de/img/unbenannt-2i7ozz.jpg
May be it would help you.
It is asking to add v4 support.
Try this:
Right click on you project in eclipse
Then select "java build path"
Click on "libraries tab" then click on "Add external jar file"
now you will get this v4 jar file in C:\Users[username]\AppData\Local\Android\sdk\extras\android\support\v4
NOTE : if you cant find the AppData folder then make sure to change hidden
settings.
Recommended to start using IDE Andriod Studio for Phonegap to prevent further issues. Android SDK has changed to suit Andriod Studio. I have build a clean project and paste over the index.html in Andriod Studio. No errors at all and gradle will help build all the projects file with 1 click!

Unable to open cordova project in eclipse

I try to import my cordova ionic project to eclipse as an existing android application but it was undetectable? Any idea why? I could run my app in android phnoe using 'ionic run android' but why it can be imported to eclipse?
I also installed android studio and it has the same problem. I don't have a clue why is this happens..
Remove all CordovaLib that exists inside eclipse and import it again. It works 100% most of the time. Second time you import the project you will enable import your project with CordovaLib. It happens because there are existing CordovaLib inside your eclipse.
You have to choose the platforms/android folder when you want to import in eclipse, not the root of your project.
Eclipse only knows the android project, but not the cordova project.
And then select both your app and the CordovaLib projects.
But be aware that changes made in /www will only take effect in eclipse after you rebuid the project.
Or you can use eclipse project properties to unhide assets/www an in that case be aware that any changes in assets/www will be lost if you use the cli to build your project (and the same goes for any change in platform/android).
That's why I only use eclipse when I need to debug (mostly for plugins).
I faced a very same issue,
Please make sure - you are importing the project using already existing android code under the Android tab in import option. Not with already existing project option in general. This one fixed my issue,
Hopes this one will help some to save some valuable time ...

How do I import/build this project?

I am not a dev, but have some dev experience. I have never used Android Studio before but I wanted to look at an example app. I picked one I am very interested in, but it gives me nothing but grief just trying to import it.
https://github.com/AltBeacon/android-beacon-library-reference
Notes:
I am using the latest version of Android Studio. (1.0.2). I have added in all the SDK files needed I think.
I have downloaded and un-zipped Gradle 2.2.1.
I am running Ubuntu 14.04.
I have dealt with Eclipse for Android previously and was able to
hack someone else's code to suit my needs and actually deploy an unsigned apk.
The readme/install directions at the github don't really help a noob
like me.
Install:
I have extracted the project from the Download Zip link.
For the actual import into Android Studio I choose "Open an Existing
Android Studio Project" - because it looks like one.
I then choose the root directory created by unzipping the zip file,
in this case it is named "android-beacon-library-reference-master".
But it seems to select the project's Gradle subfolder (/gradle) for the project! Which I'm quite certain is invalid. I cannot seem to get it to use the root
folder.
What am I missing? Or is this not the correct way to "import" this particular app? Is this app not compatible with AS 1.0.2?.
TIA!
In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.
1.Click Import Non-Android Studio project.
2.Locate the project you exported from Github, expand it, select the build.gradle file and click OK.
3.In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)
Android Studio properly updates the project structure and creates the appropriate Gradle build file.
Can you try "Import Project" instead "Open Project". Thanks.

Using phonegap and Android Studio 0.8.2

There are only 3-4 articles on how to use Android Studio with Phonegap.
The problem is that these are all written for lower versions from Android Studio (<0.8) and now you can't import Phonegap projects into Android Studio without having multiple errors.
Has anyone achieved it to import a Phonegap 3.5 project into Android Studio 0.8+ and will share his/her knowledge?
Edit:
Ok if you don't have errors then you can describe the way you do it!
My steps:
phonegap create projectname id projectname
change directory into projectname
phonegap build android
-- so far no problems
start Android Studio
"import project"
choose projectname folder
apply the rest steps with next and finish the import
Android Studio now has imported my project
try to test the new project by go to "Run -> Run..."
add a new "Android Application"
BUT THEN in the tab "General" you have to specify a "Module" otherwise you can't start the application
Ok and from here on I stuck.
I tried to do "Build -> Make Project" but this ends with multiple errors while Android Studio tries to compile the app.
I think the Gradle has conflicted with ant because they will generate same files. I delete the ant-build files then it works. Hope it be useful.

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.

Categories

Resources