How can I import/run an android project to eclipse? - android

I am trying to import an example project into eclipse. I downloaded the file SlidingTabsColors.zip from here, unpacked it, and then choose
Import -> Android -> Existing Android Code Into Workspace -> Browse -> ...
and selected the project named 'MainActivity'.
When I try to run this application the Console gives an error:
Could not find MainActivity.apk!
I thought the purpose of eclipse is to create the apk file...
Anyway, do I need to do some additional steps in order to run this example?

Do:
New -> Other -> Android Project From Existing Code
This should work no problem. Android does create the APK upon a successful compile. If you run into any issues, just do:
Project -> Clean
Here is a step-by-step tutorial on Tab Layouts with Swipeable Views. Which is what I believe you're trying to achieve.
Download Link: Source Code
Hopefully this helps.

Make a New folder in your computer.
put the java and res files in that new folder
just rename the folder from java into src
copy the AndroidManifest.xml into the root folder
now try to import this from eclipse

Related

Android Studio, Sample Code - Not working

There is sample code on the developer site that i wish to run.
When I import as a new Android Studio project, I'm not given any ability to run the code (disabled buttons).
I attempted to copy the source files over into the shell of a new project, but i than got errors that didn't make sense. reference to duplicate declarations in source files that had nothing relating inside them.
Is there an idiots guide on how to properly use android studio, or is it just this difficult?
In order to correctly import the project, you should follow the Samples guide as found in the developer docs.
To import a downloaded project:
Unpack the downloaded project package.
In Android Studio, chose File >
Import Project and select the root folder of the unpacked project.
Android Studio may ask you to choose the type of project you are
importing.
If this is the case, make sure to choose Import project
from external model and select the Gradle option.
Alternatively, if the Gradle option does not work, I would attempt to use the Eclipse option.
Open .gradle file when you import the project, not the folder of the proyect.

Troubles while importing HoloEverywhere

I'm following this guide:
https://stackoverflow.com/a/10888882/1943607
Follow the steps below to add HoloEverywhere
Download Zip from GitHub to your computer UnZip the folder Go to
eclipse and choose File->New-> Android Project
Select Create project from existing source and then browse to the HoloEverywhereLib folder
inside extracted folder
Press Finish
Right click on the newly created project and go to Properties. Under the Android heading, you should see a section for Library with a checkbox IsLibrary. Make sure that's checked and press Add and previously added library ActionBarSherlock.
I unzipped the folder. Then went to eclipse -> Right click -> Import -> Android -> Existing Android Code into Workspace.
I select the unzipped folder and It's showing this:
When I click Finish:
And then if I create a new project, and try to import it, It cant find the library; I type org. and it isn't showing up the rest (org.holoeverywhere.app.***Activity). (Like its github says https://github.com/Prototik/HoloEverywhere#how-to-use-maven)
Can you help me out?
Edit: I've also tried to remove src from .classpath files with same result
Clone the repository using Github desktop. Install eGit on Eclipse. Then use import-->Git-->Projects from Git.

Importing android source code as a project in eclipse

