git clone of volley library does not create android manifest.xml file - android

I did the clone of volley library by using git clone https://android.googlesource.com/platform/frameworks/volley link but it does not create AndroidManifest.xml file and because of that android update project -p . command gives error as AndroidManifest.xml not found.Please give me the solution for this problem.

After cloning the repository you need to import it as a library project:
Git clone the repository by typing the following at the command line:
git clone https://android.googlesource.com/platform/frameworks/volley
Import the downloaded source into your app project as an Android library project (as described in Managing Projects from Eclipse with ADT, if you're using Eclipse) or make a .jar file.
The instructions for Setting up a Library Project say that the AndroidManifest.xml file must be created manually:
Creating the manifest file
A library project's manifest file must declare all of the shared components that it includes, just as would a standard Android application. For more information, see the documentation for AndroidManifest.xml.
For example, the TicTacToeLib example library project declares the activity GameActivity:
<manifest>
...
<application>
...
<activity android:name="GameActivity" />
...
</application>
</manifest>

Related

Android Studio: Jar library use by import line

I was reading https://developers.google.com/cardboard/android/download. It said to download libraries which happened to be jar files. I've found how to add jar to my project in Android Studio. The question is
1) Can I add them to Studio so that in next projects I can use the libraries by just adding "import" line and how?
2) For the example it says "git clone https://github.com/googlesamples/cardboard-java.git". I don't know Git. I downloaded the example which is zip of file directory. Can I just open it in Studio without the "git clone" command and how (by the way, example contains jar libraries mentioned in point 1)?
Thank you very much!
You can work with project without using "git clone".
Download project archive, unpack it and open in AS with File - New - Import Project.

How to clone entire repo using eGit?

I am new to GIT. I have a manifest file that contains group of related projects. I installed eGIT eclipse plugin to clone the projects. I am able to clone projects one by one in the manifest file. But I want all the projects in my manifest file to by clone at a single time for a specific branch.
Manifest file
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="ssh://xyz.com:29418/" name="origin" review="xyz.com:8081"/>
<default remote="origin" revision="refs/heads/evo_main" sync-j="4"/>
<project groups="common" name="ACT.git" path="code/ACT"/>
<project groups="common" name="AppEngine.git" path="code/AppEngine"/>
.
.
.
.
</manifest>
I am able to clone a single project with the url
ssh://user#xyz.com:29418/ACT.git
But since there are lot of projects I need a way to download all in a single clone. I dont want to use GitBash or any other command line tools. I want to achieve this eclipse plugins. Please help!
You will have to write script that does it for you or to use external program like
mr
The above mr is a software that know how to handle sereveral repository types.
If you dont use anything like that you will have to write script that does something like:
- run on every folder in a given path (or give it a list of paths)
- verify that each folder is a git repository (has .git folder inside)
- execute your git command (like git fetch --all --prune or git pull ...)

Can't import the volley library in eclipse

i just got the volley library from the below link..
git clone-https://android.googlesource.com/platform/frameworks/volley
in eclipse i am following steps
import>git>project from git>....etc
and the library got downloaded in C:\Users\active\git\volley
when i just want to import the volley folder to the eclipse(C:\Users\active\git\volley) it shows "Select at least one project" in IMPORT PROJECT.and their is only one project though i have selected that still it shows the same error on the top..seriously need a help...thanks in advance
You need to build the jar and then add it to your libs folder in your project.
How to build the jar:
$ git clone https://android.googlesource.com/platform/frameworks/volley
$ cd volley
$ android update project -p .
$ ant jar
source
Here is a YouTube video if that would help: https://www.youtube.com/watch?v=5bwn7DYt2AI
You can also download a non-official build on maven central.
Edit:
It looks like volley can't be built with ant anymore (correct me if I'm wrong). All I did was create a new Android Project, mark it as a library project, create package com.android.volley, copy the source over to the project, and build it.
Check whether the project name is already exists in your workspace.
Right Click any project and click on properties.
Look at the directory of current WorkSpace under location.
Delete any existing copies of Volley or project with the similar name.
Re-import Volley.

Eclipse: How to import git project as library for Android Project which has to be pushed to Bitbucket

Sorry for the long title, here's the jist:
I have a android application project which I'm hosting on bitbucket.
There is a library on github I'd like to add as a dependency.
I'm unsure of
How to add the github project as a library to my Eclipse project?
How this will work when pushing/pulling from Bitbucket?
Thanks, David.
Setting your dependency as a library: you'll have to clone the project to a local folder, import it as a project into Eclipse, and in your project configuration you'll have to set the library project as a library: do a right-click in the project's name, go to Properties and under "Android" click in the checkbox "Is library".
Adding the library to the main project: In your main project, go to project properties the same way, and under "Android" click in the "Add" button and add a reference to your library problem.
More details here: http://developer.android.com/tools/projects/projects-eclipse.html
git: if you don't want to put the library's source code into your project you can add it to a .gitignore file and download it manually everytime you clone your project from Bitbucket. You can also take a look at git submodules: http://git-scm.com/book/en/Git-Tools-Submodules . Sorry but I never used them to give you more details.
If the library is a .jar file, you can simply paste it into the libs folder of your app. Android should automatically add it to the build path. As far as pushing/pulling from BitBucket goes, as long as you add the .jar file in git the library will be committed like any other file.

Adding google analytics to an android app

I have a working android app and now want to add google analytics to it. I am following the instructions here:
http://code.google.com/mobile/analytics/docs/android/
When I add the import statement:
import com.google.android.apps.analytics.GoogleAnalyticsTracker;
I get the error:
The import com.google.android cannot be resolved
I have created a libs directory in the project and placed the libGoogleAnalytics.jar file in it. I tried adding this to the AndroidManifest.xml:
<uses-library android:name="com.google.android.analytics" />
I have tried opening and closing Eclipse and doing 'Project / Clean'. Nothing seems to affect the problem. I am somewhat new to Java. What am I missing?
I think you should add library libGoogleAnalytics.jar to build path (in libs right click on libGoogleAnalytics.jar -> BuildPAth -> Add to Build Path)
Do not add anything in Manifest file and in your java file use cmd+Shift+O(for Mac, for Windows Ctrl+Shift+O) to automatically organize your imports)

Categories

Resources