How can I check out Android source code in Windows OS? - android

I try to search for it but I just cant. I am running Windows 7 on Lenovo G460 laptop. I tried to install Ubuntu on it but I cannot use Wireless to connect to the internet for some reason.
Is there anyway for me to get a look at Android source code or at least just the Calendar part of it?

You can browse the android source code using their repository browser. If you want to check out a specific project (i.e. download the source), you will need to get the version control system Git. When you have Git running, you can either clone a complete repository using git clone https://android.googlesource.com/projectname.git or just get the HEAD (the most current version of all files, useful if you only want to browse through the source) by doing git clone --depth 1 https://android.googlesource.com/projectname.git.
The project name is the top folder you select on the repository browser, for example platform/packages/apps/Calendar for the Calendar app. Then the full command is git clone https://android.googlesource.com/platform/packages/apps/Calendar.

The GitWeb and Google Code Search repositories for Android have been retired since this question was originally answered. Fortunately, the SDK Manager finally allows you to download the source code for Android 4.0 and later along with all of the APIs and tools.
If you need access to pre-Ice Cream Sandwich (4.0) Android source code and don't want to use Google's non-Windows download instructions, you can search GrepCode for what you need online. (Look for "android" and the name of the class or method you want, and then pick the version of the code you want.)
GrepCode works, but I have seen it crash IE a bunch of times. An alternative would be to download the Android Sources plugin for Eclipse, which gives you all of the source code for versions of Android up to 4.0.1.
Once you have the source code, you can attach the source directory you are using to your .jar in Eclipse, as follows:
Right-click the project > Properties > Java Build Path > Libraries tab > select the + beside the .jar you want to attach source code to > click on Source Attachment to edit the path to where the source files reside.

Thanks a lot, a quick guide on helping the download in windows, check this
http://honey200.wordpress.com/2011/11/17/download-android-source-code-in-windows/

Steps:
Download Cygwin from http://cygwin.com/install.html.
Install cygwin with almost all defaults. During cygwin setup, select modules curl and python (search for them) and mark them to be installed.
Start cygwin.exe and go to your preferred directory (mine is D:/Android/sources/4.0/try2). Example: $: cd /cygdrive/d/Android/sources/4.0/try2
Run the below instructions one by one:
i) mkdir bin
ii) PATH=/cygdrive/d/Android/sources/4.0/try2/bin:$PATH
iii) curl https://storage.googleapis.com/git-repo-downloads/repo > /cygdrive/d/Android/sources/4.0/try2/bin/repo
iv) mkdir source
v) cd source
vi)
Master branch:
repo init -u https://android.googlesource.com/platform/manifest
4.0.1 branch for example:
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
vii) Give credentials if needed
viii) repo sync
Source: click here

1) Install Git: http://git-scm.com/
2) Open Git Bash from Start Menu > Git > Git Bash
3) In Git Bash window, change current directory to your favorite directory (For example D:\android_src) by following command: cd /d/androidsrc/
4) In Windows Explorer, create an empty file D:\android_src\download.sh and open it by notepad
5) Open the following link and copy the code & paste it into D:\android_src\download.sh, then save and close the notepad:
http://pastebin.com/DfqBFKnK
6) Execute download shell script in Git Bash window by following command: ./download.sh
See also: https://android.googlesource.com/

Install cygwin, and install the cygwin verion of git, then follow the normal instructions for installing repo.
You'll want to have git around anyway - it's become the standard vcsfor modern dev work. Some stuff is in svn still, but that's dying out.

For me the easiest way is to browse it on GrepCode.

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

Bitbucket with android :"Can't publish part of repository" error

I have recently use Android studio and I was just try to connect bitbucket with it.
I don't want manually bitbucket by terminal thas why I googling it. find some links link .
I have follow all the steps install plugin>shareproject>login>private>share project
and than error. I checked my bitbucket but no repositary created.
Can't publish part of repository
Invalid VCS root mapping The directory
ExpandableLayout-master\TestProject is
registered as a Git root, but no Git repositories
I don't know is thare error of plugins of bit bucket or my android studio
After to much research... finally i got answer
Actually it is bug of bit-bucket plugin. bit-bucket bug
Here is solution given by AKAMUZA in above link thanks bro.
(1)Go to project folder and delete .git folder
(2) IDEA pops up an error message about project not being under version control and an option to configure it. Press Configure and just delete the path to your project in VCS section.
(3)After this Import into version control -> Share project works like a charm.
UPDATE
I Found many developer having issue after use plugin directly from Android studio and if It not work you can download below plugin
https://bitbucket.org/dmitry_cherkas/jetbrains-bitbucket-connector/downloads/jetbrains-bitbucket-connector_IC-139.224.zip
Go to Setting-> Plugin-> Install plugin From disk ->above downloaded plugin -> install & resatart.
You can feel Magic after restart :P
I have the same problem with android studio.
this is my suggested solution:
go to project root folder
then open a terminal in this folder:
git init
git add --all
git commit -m "your message"
then go to bitbucket and create new repository then choose "I have an existing project" ...
Now you can use plugin to push/update
This thread mentions (assuming that File > Settings > Version Control is set to "git"):
You could instead have navigated into the directory via a terminal or shell and typed 'git init'. That would have converted that directory into a git repository.
So check if ExpandableLayout-master\TestProject has or has not yet a .git subfolder in it.
If not, it means you have declared that path as a git repo, but locally, on your disk, that folder is not yet a git repo. If so, you can initialize it, add a remote pointing to an empty bitbucket repo and push.