I have downloaded an android sample called custom view from android refernce from this location
http://developer.android.com/shareables/training/CustomView.zip
It only has the java files and other resources but does not contain any project file for me to import in eclipse as a project.
So when I import existing project into workspace, eclipse does not pick the project in the import dialog.
How can I import it into eclipse ? I have ADT tools installed already,
Thanks,
Ahmed
Maybe that's because you'll have to make the manifest.xml file.
What I'd suggest, is to create a new Android project, with the same package and Activity's name than in your zip (ie com.example.android.customviews and MainActivity), then copy/paste the files from your zip to the new project directory (thus replacingsrcandres` folders). That way, Eclipse will generate the manifest for you, with correct reference.
This should not take more than 30 seconds...
Go to Project Explorer and right click -> Import -> Select Android -> Existing Android Code Into Workspace -> browse to folder with your code -> finish
I encountered the same problem. I did thought that it's missing the AndroidManifest.xml file. I tried to fixed it and place it here. You can download it an try.

difficulty in importing the facebook-android-sdk into eclipse

I try to follow the facebook-android tutorial from here: https://developers.facebook.com/docs/mobile/android/build/#sample
I am working in windows 7.
I have installed the Git and cloned the GitHub repository running this command in the git Bash -> git clone git://github.com/facebook/facebook-android-sdk.git
Everything seemed fine and I got the folder “facebook-android-sdk” in my “Users” folder.
But when I try to import the project in eclipse workspace so to use it as a library I cannot make it work. I’ve tried 3 things:
Create the project from existing source (as the tutorial says), when I browse to the “facebook-android-sdk” folder and create the project, I get this message in my cosole: [2011-12-04 14:01:49 - com_facebook_android] AndroidManifest.xml file missing!
Also in the package explorer, the src folder seems to be empty.
If I try to import the project when I browse the folder I get a message “No projects are found to import”
I also tried to make a test project where I copied all the classes of the android facebook sdk so that I can use them. It worked up to a degree, but it does not seem a proper thing to do.
So what do I do wrong? Is there something else I should do using the git repository (I am completely new to git)? Or is there something wrong that I do when I try to import the project? I’ve searched the problem here and in other forums but didn’t find a satisfying answer (or maybe I did not understand it). Please help!
EDIT: I've tried one 4th thing
4: I extracted the jar out of the project I created in 1 (even if it had an error). It is working in terms that I can compile the code of the facebook-android tutorial step 6.2 - https://developers.facebook.com/docs/mobile/android/build/#sample. So far it seems that everything goes ok. But I do not know if this is right or I should have problems in the future..
I had the same problem. But now I think I solved it, even if the solution is not satisfying.
Create the project from existing source as the facebook tutorial says. Then make a right click on the project and choose "Import", choose "General" -> "File System" and go to "Next". Now click on "Browse..." and choose the folder .../facebook-android-sdk/facebook. Repeat these steps with the src and the res folder (right click on these folders for "Import", choosing the src and res folder in .../facebook-android-sdk/facebook).
Now it works. I don't know why Eclipse doesn't import all these things automatically, in the past it worked fine...
Make sure when you select the “facebook-android-sdk” folder you add /facebook at the end. So type into existing source C:/Users/facebook-android-sdk/facebook and it should work.
Make sure that your code's directory is dropped directly in Eclipse's root Workspace directory. There seems to be a bug in the latest version that only allows this kind of import/load when all code is directly in a directory in your Workspace. Otherwise it copies just a couple folders/files from where you put it, and not the rest, and gets quite confused.
I downloaded the file in zip format from the git directory. I created a android project, then i imported the zip archive (import ->archive file). It worked for me.
If you want to import projects into Eclipse, you do not have to go down to the src folder, just do
File > Import > Existing projects into Workspace
then go to the directory where the folder is, say your Documents folder C:\users\Documents
then just click 'ok'
The window then displays all the folders in the Documents folder.
you can then select the project you want to import and click finish.

android export eclipse project

I am trying to send an Android Eclipse project to another developer to view and modify. Which is the best way of doing that? I thought it might have something to do with file/export, but I can't work things out. The Eclipse version I'm using is Helios Service Release 2, build id is 20110218-0911
Right-click, Export -> General, Archive File -> Next -> provide the output path -> Finish.
Then give this to your developer. He can import it into his workspace.
I would just zip up the project folders and all sub-folders. Your recipient can then import that into their eclipse.
What worked for me was:
Export->General->File System
and then to a new workspace without any open projects:
Import->General->Existing Projects Into Workspace
I think that the most simple if you copy your Android project's map to a pendrive or something and then the developer import it to his/her eclipse. Hope it helps.
run your app in inbuilt emulator. this will result in apk creation somewhere .
locate the path as belows
workspace/your_app_name/bin/
there you can find the desired apk file.
simply copy it where ever you want :)
This is what i normally do and it always works:
Copy the project folder into your Eclipse workspace.
In Eclipse, File -> Import -> General -> Existing projects in Workspace
Choose the folder which you just copied into the workspace.
hope it helps

Categories

Resources