I have a slow & erroneous Internet connection which disconnects now & then.
So I like to know, if there is a way to download the android source directly rather than
repo sync
Or If I download the source in another machine, how can I configure/setup in my machine?
repo sync is the officially supported method of getting Android sources. You can do repo sync on another machine and move the source to your development machine, there should be no special setup necessary for doing so, just copy the files downloaded by repo to your development machine (take care to copy all the hidden/dot files as well).
One option is to use the technique that Lie Ryan mentioned to get it to one machine F via a reliable Internet connection first. After that, you could consider using a tool such as rsync on the machine S with the slower/unreliable connection to keep the entire project tree between F & S in sync (I believe rsync supports resumption automagically, though I have never tested this).
Hope this helps.
Related
I have an android project checked out from git into an ubuntu server. I will be doing git check-in and check-out files inside this ubunut machine.
I have installed Android studio in my local system .i.e. windows machine.
Is it possible to use FTP in Android Studio to directly import the project from ubuntu server and edit them without copying to my local windows system. I did search around the internet and couldn't find any posts regarding how to do this.
I'm aware that we can install Android studio in Ubuntu itself, but I'm not allowed to do that.
It would be very helpful if anyone throws some light on this.
FTP is not enough, you need something like NFS that allows a user on a client computer to access files over a computer network much like local storage is accessed.
It looks like this functionality is only available on IntelliJ IDEA Ultimate Edition, which Android Studio is based on. It looks like the server only stores the files and IDEA on the client does the heavy lifting. For Android, there's also the question of running emulators, which I assume is also done on the client.
Not sure what the delta is between AS and IDEA, but you can develop Android apps on it.
As the question title states, can I install node.js on Android without root? I have a couple terminal emulator apps and at least one of them has BusyBox, git, and adp, among other things, though I am severely limited in what I can do with them. For example, I can not just git clone the node.js source code, as "No auth methods c[an] be used". I can download the node.js source code, but it seems to be under the "system_server" user as soon as it's downloaded, which I assume is the root user or very close. I am able to unpack it, but unable to run the configure executable in this directory, I assume because it is owned by root as soon as it is downloaded.
Am I trying the right approach here? I have heard about anode, but its wiki is empty and whatever instructions it has are confusing and do not say whether I need to be root. Everything else I have seen tells me I have to have a rooted Android to install node.js, but I hate to give up after so much effort.
Instead installing node.js on the android device, try jxcore.
You can download an android executable binary from its download page, and execute it from the terminal emulator. Remember to set up exec flags.
EDIT: jxcore seems no longer under development.
Hey guys I am new to porting android os. I am trying to download android source and wanted to know which git repository should I download for kitkat. And alos I want to download the source in GIT windows as I do not want to use linux terminal and repo for downloading the source.
Also, will downnloading https://android.googlesource.com/kernel/msm/+/android-msm-hammerhead-3.4-kk-r1 give me the source or will https://android.googlesource.com/platform/build/+/master give me the source?
Note: I have a very limited download limit at high speeds so I only want to download the relevant source files. No prebuilt Images or and device Images. I just want to download the source for stock kitkat android and use it in ubuntu for further building.
I think that you don't understand the organization of the Android source. It is a forest of git repositories, maintained, as CommonsWare says, with a tool called "repo". Theoretically, you could clone each of the, approximately, 450 git repos, separately. I suspect it would be pretty hard to do.
When you download the source, you will get all of the versions, tagged appropriately. You need only checkout at the right tag.
You could try github, to download zip files of the branch you require. It also seems to have android kernel files, but you need to search for what you need.
The android kernel msm (for qualcomm) source code
https://github.com/android/kernel_msm
The android source code
https://github.com/android/platform_frameworks_base
The website says it is a mirror of the google server. Which means it should work.
I use two computer for coding. My desktop pc and the notebook. I sync the two computers with dropbox. How can I import/load a project on each of this two computers? The project base folder is different on each computer. When I try to load/import a project which is created on the other computer it loads the project but I got a error with a wrong path.
"Gradle "Test2Project" project refresh failed:
Could not fetch model of type "IdeaProject" using Gradle distribution "http://services.gradle.org/distributions/gradle-1.6.zip".
Project directory "C:\Users\thomas\AndroidStudioProjects\Test2Project" does not exist."
The wrong pfad is the right pfad on the other computer. How can I import Android Studio projects so that it works even on another computer with a different folder structure?
Like the others i agree, that using a VCS would be the best solution. Even though you can try to filter all android studio related files (like *.iml, .idea folder and local.properties). I don't know if you can do this with dropbox or if you need some kind of 3rd software.
After that you should be able to make source code changes on both computers without greater problems. (You may have to declare project dependencies changes for the android studio twice)
Builds depending on the build.gradle files should work to. But again: using a VCS is the better way to go.
Go for git, you can use bitbucket.com as a free remote repository.
This is a problem I have ran into when trying to store Android projects in a Dropbox folder. What happens is that Machine 1's IDE is mapping system resources (like the SDK) as being in that machine's filesystem. When you go to Machine 2, everything will work EXCEPT for what you expect--because the SDK will probably be in a different spot!
One way to get around this is to use your VCS (dropbox, git, whatever) as a repository for JUST your source files, and then have a local project created on each machine that reads from the Dropbox folder. This requires two separate projects that are mapped differently, but that have the same source folder.
I discovered this problem when I tried to load up an Android project on a new install on a Mac machine:
Do you see what's happening there? My Mac Android Studio is saying, "Hey, I don't see where "C:\Android\SDK is, but I do see that you have an Android SDK in a different folder, so I'm going to update your project files to reflect the actual location of the SDK."
In my opinion, the only way around this is to create your project on both machines, and version control your source and assets folder. If you don't create the project separately on each machine and use VCS for just the source and assets, the only way to get around build and filepath errors is to store your SDK in the same folder on each machine. This worked for me when I was building on a Windows desktop and Windows laptop, but no longer works for me since I am using a Macbook Pro.
I know this was questioned about 4 years ago, but this is up to now still an issue. Using a VCS seems like a good solution, but for me it is simply more overhead than i want to have. I also use Dropbox to synchronize my folders and the history they provide is for my private programming needs good enough. So i think, it would be good, if android studio simply uses relative paths.
I know it needs some system paths and it does a good job in looking at the local.properties and setting it to the correct place when the project is loaded.
The main problem with using Dropbox are the build-directories. There are many many references to fully qualified paths in the files within these directories. So my solution was to exclude the build-directories from Dropbox-synchronisation.
When you work at your laptop, build the app, create new files, change files or delete files, the build on your pc will be completely outdated when you switch back to it. but android studio will recognize this and do a fresh build when you start your project for the first time after working on the laptop.
so the biggest problem at this point is the file local.properties and this is handled correctly by android studio. it may be a good idea (or a really bad one, i don't know the drawbacks) when the build system wouldn't write fully qualified paths in the files within the build directory.
But up to now this is my solution for using Dropbox and not using a VCS:
exclude build-paths from Dropbox synchronisation
i hope this helps somebody.
I have a desktop application using git for synchronization. I have also an android application which do the same as the desktop, but I don't know how to do the synchronization part on it. I haven't found any implementation of git on android. I found a jgit, but its unwell documented and I was not able to do even a commit with that.
I was thinking about remote commands to my git server from my android app, but this is really a tease for me.
Could you tell me if any other git implementation which can be used on android exists? If you have any idea how to solve that, please tell me.
Since this question was first posted, an Android app has been added to the market that can checkout Git repos, called Agit. It can't commit or push yet, but the clone/fetch/pull functionality is useful. The other issue is that a patched version of ConnectBot needs to be installed before Agit if you want to use SSH keys. If you already have ConnectBot, uninstall it first. I did not do this and ran into problems.
Edit: As of April 2021, the ability to push and pull has been added, however, it does seem to be very buggy as I have only been able to pull changes, but never push them.
Another option is using ASE. There seems to be a full-featured pure python implementation of git at https://github.com/jelmer/dulwich.
You can install https://github.com/termux/termux-app # https://play.google.com/store/apps/details?id=com.termux, then you just need to open the terminal and type:
apt update
apt install git
If the device is rooted, you can also use debian's debootstrap ( http://wiki.debian.org/Debootstrap ) application to create a debian/armel image, mount it in your android device and chroot to it, you have aptitude here so any package available for armel can be installed on your device (to install git: aptitude install git). Look here for information on how to install debian for your android: http://lanrat.com/install-debian-on-android/
Some other solutions that are now available, besided Agit, since this question was last answered:
A git & mercurial client for bitbucket called Bitbeaker
A git app from github
The Android Java IDE AIDE also has git functionality, so you can download from a git directory and if its an Android app modify and run it aswell.
You can also try Pocket Git: https://play.google.com/store/apps/details?id=com.aor.pocketgit
Pocket Git supports SSH (with passphrases, but private keys seem to have some issues) and HTTP, cloning, stage, unstage, commit, push and pull; create, delete and merge branches; and it also has a graphical log viewer and can show diffs.
Disclaimer: I'm the developer
A lot of already existing apps have been posted in the answers, but following links might be useful for those looking for their own implementation:
libgit2
This is a pure C implementation that claims to be highly portable. And the project also describes how to compile the sources for android platform. Now what needs to be done is to write a JNI binding for it. Even an executable binary would be sufficient in some cases.
HTTP (dumb) protocol
As an alternative, if one's purely interested in read operations from a repository, this protocol can be implemented over HTTP. There is also a smart protocol which depends on ssh and does differential transfers.
JGit Core Sources
Using just the core package from its sources. All the javax.* dependencies and other incompatible/alien classes will needed to be replaced with android alternatives though. But worth the effort if a pure Java implementation can be ported to android.
I would suggest to take a look at Gidder. It's Git server implementation for Android with user and repository management and also support dynamic DNS. You can easily store your code in your Android device and access using a WiFi connection.
MGit is the successor of SGit, and it works very well for me.
Update:
Comment underneath this answer by OP- (Nathan Osman)
unfortunately, I was forced to pull the application after some recent policy changes on the Play Store that required publishers to have their address displayed on the application's store page.
Original Answer
I've just (circa April 2013) published an app on the Play store named GitDroid. The application allows you to do the following:
clone remote repositories
pull from the remote and merge new revisions
view commits and browse files
The app cannot push to a remote or make local commits yet - this is planned for a future update.
This is how I would do it:
Well you likely want to define an interface for your synchronization needs.
You implement this interface in C for both desktop and android device (with the help of the NDK) by making the implementation use git (native).
Then, for the Android app, you code a JNI layer on top so that it exposes the interface to Java.
The tricky part would be to have the different git commands compile for Android: you'll have to rewrite makefiles.
Try SGit, it can commit & push over SSH with pssphrase-less keys and it is available on F-Droid. It is built on top of JGit. It is not perfect (yet) and JGit implementation is not as good as original Git, but looks usable.
You can install git on android with Termux. Just install from Play Store and run the command:
pkg install git
Reference: https://mvprepublic.com/blog/2020/04/08/how-to-run-git-on-android-devices/
Update: CubeGit has been removed because of changes inside the Android system and missing time / incentives to update.
Please pick one of the alternatives.
One more option is was CubeGit.
We have released CubeGit on Google Play a few days ago.
It is an interface to a cross compiled git binary and also supports local commits and push via ssh/http/https.
JGit - http://eclipse.org/jgit/