Getting "Repositroy test has failed" error while cloning repository from Gitlab in Android Studio?

I will like to clone my android code from gitlab repository in Android Studio 0.8.1.I checked into VCS >> Checked out from Version Control >> Git >> Added HTTP url here.It prompts me that "Repositroy test has failed".Kindly help me to sort out the issue.I have checked the plugins as well.Thanks a lot.
You need to download and install git from http://git-scm.com/downloads
Then you need to track the git.exe on AndroidStudio:
Go to Settings > Project Settings > Version Control > VCSs > Git > Path to Git executable
Select (or type) executable path, eg: D:\Program Files (x86)\Git\cmd\git.exe
If you installed GitHub Desktop for Windows
In case you have GitHub Desktop for Windows, git.exe will be found at C:\Users\YOUR_USER_NAME\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565zz218z5214zzz0e854zzza28\cmd.
If you Installed git from http://git-scm.com/downloads and also sett the correct path and still get an error maybe you sit behind a Proxy, in this case you have to add the Proxy to the git. This is Possible in the gitconfig. Wich should be avaiable in :\Program Files (x86)\Git\etc if you used the standard path for installation.
I am on Ubuntu 16.04 (this applies to other versions as well) and all I needed to do was to install git from apt-get:
sudo apt-get install git
This means Android Studio was trying to execute git command but it could not be recognized so if you have git installed then try to execute git from terminal and if not recognized then you should configure paths to git executable. That was it!!!
Just to add to Sree's answer, I was getting this error even after installing Git, but the problem is that I didn't install it to the default installation folder.
After choosing the right path and folder in the VCS settings tab, it worked beautifully.
I opened the HTTP URL in browser, that my collaborator sent me:
https://github.com/mansonpeter/GoUpApp/invitations
for download and join the developing team, there was an accept button, after accepting hopefully the error gone, repository test was successful and I got the project in android studio. before this I had tried all the suggestion on this page and non of them was efficient.
Try unchecking the "Clone git repositories using SSH".
I'm in Linux, At first check you have the appropriate certification to know this you can clone the repository in terminal if you get error similar this
fatal: unable to access 'https://YourDomainName/Project/GitRepository/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
then open your domain in browser and click on lock in the left of url go to detail and press export to save the certification and finally copy the content of the file and pase it into
/etc/ssl/certs/ca-certificates.crt
For me this solution for the issue worked.
Goto Settings > Version Control > Git and set SSH Executable to "Native" instead of "Built-in". Then restart your IDE for settings to apply.
Worked for me in all jetbrains IDEs.

ADK 2012 and Android

Following the steps here to start developing android accessories with ADK 2012, there is this step:
Copy the < adk-source-download >/adk2012/board/library/ADK2 directory
and its contents into your sketchbook/libraries/ directory, so that
you create a sketchbook/libraries/ADK2 directory.
This is my very first time working with ADK 2012 so I'm not quiet sure what I'm supposed to do in this step, so maybe if someone could clarify it more for me?
Thank you.
The ADK2012 source must be downloaded and compiled using Git. This separate from the zip files you also download from the Google page. The zip file contains the Arudio IDE only.. If using windows you will need to pay special attention to the "note:"
From<Downloading the ADK Source>:
Download and install Git for your development system.
Download and setup the repo tool, as described on the Android open source project site.
Note: Developers using Windows must use a Linux compatibility package, such as cygwin, to install and run repo. Within your compatibility environment, you must install curl, git and python to be able to download and use the repo tool.
In a terminal window, create a new directory for the downloaded source files, initialize and synchronize a local repository:
$> mkdir android-accessories
$> cd android-accessories
$> repo init -u https://android.googlesource.com/accessories/manifest
$> repo sync
This is the hardest part.... If you make this this far you are on the path for success!
You should now have a folder called android-accessories with sub-folders /adk2012/board/library/ADK
Now you need to copy the ADK folder to your Arduio libraries folder
You need to find the location of your "sketchbook/libraries" folder. This folder was created when you installed the Arduino software. In Arduino click --> File --> Preferences. The first item should be "Sketchbook location". This folder will have sub-folder called "libraries.
Once you copy the ADK folder to library you can move to set 4 (restart Arduio) on the google help page

Why can't I see any android source files in working Directory?

I'm downloading Android source code using the following command.
repo init -u https://android.googlesource.com/platform/manifest -b Android-4.1.2_r1
repo sync
I've almost downloaded about 1.4 GB of files, but there is no source code in working directory. Working Directory has only one folder ".repo" (Which is about 1.4 GB and does not seem to include source code).
Is this correct way to download android source code? If not, where am I going wrong?
Finally Got answer.This is working as it should!
First it fills up .repo folder, which can be huge(10 GB). Only after that repo script downloads android source code.
References:
1. After Repo sync, there are no files in the directory
2. What are the purpose of the bare git repositories in .repo/projects/ created by the Android repo script?
If you want to work with android you will want to install the Android SDK. This page explains how:
http://developer.android.com/sdk/installing/index.html
From the SDK Manager, found in the tools directory, you can download any version of Androids source code you would like.
The Android source code actually has an empty master branch.
Unless you specify a particular branch to repo, it will always pull the master branch.
The reason that Android has an empty master branch for many of its repositories is because, the user is expected to use a particular version of the Android source rather than the latest.
(The latest is also typically a branch..but not master)
try something like this
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
You should see files other than just the .repo folder

Categories

Resources