How can i compile kobotoolbox/odk collect in Android Studio? - android

I have a basic understanding of git and i have been using Github and Bitbucket
I was trying to get the source from
Github!
but i do not understand the given instructions in the read me.I have done my research , but i have found no solutions.
Things i have tried include
Importing the project into Android Studio
Copy pasting the source code into a new project

I have figured out the process, Here are the steps if any one requires them
Launch Git console
Make a new directory mkdir [directory name]
Change to that directory cd [directory name]
Clone the repos
git clone https://github.com/opendatakit/google-play-services.git
git clone https://github.com/opendatakit/collect.git
git clone https://github.com/opendatakit/gradle-config.git
These will automatically set these projects to the tip of master.
Now change gradle-config to be at the version required by collect/settings.gradle (e.g., 40)
cd gradle-config git checkout 40
(4) Open Android Studio ...New /Import Project... collect/build.gradle

Related

how connect myProject to mainProject on github (Android Studio)

in the past, I did not download the telegram source with the git but now i need update my source and I need connect myProject (my Unofficial Telegram), to mainProject (Telegram) on github. my IDE is Android Studio. git in Android Studio is in VCS menu. but I do not know what to do, for conect my project to github project.
Make sure you have git installed on your system. If not, go to this link and download it
https://git-scm.com/download/win
Right click inside your local project folder and select 'Git Bash Here'
(If you want to clone your entire GitHub project into your local project, do it by typing:
git clone https://github.com/DrKLO/Telegram.git
If you already have the files and you just want to update it, skip this cloning step)
Check if your project folder has .git folder in it. (Check the hidden folders too) If there isn't one, type the following in your GitBash window
git init
Add the link to your GitHub (remote origin) by typing
git remote add origin https://github.com/DrKLO/Telegram.git
Update your files with the GitHub source by typing
git pull origin master
If you just want to know how to connect your project in Android Studio to GitHub, here's a simple tutorial:
https://www.londonappdeveloper.com/how-to-use-git-hub-with-android-studio/
(Skip the steps where he creates a new GitHub repository and an Android Studio project, since you already have both)
For detailed understanding on using git and github, i suggest you take this course:
https://in.udacity.com/course/how-to-use-git-and-github--ud775

Create android studio project from ssh Git (bitbucket) link

I was given a ssh link to a bitbucket repo so I can work on the project. The link someone gave me was something like ssh://git#bitbucket.CompanyName.tools/sp/company-project.git.
How would I create an android studio project, linked to this repo, to work on this project and view the files? I have never worked with git so this is all new.
I do not see the repo in my main bitbucket account if it makes any difference or not
Create clone of the given repo by entering below command in your terminal :
git clone ssh://git#bitbucket.CompanyName.tools/sp/company-project.git
After cloning checkout to new branch by :
git checkout -b newBranchName
Last step, go in your Android Studio, and Import the folder where you have clone the given repo.
In Android Studio go to:
File->New->Project from Version Control->Git
then in the dialog enter the link provided in your question ssh://git#bitbucket.CompanyName.tools/sp/company-project.git
File>New>Project From Version Control>Git is what you need

invalid root mapping github project

invalid root mapping androd
i have download a project from github and open it in Android Studio it showing following error see image..
Check weather in the folder there is an hidden folder named .git that is supposed to contain the git information. If it's not there that is the problem.
Anyway other then that you could probably try to save as backup the current directory and clone it again in a new folder so that you can check if everything is the same.
If you have git in your shell (and I suppose you do since you are on linux) it's really easy, just try something like:
git clone repo_url
Says that the project android studio go configurations are incompatible. Either try to use the project with the git clone option, or delete the hidden .git extension.
The error happens because Android Studio found a remnant of git (something like .gitignore) in the project directory but not found any .git folder in the project. So it complaining that the project is supposed having a .git and giving an optional to create and set the root directory as a project with git. Other then that, you can work with the project without any problems.
When you downloading the project from the github via clone or download -> download ZIP, you will losing all the git files of the project. So you losing all the history of the project which is in the git. Instead download ZIP, you can clone the project with:
git clone remote_project_file
When you clone your project from git make sure you do (forgetting the recursive flag usually causes the vcs root mapping problem):
git clone --recursive YOUR-GIT-URL
or if you have already cloned then to fix it:
git submodule init
git submodule update

How to push an existing Android project to GitHub repo using .gitignore file?

I am developing my Android app on Eclipse. It works fine and run properly. But, I want to migrate to Android-Studio. Here is what I am doing:
Create a repo in GitHub with .gitignore, a README.md and LICENSE files
From within my project folder run the following commands:
git init
git add .
git pull git-url master
git init (again)
git add . (again)
git commit -m "First commit"
git remote add origin git-url
git push -u origin master
From Android-Studio, I checkout the project from Git
Run the app from Android-Studio (after alot of configrations)
My concern is that ALL my project files and folders are pushed to the remote repo at GitHub, including for example: bin\ and .settings\ folders. Meanwhile, I only need to push the important and platform independenet files because I work in both windows/mac systems and in differnet locations (hence, this is the reason behind using version-control).
My questions are:
How to pull the files on GitHub first, and then use .gitignore to push the "important and platform independenet" files from my project folder into GiHub
What is the recommended method to export a project from Eclipse to Android-Studio while using GitHub ?! should I:
checkout the project from Git (as I am doing now) ?
use Eclipse Export Tool ?
or clone the project first into a directoty and then loaded into Android-Studio as an existing project ?
You can pull your files by git pull origin master command from GitHub.
Add the name of the directory/file in .gitignore file you don't want to push. see more
You can clone the project first into a directory then load it in Android-Studio.

How do I create a branch using git and repo tools while working with android code

I downloaded the android code from source.android.com. Then I created a new branch from this code:
repo start mybranch platform/external/webkit
Then I tried to switch to the new branch using :
git checkout mybranch
which failed with this error message:
fatal: Not a git repository (or any parent up to mount parent /media)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not
set).
I tried the steps mentioned in the android link.
One more problem: when I use the command
repo branch
it shows only the branch which I created eailer. How can I switch between the code I have downloaded and the code I have made changes to?
The android source consists of several hundred git repositories. The repo tool helps maintain all these repositories.
Therefore when you are directly in the root of your android clone, you are not actually in a git repository. You have to enter a sub-directory containing a git repository before you can start using git commands.
For example the build/ directory is a git repository itself, you can try:
$ cd build/
$ git checkout mybranch
Which sub-directory you need to enter of cause depends on where you want to modify the android source. :)

Categories

Resources