Extract source code from .pack files - android

I followed the directions on http://source.android.com/source/downloading.html to get the Android source code. Now I have downloaded 2 GB of stuff, most of the space is taken by .pack files. Now how do I access the code?
I tried
git unpack-objects < pack-78609e1ab8b627ff3b749e8d4c78e86e096de3d8.pack
the output is:
Unpacking objects: 100% (14014/14014), done.
Is this the correct way to access the source code and where does it unpack to? Where's the output dir?

Git internally uses objects that are explained here http://book.git-scm.com/1_the_git_object_model.html. These objects may be compressed together in a pack. Anyhow, I do not expect you have anything to do with objects and/or packs. So, could you give a bit more detail on the steps you did and the files you ended up with? (Note: I'm not familiar with the Android repo-tool, but I am with git)

the unpacked files are put in the local .git directory. Use:
git checkout master
to put them in the local directory.

Related

GitHub Desktop won't detect changes when I make a build apk?

I'm building a voice recording app and right now I'm backing up all of my code to GitHub and a memory stick. Whenever I make it build it saves it into the file directory that GitHub desktop it's backing up, but it won't detect some of my files. Such as: app.iml and app-debug.apk.
Has anyone else had this problem and if you have fixed it could you tell me how?
Those files shouldn't be committed or relied on since you will need to rebuild the project anyway when you do a fresh checkout. Your code might be different than your compiled code depending of how you added them. Check out this thread that talks about javascript Should compiled JavaScript files be committed to Git repo?
Sounds like Git ignoring files and directories specified in the .gitignore file in the root of your repository directory.
See lines from one of my repositories:
*.iml
..
..
/build
Your apk file is just the latest build of your code, so the source code saved to GitHub is the backup.

How can I access android.developer site offline?

I am a beginner,
I want to download all documentation of this site:
https://developer.android.com/studio/intro/index.html
But I cannot do it.
You don't need to download , it's already included in android sdk
so go to your android sdk folder and look for docs folder
e.g
c:\....yourpath..\sdk\docs and in this folder look for something name as index.html page
Note: look for your sdk in the specific drive e.g E,D
most of site content will be there but don't expect the complete content/resources of other linked sites
I am posting an answer because as of the latest Android Studio(2.3), it is found in your AppData directory which is hidden by default. Find it here:
C:\Users\<Your User Name>\AppData\Local\Android\sdk\docs\
You can start with index.html and post opening, you will find the search in the top right hand side corner.
A few days ago I downloaded all of the documents available on the site
https://developer.android.com/
for my own personal use. These documents are now uploaded to Google Drive as two separate archives for public usage,
in the hope that it will be useful to those who need it, but WITHOUT ANY WARRANTY.
The first archive is:
android-developers-docs-2020-02-23.tar.xz
with the following specifications:
the size of the archive file is: 925 M
disk usage after extraction is: 17.9 G
number of files in the archive is: 36735
code samples are not included in this archive.
The second archive (for those who need to access code samples offline too) is:
android-developers-gits-2020-02-23.tar.xz
with the following specifications:
the size of the archive file is: 6.6 G
disk usage after extraction is: 9.1 G
number of files in the archive is: 200030
this archive should be extracted in the same directory as the first one.
After unpacking the second archive file, please do:
cd android-developers-docs
mv github.com github.com.OLD
ln -fs github.com.git github.com

Using a linked file in Assets directory - FileNotFound Exception

I am trying to link to an external file from a shared repository between my iOS and Android apps. This does not present a problem for iOS, but it does for Android. My current solution is to create a copy of the file from the external repository and place it in my projects Assets folder. This solution works, but is not much of a good one in my opinion and involves too many extra steps.
Using Eclipse, I am able to link to a resource. It's as simple as copying a file into my Assets folder and being prompted to either copy the file or link to the resource. If I link to the resource and try to run my app, I get a FileNotFoundException. If I copy the file instead, the app file is found just fine.
Ideally, I'd like to link to the file so that when I pull a new update from git then I don't need to copy the file over every single time. I'd prefer to link to the file.
I don't know what Eclipse uses "under the covers" for "Link here" drag-and-drop stuff. However, it is an Eclipse-ism. Android's build tools are fairly isolated from Eclipse proper, and so they won't know about those links.
Using a hardlink, or perhaps a symlink, at the OS X filesystem level should work, as both Eclipse and Android's build tools should treat it like a local file.

How to correctly use Git with Eclipse for AndroidDevelopment?

I am currently using Git on the command line to help me incrementally add features without breaking existing code. The part that worries me is this line of output from Git after committing:
[optimized_managed_event 6c9a98c] Added managed event insert into my ContentProvider
12 files changed, 202 insertions(+), 16 deletions(-)
rewrite bin/classes.dex (87%)
rewrite bin/classes/com/zeroe/SmartCalProvider.class (85%)
Should I worry about the rewrites if they are .class files and other types that aren't text? I am fairly new to Git, but am pretty comfortable with the command line and I understand the basic workflow for most Git projects:
> git add .
> git commit -m 'comment on commit'
> git checkout [master]
> git merge [branch]
What I am slightly worried about is issues that can occur when committing, then merging since Android projects have a lot of files that it creates itself in different formats.
My question is essentially in anything I need to worry about when doing this in Android development?
Create .gitignore in the root of your project and add at least the following:
*~
*.apk
bin
gen
local.properties
.apt_generated
This way you avoid putting in repository automatically generated files, which usually blows the repository size up without any reason. The only automatically generated files you might want to save are proguard/ files, which might be necessary to unroll the call-stack after the user-generated crash reports.
Also, I found it's very helpful to have giggle utility installed to see what changes you have in your files.

On downloading Android source, all I get are a bunch of empty folders

I have tried the steps in the Android Source page.
I can see the sync happening but the process completes without downloading any real source files, there are only empty folders with some their names ending with {.git}.
Is there something wrong here ?
or
Is there a step I do not know of that will pull the source files to there respective folders ?
The same repository is also on github: https://github.com/android,
platform_frameworks_base is the actual android framework...

Categories

Resources