I have downloaded a sample from this page. How can I run it in my android studio? Do I need to create a project or what?
You have to create a blank project using Android Studio or Eclipse with Android Bundle. After that you have to copy all java files from archive to your project in the src folder (keep the same structure), the resources (res folder) and replace the AndroidManifest.xml file with the one from archive.
To import a project to Android Studio:
Start Android Studio and close any open Android Studio projects.
From the Android Studio menu select File > New > Import Project.
Select the destination folder and click Next.
Select the import options and click Finish.
for more info:
http://developer.android.com/sdk/installing/migrate.html
Related
I am a long time iOS developer but brand new to Android development and am trying to import an already built Android app into Android Studio, the problems I am running into are
1) What is the right way to import this Android project I downloaded off the internet
2) What file in this project should I select to view the "Storyboard" of this application
Below is a screenshot of the file explorer from this project, I am currently inside of the folder called "My Project".
You have 2 options to import an existing Android project into AS:
Select the Import project (Eclipse ADT, Gradle, etc...), shown in the below image. Even though you know it's an Android Studio project, you should still try to import it this way, because sometimes the generated files are not customized for the environment.
Select File -> New -> Import Project. As shown in the image below.
The equivalent of the storyboards in Android are the XML layouts, which you can found under the res folder on the Android View in AS.
in AndroidStudio File->Open > Select root folder of the project.
Layouts are the storyboard for android.It's inside the app/src/main/res/layout directory.
I am importing a eclipse project into android studio . All steps are fine but at the end it asks for eclipse workspace path and its giving error like.
Cant Save Settings
Enter a value for workspace path /src/com/magtek/mobile/android/demo/EMVLanguage.java
Import project from eclipse to android studio like following steps:
Start Android Studio and close any open Android Studio projects.
From the Android Studio menu click File > New > Import Project.
Select the Eclipse ADT project folder with the AndroidManifest.xml file and click Ok.
Select the destination folder and click Next.
Please read this link. It might be helpful to you.
Reference Link
Happy coding!
How to import new project to Android Studio
Once you have unzip the file make sure
you delete duplicates of actual folder name
e.g QuakeReport-> QuakeReport ->app,.gradle,build, e.t.c
delete the duplicate sub file which it should be like this below
QuakeReport-> ->app,.gradle,build, e.t.c
then copy this file build.gradle file from your past android project into this project or visit https://developer.android.com/studio/build/index.html search for
dependencies {classpath 'com.android.tools.build:gradle:3.0.1'}
which you copy other codes located in that block of code only and name your file
build.gradle
Open your Android Studio
Click on File located at the left upper end of Android Studio
click on New file
Scroll to Import file
Select the file
Click on import
Click on import project from external model
Click on use local gradle distribution then select latest gradle
gradle file is often located at
C:/Program Files/Android/Android Studio/gradle/gradle-4.1
then follow other on screen instruction
if after you have done all that and the run(play button) is not active
or you see an on screen message gradle not present in this project
Click on clean project
then click on rebuild project
then there will be a message at event log
scroll if it is update gradle needed click on it and update
Gradle will be active
Click on Build.gradle of the application and select open with android studio
Can anyone give me some instructions of how I'm supposed to install Vuforia in Android Studio? I'm making a new app and I need to use augmented reality with Vuforia. Hope you can help me!
Thanks a lot!
You need to follow following Steps:
Read our Getting Started Guide for instructions on setting up the
Java SDK, Android SDK and NDK:
https://developer.vuforia.com/downloads/sdk
Make sure you have installed the latest version available of Android
Studio from:
http://developer.android.com/sdk/index.html
Use the Android SDK Manager (from within Android Studio) to get the
latest Android SDK and Android Platform and Build tools
Launch Android Studio
Select File - > Import Project ... and browse to the root directory
of the sample Vuforia project you want to open
Proceed in the Import Wizard dialog (click Next, Next) until you
reach a page with this message:
"Alternatively, you can fill in the actual path map in the table below":
click to edit
enter the actual path to the Vuforia.jar library (which is located under your vuforia_install_dir/build/java/vuforia)
In the Project view, right-click on the Project and expand the view
hierarchy so to locate the Vuforia.jar under app > src > main
right-click on Vuforia.jar to open the context menu
click on the "Add as library..." option in the context menu
Alternatively, if you cannot locate the Vuforia.jar in your project
hierarchy:
right-click on the Project and select, "Open Module Settings"
select "App"
then select the "Dependencies" tab
Click on the "+" button to Add a File Dependency and browse to the
Vuforia.jar file
Create a folder called "jniLibs" under the "app/src/main" folder under your Android Studio project directory
Copy the "armeabi-v7a" folder (including the libVuforia.so file
located inside it) from the "vuforia_install_dir/build/lib" to the
"app/src/main/jniLibs" folder
the resulting directory structure under your project root should be:
/app
/src
/main
/jniLibs
/armeabi-v7a
/**libVuforia.so**
If your project includes a "jni" folder, move it to a location
outside of your project (otherwise Android Studio may attempt to
compile the sources in that folder and may fail)
Clean and rebuild the project
Run the app on your device
Best Luck :)
answer from here and work for me:
(Seems like the project needs access to the Vuforia.jar file and can't access it outside of the sample folder(?))
So,
copy the Vuforia.jar file from the folder \vuforia-sdk-android-x-x-x\build\java\vuforia to a folder in the sample project, e.g. to \samples\app\libs
(it's important it's in the "\app" path, so you can find it in the next step)
in Android SDK hit F4 (or right click on the app folder in the project structure and click on "Open Module Settings".
Select the tab "dependencies", click on the "+" to add a dependency and select "2 File dependency".
Now select the above path and file ((\samples\app) \libs\Vuforia.jar) and the project will run just fine...
Good luck.
I don't have 50 reputation so I can't comment on:
https://stackoverflow.com/a/24741965/1487317
If I follow that linked solution, will the directory structure in the git repository be converted to Android Studio structure?
If not, how do I import Eclipse project with source control to Android Studio without changing the directory structure?
Yes, following that will result in the directory structure being converted to the new structure, although the history is preserved.
In order to import Eclipse project with source control to Android Studio while preserving the directory structure, do NOT import from Android Studio.
Instead, export from Eclipse the Gradle build files.
In Eclipse:
File > Export > Android > Generate Gradle build files > Next
Check the desired projects > Next
Finish
Then in Android Studio:
Import project
Navigate to the folder of the Eclipse project to import
Choose the build.gradle file (NOT THE PROJECT FOLDER)
After that, Android Studio will load the project without changing the directory structure. Note that if you import this way, the Eclipse project is NOT copied.
No. I imported an Eclipse project into Android Studio some time ago and it kept the old Eclipse structure. The importer was kind enough to just set up build.gradle to accommodate that structure.
i downloaded a zip file of LISTViewTutorial, with all files, but i dont kno how to open it in eclipse, as it just opens the file, not whole project....
and i downloaded it from here
http://mfarhan133.wordpress.com/2010/10/14/list-view-tutorial-for-android/
thanks lot
Or
File > Import > Existing Project into Workspace
Open eclipse
go to file->new project
choose your project type (e.g. android)
select "create project from existing source
Start Eclipse , FILE >> NEW >> ANDROID PROJECT. A form will come up , click on start project from existing source , navigate to the required directory and your project will open in Eclipse.