Android/Android&Kernel2011/03/11 14:07
[Android Developer Blog]

In Introducing Renderscript I gave a brief overview of this technology. In this post I’ll look at “compute” in more detail. In Renderscript we use “compute” to mean offloading of data processing from Dalvik code to Renderscript code which may run on the same or different processor(s).

Renderscript’s Design Goals

Renderscript has three primary goals, given here from most to least important.

Portability: Application code needs to be able to run across all devices, even those with radically different hardware. ARM currently comes in several variants — with and without VFP, with and without NEON, and with various register counts. Beyond ARM, there are other CPU architectures like x86, several GPU architectures, and even more DSP architectures.

Performance: The second objective is to get as much performance as possible within the constraints of Portability. For Renderscript to make sense we need to achieve much greater performance than established solutions.

Usability: The third goal is to simplify development as much as possible. Where possible we automate steps to avoid glue code and other developer busy work.

Those three goals lead to several design trade-offs. It’s these trade-offs that separate Renderscript from the existing approaches on the device, such as Dalvik or the NDK. They should be thought of as different tools intended to solve different problems.

Core Design Choices

The first choice that needed to be made is what language should be used. When it comes to languages there are almost unlimited options. Shading style languages, C, and C++ were considered. In the end the shading style languages were ruled out due to the need to be able to manipulate data structures for graphical applications such as scene graphs. The lack of pointers and recursion were considered crippling limitations for usability. C++ on the other hand was very desirable but ran into issues with portability. The advanced C++ features are very difficult to run on non-cpu hardware. In the end we chose to base Renderscript on C99 because it offers equal performance to the other choices, is very well understood by developers, and poses no issues running on a wide range of hardware.

The next design trade-off was work flow. Specifically we focused on how to convert source code to machine code. We explored several options and actually implemented two different solutions during the development of Renderscript. The older versions (Eclair through Gingerbread) compiled the C source code all the way to machine code on the device. While this had some nice properties such as the ability for applications to generate source on the fly it turned out to be a usability problem. Having to compile your app, install it, run it, then find your syntax error was painful. Also the weaker CPU in devices limited the static analysis and scope of optimizations that could be done.

Then we switched to LLVM, moving to a model where scripts are compiled and analyzed on the host using a modified version of clang. We perform high level optimizations at this stage, then emit LLVM bitcode. The translation of the intermediate bitcode to machine code still happens on the device (along with additional device-specific optimizations).

Our last big trade-off for compute was thread launching. The trade-off here is between performance and portability. Given sufficient knowledge, existing compute solutions allow a developer to tune an application for a specific hardware platform to the detriment of others. Given unlimited time and resources developers could tune for every hardware combination. While testing and tuning a variety of devices is never bad, no amount of work allows them to tune for unreleased hardware they don’t yet have. A more portable solution places the tuning burden on the runtime, providing greater average performance at the cost of peak performance. Given that the number one goal was portability we chose to place this burden on the runtime.

A secondary effect of choosing runtime thread-launch management is that dynamic decisions can be made about where to run a script. For example, some compute hardware can support pointers and recursion while others cannot. We could have chosen to disallow these things and give developers a lowest common denominator API, but we chose to instead let the runtime analyze the scripts. This allows developers to get full use of hardware that supports these features, since there is always a fully featured CPU to fall back upon. In the end, developers can focus on writing good apps and the hardware manufacturers can compete on making the most fully featured and efficient hardware. As new features appear, applications will benefit without application code changes.

Usability was a major driver in Renderscript’s design. Most existing compute and graphics platforms require elaborate glue logic to tie the high performance code back to the core application code. This code is very bug prone and usually painful to write. The static analysis we do in the host Renderscript compiler is helpful in solving this issue. Each user script generates a Dalvik “glue” class. Names for the glue class and its accessors are derived from the contents of the script. This greatly simplifies the use of the scripts from Dalvik.

Example: The Application Level

Given these trade-offs, what does a simple compute application look like? In this very basic example we will take a normal android.graphics.Bitmap object and run a script that copies it to a second bitmap, converting it to monochrome along the way. Let’s look at the application code which invokes the script before we look at the script itself; this comes from the HelloCompute SDK sample:

    private Bitmap mBitmapIn;
   
private Bitmap mBitmapOut;
   
private RenderScript mRS;
   
private Allocation mInAllocation;
   
private Allocation mOutAllocation;
   
private ScriptC_mono mScript;

   
private void createScript() {
        mRS
= RenderScript.create(this);

        mInAllocation
= Allocation.createFromBitmap(mRS, mBitmapIn,
                                                   
Allocation.MipmapControl.MIPMAP_NONE,
                                                   
Allocation.USAGE_SCRIPT);
        mOutAllocation
= Allocation.createTyped(mRS, mInAllocation.getType());

        mScript
= new ScriptC_mono(mRS, getResources(), R.raw.mono);

        mScript
.set_gIn(mInAllocation);
        mScript
.set_gOut(mOutAllocation);
        mScript
.set_gScript(mScript);
        mScript
.invoke_filter();
        mOutAllocation
.copyTo(mBitmapOut);
   
}

This function assumes that the two bitmaps have already been created and are of the same size and format.

The first thing all Renderscript applications need is a context object. This is the core object used to create and manage all other Renderscript objects. This first line of the function creates the object, mRS. This object must be kept alive for the duration the application intends to use it or any objects created with it.

The next two function calls create compute allocations from the Bitmaps. Renderscript has its own memory allocator, because the memory may potentially be shared by multiple processors and possibly exist in more than one memory space. When an allocation is created its potential uses need to be enumerated so the system may choose the correct type of memory for its intended uses.

The first function createFromBitmap() creates a matching Renderscript allocation object and copies the contents of the bitmap into the allocation. Allocations are the basic units of memory used in renderscript. The second Allocation created with createTyped() generates an Allocation identical in structure to the first. The definition of that structure is retrieved from the first with the getType() query. Renderscript types define the structure of an Allocation. In this case the type was generated from the height, width, and format of the incoming bitmap.

The next line loads the script, which is named “mono.rs”. R.raw.mono identifies it; scripts are stored as raw resources in an application’s APK. Note the name of the auto-generated “glue” class, ScriptC_mono.

The next three lines set properties of the script, using generated methods in the “glue” class.

Now we have everything set up. The function invoke_filter() actually does some work for us. This causes the function filter() in the script to be called. If the function had parameters they could be passed here. Return values are not allowed as invocations are asynchronous.

The last line of the function copies the result of our compute script back to the managed bitmap; it has the necessary synchronization code built-in to ensure the script has completed running.

Example: The Script

Here’s the Renderscript stored in mono.rs which the application code above invokes:

#pragma version(1)
#pragma rs java_package_name(com.android.example.hellocompute)

rs_allocation gIn
;
rs_allocation gOut
;
rs_script gScript
;

const static float3 gMonoMult = {0.299f, 0.587f, 0.114f};

void root(const uchar4 *v_in, uchar4 *v_out, const void *usrData, uint32_t x, uint32_t y) {
    float4 f4
= rsUnpackColor8888(*v_in);

    float3 mono
= dot(f4.rgb, gMonoMult);
   
*v_out = rsPackColorTo8888(mono);
}

void filter() {
    rsForEach
(gScript, gIn, gOut, 0);
}

The first line is simply an indication to the compiler which revision of the native Renderscript API the script is written against. The second line controls the package association of the generated reflected code.

The three globals listed correspond to the globals which were set up in our managed code. The fourth global is not reflected because it is marked as static. Non-static, const, globals are also allowed but only generate a get reflected method. This can be useful for keeping constants in sync between scripts and managed code.

The function root() is special to renderscript. Conceptually it’s similar to main() in C. When a script is invoked by the runtime, this is the function that will be called. In this case the parameters are the incoming and outgoing pixels from our allocation. A generic user pointer is also provided along with the address within the allocation that this invocation is processing. This example ignores these parameters.

The three lines of the root function unpack the pixel from RGBA_8888 to a vector of four floats. The second line uses a built-in math function to compute the dot product of the monochrome constants with the incoming pixel data to get our grey level. Note that while dot returns a single float it can be assigned to a float3 which simply copies the value to each of the x, y, and z components of the float3. In the end we use another builtin to repack the floats back to a 32 bit pixel. This is also an example of an overloaded function as there are separate versions of rsPackColorTo8888 which take RGB (float3) or RGBA (float4) data. If A is not provided the overloaded functions assume a value of 1.0f.

The filter() function is called from managed code to do the conversion. It simply does a compute launch on each element of the allocation. The first parameter is the script to be launched - the root function of this script will be invoked for each element in the allocation. The second and third parameters are the input and output data allocations. The last parameter is the pointer for the user data if we desired to pass additional information to the root function.

The forEach will launch across multiple threads if the device has multiple processors. In the future forEach can provide a transition point where control may pass from one processor to another. In this example it is reasonable to expect that in the future filter() would get executed on the CPU and root() would occur on a GPU or DSP.

I hope this gives glimpse into the design behind Renderscript and a simple example of how it can be used.

저작자 표시 비영리 동일 조건 변경 허락

'Android > Android&Kernel' 카테고리의 다른 글

Renderscript Part2  (0) 2011/03/11
Introducing Renderscript  (0) 2011/03/11
Android Kernel Download & Building  (0) 2011/01/04
Using Repo and Git  (0) 2011/01/03
Android Emulator SDCard not Mount  (0) 2009/11/26
Android Source Build Error  (3) 2009/11/26
Posted by mirwing
Android/Android&Kernel2011/03/11 14:07

[Android Developer Blog]

Renderscript is a key new Honeycomb feature which we haven’t yet discussed in much detail. I will address this in two parts. This post will be a quick overview of Renderscript. A more detailed technical post with a simple example will be provided later.

Renderscript is a new API targeted at high-performance 3D rendering and compute operations. The goal of Renderscript is to bring a lower level, higher performance API to Android developers. The target audience is the set of developers looking to maximize the performance of their applications and are comfortable working closer to the metal to achieve this. It provides the developer three primary tools: A simple 3D rendering API on top of hardware acceleration, a developer friendly compute API similar to CUDA, and a familiar language in C99.

Renderscript has been used in the creation of the new visually-rich YouTube and Books apps. It is the API used in the live wallpapers shipping with the first Honeycomb tablets.

The performance gain comes from executing native code on the device. However, unlike the existing NDK, this solution is cross-platform. The development language for Renderscript is C99 with extensions, which is compiled to a device-agnostic intermediate format during the development process and placed into the application package. When the app is run, the scripts are compiled to machine code and optimized on the device. This eliminates the problem of needing to target a specific machine architecture during the development process.

Renderscript is not intended to replace the existing high-level rendering APIs or languages on the platform. The target use is for performance-critical code segments where the needs exceed the abilities of the existing APIs.

It may seem interesting that nothing above talked about running code on CPUs vs. GPUs. The reason is that this decision is made on the device at runtime. Simple scripts will be able to run on the GPU as compute workloads when capable hardware is available. More complex scripts will run on the CPU(s). The CPU also serves as a fallback to ensure that scripts are always able to run even if a suitable GPU or other accelerator is not present. This is intended to be transparent to the developer. In general, simpler scripts will be able to run in more places in the future. For now we simply leverage the CPU resources and distribute the work across as many CPUs as are present in the device.

The video above, captured through an Android tablet’s HDMI out, is an example of Renderscript compute at work. (There’s a high-def version on YouTube.) In the video we show a simple brute force physics simulation of around 900 particles. The compute script runs each frame and automatically takes advantage of both cores. Once the physics simulation is done, a second graphics script does the rendering. In the video we push one of the larger balls to show the interaction. Then we tilt the tablet and let gravity do a little work. This shows the power of the dual A9s in the new Honeycomb tablet.

Renderscript Graphics provides a new runtime for continuously rendering scenes. This runtime sits on top of HW acceleration and uses the developers’ scripts to provide custom functionality to the controlling Dalvik code. This controlling code will send commands to it at a coarse level such as “turn the page” or “move the list”. The commands the two sides speak are determined by the scripts the developer provides. In this way it’s fully customizable. Early examples of Renderscript graphics were the live wallpapers and 3d application launcher that shipped with Eclair.

With Honeycomb, we have migrated from GL ES 1.1 to 2.0 as the renderer for Renderscript. With this, we have added programmable shader support, 3D model loading, and much more efficient allocation management. The new compiler, based on LLVM, is several times more efficient than acc was during the Eclair-through-Gingerbread time frame. The most important change is that the Renderscript API and tools are now public.

The screenshot above was taken from one of our internal test apps. The application implements a simple scene-graph which demonstrates recursive script to script calling. The Androids are loaded from an A3D file created in Maya and translated from a Collada file. A3D is an on device file format for storing Renderscript objects.

Later we will follow up with more technical information and sample code.

저작자 표시 비영리 동일 조건 변경 허락

'Android > Android&Kernel' 카테고리의 다른 글

Renderscript Part2  (0) 2011/03/11
Introducing Renderscript  (0) 2011/03/11
Android Kernel Download & Building  (0) 2011/01/04
Using Repo and Git  (0) 2011/01/03
Android Emulator SDCard not Mount  (0) 2009/11/26
Android Source Build Error  (3) 2009/11/26
Posted by mirwing
TAG Android
Android/Android&Kernel2011/01/04 13:58
Android Kernel Download

:/work$ git clone git://android.git.kernel.org/kernel/common.git kernel

더보기

:/work$ cd kernel
:/work/kernel$ git branch -r
  origin/HEAD -> origin/android-2.6.36
  origin/android-2.6.35
  origin/android-2.6.36
  ....
  origin/archive/android-goldfish-2.6.29
:/work/kernel$ git checkout --track -b android-goldfish-2.6.29 origin/archive/android-goldfish-2.6.29
:/work/kernel$ git branch
  * android-goldfish-2.6.29

위의 맨처음 clone를 함으로써 현재main branch인 커널을 받아오게 됩니다.

아래 의 checkout은 자신이 원하는 branch를 받아 오도록 하는 명령어 입니다.

:/work$ git clone git://android.git.kernel.org/kernel/msm.git kernel
:/work$ cd kernel
:/work/kernel$ git checkout --track -b android-msm-2.6.29-donut origin/android-msm-2.6.29-donut

Building and Compiling the Android

:/work/kernel$ make msm_defconfig ARCH=arm
:/work/kernel$ make ARCH=arm CROSS_COMPILE=/work/gingerbread/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-

:/work/kernel$ make goldfish_defconfig ARCH=arm
:/work/kernel$ make ARCM=arm CROSS_COMPILE=/work/gingerbread/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
  ...
  Kernel: arch/arm/boot/zImage is ready
저작자 표시 비영리 동일 조건 변경 허락

'Android > Android&Kernel' 카테고리의 다른 글

Renderscript Part2  (0) 2011/03/11
Introducing Renderscript  (0) 2011/03/11
Android Kernel Download & Building  (0) 2011/01/04
Using Repo and Git  (0) 2011/01/03
Android Emulator SDCard not Mount  (0) 2009/11/26
Android Source Build Error  (3) 2009/11/26
Posted by mirwing
Android/Android&Kernel2011/01/03 15:06
[[ Android Developer ]]

Using Repo and Git

To work with the Android code, you will need to use both Git and Repo.

  • Git is an open-source version-control system designed to handle very large projects that are distributed over multiple repositories. In the context of Android, we use Git for local operations such as local branching, commits, diffs, and edits.

  • Repo is a tool that we built on top of Git. Repo helps us manage the many Git repositories, does the uploads to our revision control system , and automates parts of the Android development workflow. Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android. The repocommand is an executable Python script that you can put anywhere in your path.

    In working with the Android source files, you will use Repo for across-network operations. For example, with a single Repo command you can download files from multiple repositories into your local working directory.

About Git

Why Git?

One of the challenges in setting up the Android project was figuring out how to best support the outside community--from the hobbiest community to large OEMs building mass-market consumer devices. We wanted components to be replaceable, and we wanted interesting components to be able to grow a life of their own outside of Android. We first chose a distributed revision control system, then further narrowed it down to Git.

Already a Git user?

In most situations, you can use Git instead of Repo, or mix Repo and Git commands to form complex commands. Using Repo for basic across-network operations will make your work much simpler, however. 

Task reference 

The task list below shows a summary of how to do common Repo and Git tasks. For complete quick-start information and examples, see Get source .

Installing Repo 

$ curl http://android.git.kernel.org/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir working-directory-name 
$ cd working-directory-name 
$ repo init-u git://android.git.kernel.org/platform/manifest.git 

Synchronizing your client

To synchronize the files for all available projects:
$ repo sync 

To synchronize the files for selected projects:
$ repo sync project1 project2 ... 

Why use topic branches?

Start a topic branch in your local work environment whenever you begin a change, for example when you begin work on a bug or new feature.

A topic branch is not a copy of the original files; it is a pointer to a particular commit. This makes creating local branches and switching among them a light-weight operation. By using branches, you canisolateone aspect of your work from the others. For an interesting article about using topic branches, see Separating topic branches .


Creating topic branches

To start a topic branch using Repo:
$ repo start branchname 

To verify that your new branch was created:
$ repo status 

Using topic branches

To assign the branch to a particular project:
$ repo start branch name project 

To switch back and forth among branches that you have created in your local work environment:
$ git checkout branchname 

To see a list of existing branches:
$ git branch 
or...
$ repo branches 

The name of the current branch will be preceded by an asterisk.

Note: 
A bug might be causing repo sync to reset the local topic branch. If git branch shows * (no branch) after you run repo sync, then run git checkoutagain.

Viewing client status

To list the state of your files:
$ repo status 

To see uncommitted edits:
$ repo diff 

Therepo diffcommand shows every local edit that you have made that would not go into the commit, if you were to commit right now.

To see every edit that would go into the commit if you were to commit right now, you need a Git command, git diff. Before running it, be sure you are down in the project directory:
$ cd ~/workingdirectory /project 
$ git diff --cached 

Recovering sync conflicts

If a repo sync shows sync conflicts:
  1. View the files that are unmerged (status code = U).
  2. Edit the conflict regions as necessary.
  3. Change into the relevant project directory, run git add and git commit for the files in question, and then "rebase" the changes. For example:
    $ cd bionic 
    $ git add bionic/*
    $ git commit 
    $ git rebase --continue 

  4. When the rebase is complete start the entire sync again:
    $ repo syncbionic proj2 proj3 ... projN 

Cleaning up your client files 

To update your local working directory after changes are merged in Gerrit:
$repo sync 

To safely remove stale topic branches:
$ repo prune 

Deleting a client

Deleting a client will permanently delete any changes you have not yet uploaded for review.Becauseall state information is stored in your client, you only need to delete the directory from your filesystem:

$ cd ~ 
$ rm -rf working-directory-name 

Scripting common tasks

You can use Repo to run the same program across all projects:

$ repo forall[proj1 proj2 ... projN ]-c 'echo $REPO_PROJECT $@ '[arg1 arg2 ... argN ]

The -c argument is evaluated through /bin/sh and any arguments after it are passed through as shell positional parameters.

Repo command reference

Repo usage takes the following form:
repo command options 

Optional elements are shown in brackets[ ]. Once Repo is installed, you can get information about any command by running 
repo help command 

init

repo init -u url [options ]

Installs Repo in the current directory. This creates a .repo/ directory that contains Git repositories for the Repo source code and the standard Android manifest files. The .repo/ directory also containsmanifest.xml, which is a symlink to the selected manifest in the .repo/manifests/ directory.

The -u argument specifies a URL from which to retrieve a manifest repository. For example:
$ repo init -u git://android.git.kernel.org/platform/manifest.git 

To select a manifest file within the repository, use the -m option. (If no manifest name is selected, the default is default.xml.)For example:
$ repo init -ugit://android.git.kernel.org/platform/manifest.git-m dalkvik-plus.xml 

To specify a revision, that is, a particular manifest-branch, use the -b option. For example:
$ repo init -ugit://android.git.kernel.org/platform/manifest.git-b release-1.0

To see other repo init options, run 
$ repo help init 

Note: For all remaining Repo commands, the current working directory must either be the parent directory of .repo/ or a subdirectory of the parent directory.

sync

repo sync [project-list ]

Downloads new changes and updates the working files in your local environment. After a successful repo sync, the code in specified projects will be up to date with the code in the remote repository.

You can specify project-list as a list of names or a list of paths to local source directories for the projects:
repo sync [proj1 proj2 ... projN ]

If you run repo sync without any arguments, it will synchronize the files for all the projects.

How Repo synchronization works 

When you run repo sync, this is what happens:
  1. If the project has never been synchronized, then repo sync is equivalent to git clone. All branches in the remote repository are copied to the local project directory.
  2. If the project has already been synchronized once, then repo sync is equivalent to:
    git remote update 
    git rebase origin/branch 
    where branch is the currently checked-out branch in the local project directory. If the local branch is not tracking a branch in the remote repository, then no synchronization will occur for the project.

    If the git rebase operation results in merge conflicts, you will need to use the normal Git commands (for example, git rebase --continue) to resolve the conflicts.
The repo sync command also updates the private repositories in the .repo/ directory.

upload

repo upload [project-list ]

For the specified projects, Repo compares the local branches to the remote branches updated during the last repo sync. Repo will prompt you to select one or more of the branches that have not yet been uploaded for review.

After you select one or more branches, all commits on the selected branches are transmitted to Gerrit over an SSH connection.You will need to configure an SSH key to enable upload authorization.Visit SSH Keys within the user settings panel to register your public keys with Gerrit.To enable password-less uploads, consider using ssh-agent on your client system.

When Gerrit receives the object data over its SSH server, it will turn each commit into a change so that reviewers can comment on each commit individually.

To combine several "checkpoint" commits together into a single commit, use git rebase -i before you run repo upload.

You can specify project-list as a list of names or a list of paths to local source directories for the projects:
repo upload [proj1 proj2 ... projN ]

If you run repo upload without any arguments, it will search all the projects for changes to upload.

To make edits to changes after they have been uploaded, you should use a tool likegit rebase -ior git commit --amend to update your local commits.

After your edits are complete:
  1. Make sure the updated branch is the currently checked out branch.
  2. Use repo upload --replace proj1 to open the change matching editor.
  3. For each commit in the series, enter the Gerrit change Id inside the brackets:
# Replacing from branch foo 
[ 3021 ] 35f2596c Refactor part of GetUploadableBranches to lookup one specific...
[ 2829 ] ec18b4ba Update proto client to support patch set replacments 
[ 3022 ] c99883fe Teach 'repo upload --replace' how to add replacement patch se...
# Insert change numbers in the brackets to add a new patch set.
# To create a new change record, leave the brackets empty.

After the upload is complete the changes will have an additional Patch Set (e.g. Patch Set 2, Patch Set 3, ...).

diff

repo diff [project-list ]

Shows changes between commit and working tree.

You can specify project-list as a list of names or a list of paths to local source directories for the projects:
repo diff [proj1 proj2 ... projN ]

Options:
-h, --helpmeans show this help message and exit.

download 

repo download target change 

Downloads the specified change into the specified local directory. (Added to Repo as of version 1.0.4.)

For example, to download change 1241 into your platform/frameworks/base directory:
$ repo download platform/frameworks/base 1241

A"repo sync"should effectively remove any commits retrieved via "repo download".Or, you can check out the remote branch; e.g., "git checkout m/master".

Note: As of Jan. 26, 2009, there is a mirroring lag of approximately 5 minutes between when a change is visible on the web in Gerrit and when repo download will be able to find it, because changes are actually downloaded off the git://android.git.kernel.org/ mirror farm. There will always be a slight mirroring lag as Gerrit pushes newly uploaded changes out to the mirror farm.

forall

repo forall [project-list ] -c command [arg. ..]

Runs a shell command in each project.

You can specify project-list as a list of names or a list of paths to local source directories for the projects 

help

repo help [command ]

Displays detailed help about a command.

prune 

repo prune [project-list ]

Prunes (deletes) topics that are already merged.

You can specify project-list as a list of names or a list of paths to local source directories for the projects:
repo prune [proj1 proj2 ... projN ]

start

repo start newbranchname [project-list ]

Starts a new branch for development.

The newbranchname argument should provide a short description of the change you are trying to make to the projects.If you don't know, consider using the name default.

The project-list specifies which projects will participate in this topic branch. You can specify project-list as a list of names or a list of paths to local working directories for the projects:
repo start default [proj1 proj2 ... projN ]

"." is a useful shorthand for the project in the current working directory.

status

repo status [project-list ]

Shows the status of the current working directory. You can specify project-list as a list of names or a list of paths to local source directories for the projects:
repo status [proj1 proj2 ... projN ]

To see the status for only the current branch, run 
repo status .

The status information will be listed by project. For each file in the project, a two-letter code is used:
  • In the left-most column, an uppercase letter indicates what is happening in the index (the staged files) when compared to the last committed state.

  • In the next column, a lowercase letter indicates what is happening in the working directory when compared to the index (what is staged).
Character Meaning
A The file is added (brand new). Can only appear in the first column.
M or m 
The file already exists but has been modified in some way.
D or d 
The file has been deleted.
R The file has been renamed. Can only appear in the first column. The new name is also shown on the line.
C The file has been copied from another file. Can only appear in the first column. The source is also shown.
T Only the file's mode (executable or not) has been changed. Can only appear in the first column.
U The file has merge conflicts and is still unmerged. Can only appear in the first column.
- The file state is unmodified. A hyphen in both columns means this is a new file, unknown to Git. After you run git add on this file, repo status will show A-, indicating the file has been added.

For example, if you edit the file main.py within the appeng project without staging the changes, then repo status might show 

project appeng/
-mmain.py 

If you go on to stage the changes to main.py by running git add, then repo status might show 

project appeng/
M- main.py 

If you then make further edits to the already-staged main.py and make edits to another file within the project, app.yaml, then repo status might show 

project appeng/
-mapp.yaml 
Mm main.py 

Git and Repo cheatsheet

Click on the cheatsheet to open it in a new window for easier printing.


Terminology

Staged changes 
Changes marked by git add for inclusion in the next commit's snapshot.

Commit 
At intervals, you use git commit to save a snapshot of the staged files and a log message that describes the change.

Manifest 
A manifest file that contains a list of repositories and a mapping of where the files from these repositories will be located within your working directory. When you synchronize your files, the files contained in the repositories that are listed in the manifest will be pulled into your working directory.
저작자 표시 비영리 동일 조건 변경 허락

'Android > Android&Kernel' 카테고리의 다른 글

Introducing Renderscript  (0) 2011/03/11
Android Kernel Download & Building  (0) 2011/01/04
Using Repo and Git  (0) 2011/01/03
Android Emulator SDCard not Mount  (0) 2009/11/26
Android Source Build Error  (3) 2009/11/26
Android 2.0 Eclair Source Merge Completion  (0) 2009/11/15
Posted by mirwing
Android/Android&Kernel2009/11/26 16:29
SDK의 기본 system 이미지를 사용하게 될 때는 sdcard가 mount 되어서 나오지만

Source를 컴파일 한 후에 system 이미지를 교체하여 emulator를 실행하게 되면

sdcard가 mount 되지 않게 됩니다.


이 상태에서 sdcard에 push를 하게 되면 당연히 mount가 되어 있지 않기 때문에 들어가지 않습니다.

shell에서 직접 mount를 하게 되면 sdcard가 사용이 가능하지만

emulator를 다시 실행하게 되면 다시 mount를 해야 합니다.


sdcard가 mount가 되지 않는 이유는 android source에서 emulator용 vold.conf는 기본적으로

복사가 되지 않습니다.


Eclair Source 기준 :256

$ vi build/core/main.mk
# Install an apns-conf.xml file if one's not already being installed.
ifeq (,$(filter %:system/etc/apns-conf.xml, $(PRODUCT_COPY_FILES)))
  PRODUCT_COPY_FILES += \
        development/data/etc/apns-conf_sdk.xml:system/etc/apns-conf.xml
  ifeq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),)
    $(warning implicitly installing apns-conf_sdk.xml)
  endif
endif
+ # Install a vold.conf file is one's not already being installed.
+ ifeq (,$(filter %:system/etc/vold.conf, $(PRODUCT_COPY_FILES)))
+   PRODUCT_COPY_FILES += \
+         development/data/etc/vold.conf:system/etc/vold.conf
+   ifeq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),)
+     $(warning implicitly installing vold.conf)
+   endif
+ endif

'Android > Android&Kernel' 카테고리의 다른 글

Android Kernel Download & Building  (0) 2011/01/04
Using Repo and Git  (0) 2011/01/03
Android Emulator SDCard not Mount  (0) 2009/11/26
Android Source Build Error  (3) 2009/11/26
Android 2.0 Eclair Source Merge Completion  (0) 2009/11/15
Android Glossary  (0) 2009/11/10
Posted by mirwing
Android/Android&Kernel2009/11/26 01:03

error: cast from 'void*' to 'int' loses precision

Mac OS X 10.6
Android Eclair

system/core/libacc/acc.cpp: In member function ‘bool acc::Compiler::acceptStringLiteral()’:
system/core/libacc/acc.cpp:4557: error: cast from ‘char*’ to ‘int’ loses precision
system/core/libacc/acc.cpp: In member function ‘void acc::Compiler::unary()’:
system/core/libacc/acc.cpp:4637: error: cast from ‘char*’ to ‘int’ loses precision
system/core/libacc/acc.cpp:4643: error: cast from ‘char*’ to ‘int’ loses precision
system/core/libacc/acc.cpp:4731: error: cast from ‘void*’ to ‘int’ loses precision
system/core/libacc/acc.cpp: In member function ‘void acc::Compiler::globalDeclarations()’:
system/core/libacc/acc.cpp:5740: error: cast from ‘void*’ to ‘int’ loses precision

-> system/core/libacc/acc.cpp :4557, :4637, :4643, :4731, :5740
-(int)
+(size_t)

error: invalid conversion from 'const char*' to 'char*'

Ubuntu 9.10 x64
Android Donut

development/emulator/qtools/trace_reader.cpp: In function 'char* ExtractDexPathFromMmap(const char*)':
development/emulator/qtools/trace_reader.cpp:1012: error: invalid conversion from 'const char*' to 'char*'
development/emulator/qtools/trace_reader.cpp:1015: error: invalid conversion from 'const char*' to 'char*'

-> development/emulator/qtools/trace_reader.cpp :1012, :1015
+ const char *end = rindex(mmap_path, '@');
+ const char *start = rindex(mmap_path, '/');

development/emulator/qtools/dmtrace.cpp: In member function 'void DmTrace::parseAndAddFunction(int, const char*)':
development/emulator/qtools/dmtrace.cpp:166: error: invalid conversion from 'const char*'to 'char*'
development/emulator/qtools/dmtrace.cpp:183: error: invalid conversion from 'const char*' to 'char*'

-> development/emulator/qtools/dmtrace.cpp :166, :183
+ char *paren = (char*)strchr(name, '(');
+ char *dot = (char*)strchr(name, '.');

EAI_NODATA undeclared


Ubuntu 8.10
Android cupcake

xternal/qemu/sockets.c: In function 'sock_address_init_resolve':
external/qemu/sockets.c:637: error: 'EAI_NODATA' undeclared (first use in this function)
external/qemu/sockets.c:637: error: (Each undeclared identifier is reported only once
external/qemu/sockets.c:637: error: for each function it appears in.)

-> external/qemu/sockets.c :637
+#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME
     case EAI_NODATA:
+#endif

'Android > Android&Kernel' 카테고리의 다른 글

Using Repo and Git  (0) 2011/01/03
Android Emulator SDCard not Mount  (0) 2009/11/26
Android Source Build Error  (3) 2009/11/26
Android 2.0 Eclair Source Merge Completion  (0) 2009/11/15
Android Glossary  (0) 2009/11/10
4th Korea Android Conference - Android Binder -  (0) 2009/10/24
Posted by mirwing
Android/Android&Kernel2009/11/15 06:42
[ 출처 : Kandroid ]

현지시간 11월 13일 새벽 2시 기준으로 "Jean-Baptiste Queru" 에 의해 eclair를 위한 아래의 127개 패키지들이  모두 머징되었습니다.

어디선가 주워 들은 바로는 Google에서 2.0작업이 끝나면 그동안 미루던 문서작업을 진행시킬거라고 하더군요....

Java Docs 처럼은 아니더라도 많은 정보를 가지고 있는 Android Docs이 되었으면 합니다....


++ 2.0 에서 변화된 내용
  libcorecg 와 ligsgl이 하나로 libskia
  새로운 서비스 3개 추가

>From http://android.git.kernel.org/?p=platform/manifest.git
  30ad844..ddf895e  eclair     -> origin/eclair
>From http://android.git.kernel.org/?p=platform/bionic.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/bootable/bootloader/legacy.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/bootable/diskinstaller.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/bootable/recovery.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/build.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/dalvik.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/development.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/aes.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/apache-http.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/astl.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/bison.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/blktrace.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/bsdiff.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/bzip2.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/clearsilver.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/dbus.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/dhcpcd.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/dropbear.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/e2fsprogs.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/elfcopy.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/elfutils.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/embunit.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/emma.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/esd.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/expat.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/fdlibm.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/freetype.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/fsck_msdos.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/gdata.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/genext2fs.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/giflib.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/googleclient.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/grub.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/gtest.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/icu4c.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/ipsec-tools.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/iptables.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/jdiff.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/jhead.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/jpeg.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/junit.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/kernel-headers.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/lcc.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/libffi.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/libpcap.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/libpng.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/libxml2.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/mtpd.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/netcat.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/netperf.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/neven.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/opencore.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/openssl.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/oprofile.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/ping.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/ppp.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/protobuf.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/qemu.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/safe-iop.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/skia.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/sonivox.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/speex.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/sqlite.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/srec.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/strace.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/svox.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/tagsoup.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/tcpdump.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/tinyxml.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/tremor.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/webkit.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/wpa_supplicant.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/xdelta3.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/yaffs2.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/external/zlib.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/frameworks/base.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/frameworks/opt/com.google.android.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/frameworks/opt/com.google.android.googlelogin.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/frameworks/opt/emoji.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/frameworks/policies/base.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/hardware/libhardware.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/hardware/libhardware_legacy.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/hardware/msm7k.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/hardware/ril.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/AlarmClock.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Browser.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Calculator.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Calendar.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Camera.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Email.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/GlobalSearch.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/GoogleSearch.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/HTMLViewer.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/IM.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Mms.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Music.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/PackageInstaller.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Phone.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Settings.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Stk.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Sync.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/Updater.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/apps/VoiceDialer.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/inputmethods/LatinIME.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/inputmethods/OpenWnn.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/inputmethods/PinyinIME.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/ApplicationsProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/CalendarProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/ContactsProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/DownloadProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/DrmProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/GoogleContactsProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/GoogleSubscribedFeedsProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/MediaProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/TelephonyProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/UserDictionaryProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/packages/providers/WebSearchProvider.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/prebuilt.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/system/bluetooth.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/system/core.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/system/extras.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/system/wlan/ti.git
 * [new branch]      eclair     -> korg/eclair
>From http://android.git.kernel.org/?p=platform/vendor/sample.git
 * [new branch]      eclair     -> korg/eclair

'Android > Android&Kernel' 카테고리의 다른 글

Android Emulator SDCard not Mount  (0) 2009/11/26
Android Source Build Error  (3) 2009/11/26
Android 2.0 Eclair Source Merge Completion  (0) 2009/11/15
Android Glossary  (0) 2009/11/10
4th Korea Android Conference - Android Binder -  (0) 2009/10/24
Building on Mac OSX 10.6 Snow Leopard  (0) 2009/10/08
Posted by mirwing
Android/Android&Kernel2009/11/10 11:15
[ Developer Android ]
[ 안드로이드 입문서(www.kandroid.org/kandroid 번역/ 978-89-962353-0-9) ]

.apk file
안드로이드 애플리케이션 패키지 파일.
각각의 안드로이드 애플리케이션은 컴파일 되어 하나의 파일로 패키징 된다. 애플리케이션이 코드(.dex file), resources, assets, 그리고 manifest 파일을 모두 포함하고 있다. 패키지 파일은 어떠한 이름도 가질 수 있지만 .apk 확장자를 사용해야만 한다.

관련 : Application

.dex file
컴파일된 안드로이드 애플리케이션 코드 파일.
Dalvik Executable 파일, 디바이스 상의 하나의 .apk 파일내에 zip으로 압축된다. .dex파일들은 자바 프로그래밍 언어로 작성된 컴파일된 애플리케이션을 자동적으로 변환함으로써 생성된다.

Action
Intent sender가 수행하길 원하는 어떤 것에 대한 설명.
Action은 intent에 할당된 문자열 값이다. 액션 문자열들은 안드로이드 또는 제3의 개발자에 의해 정의될 수 있다.
ex - android.intent.action.VIEW -> 웹 URL
ex - com.example.rumbler.SHAKE_PHONE -> 폰을 진동시키는 커스텀 애플리케이션

관련 : Intent

Activity
애플리케이션 내의 하나의 화면, Java code를 지원함으로써 Activity 클래스로부터 파생.
가장 일반적으로, 액티비티는 그것이 윈도우를 렌더하기 위해 사용하는 윈도우이기 때문에, UI 이벤트를 받아서 처리할 수 있고 복잡한 태스크를 수행하는 전체 스크린 윈도우에 의해 시각적으로 표현된다. 액티비티가 일반적으로는 전체 스크린임에도 불구하고, 화면 위에 떠 있거나 투명하게 될 수도 있다.

adb
Android Debug Bridge, SDK와 함께 포함된 커맨드 라인 디버깅 애플리케이션.
디바이스를 브라우징, 디바이스에 복사하기 위한 도구, 디버깅을 위해 포워드 포트를 제공한다. ADT 플러그인을 사용하는 이클립스에서 개발하고 있다면, adb는 개발 환경안에 통합되어 있다.

Appliction
컴포넌트의 관점으로 보면, 안드로이드 애플리케이션은 하나 또는 그 이상의 액티비티, 서비스, 컨텐트 프로바이더, 브로드캐스트 리시버로 구성된다.
소스파일의 관점으로 보면, 안드로이드 애플리케이션은 코드, 리소스, 에셋, 하나의 매니페스트로 구성된다. 컴파일 도중에, 이러한 파일들은 애플리케이션 패키지 파일(.apk)로 불리는 하나의 파일로 패키지 된다.

관련 : .apk, Activity

Canvas
Bitmap이나 Surface 오브젝트에 대한 실질적인 비트 컴포지션을 처리하는 그리기를 하는 표면.
비트맵, 선, 원, 사각형, 텍스트, 그리고 기타 등등에 대한 표준 컴퓨터 그리기에 대한 메쏘드를 가지고 있다. 캔버스는 스크린에 2D 오베즉트들을 그리기 위한 가장 간단하고 가장 손쉬운 방법이다. 하지만 이것은 OpenGL|ES에서 하는 것 처럼 하드웨어 가속기를 지원하지 않는다. 베이스 클래스는 Canvas이다.

관련 : Drawable, OpenGL|ES

Content Provider
애플리케이션의 데이터를 다른 애플리케이션에게 안전하게 보여주기 위해 사용할 수 있는 데이터 추상화 계층.
Content Provider는 ContentProvider 클래스 위에서 만들어졌다. 이것은 특정 포맷의 데이터를 리턴하기 위한 특정 포맷의 컨텐트 쿼리 포맷을 처리한다.

관련 : URI Usage in Android

Dalvik
안드로이드 플랫폼의 가장 머신.
달빅 가상머신은 효율적인 저장공간과 메모리 매핑가능한 실행을 위해 최적화 된 .dex 포맷의 파일들을 실행하는 인터프리터 전용 가상 머신이다. 이 가상 머신은 레지스터 기반이고, Java 언어 컴파일에 의해 컴파일된 클래스를 실행할 수 있다. 그 클래스는 포함되어 있는 "dx" 도구를 사용해서 달빅 네이티브 포맷으로 변환된다. 그 가상 머신은 Posix 호환 운영 체제의 위에서 실행된다. 그것은 (쓰레딩과 저수준 메모리 관리와 같은) 그 아래에 있는 기능을 위해서 해당 운영체제에 의존한다. 달빅 코어 클래스 라이브러리는 Java Standard Edition으로 프로그래밍하기 위해 사용된 것들과 비슷한 개발 기반을 제공하고자 의도된 것이지만, 모바일 디바이스의 필요에 맞게 조정되었다.

DDMS
달빅 디버그 모니터 서비스로, SDK와 함께 포함된 GUI 디버깅 애플리케이션.
스크린 캡쳐, 로그 덤프, 프로세스 검사 기능을 제공한다. ADT 플러그인을 사용하는 이클립스에서 개발하고 있다면, DDMS는 개발 환경에 통합되어 있다.

Dialog
가벼운 폼처럼 동작하는 떠 있는 윈도우.
다이얼로그는 오직 버튼 컨트롤들만을 가질 수 있으며, 버튼 선택과 같은 간단한 액션을 수행하고 아마도 하나의 값을 리턴하도록 되어 있다. 다이얼로그는 히스토리 스택에 존속하거나, 복잡한 레이아웃을 가지거나, 또는 복잡한 액션을 수행하도록 되어 있지 않다. 안드로이드는 옵션 버튼을 가지는 간단한 디폴트 다이얼로그를 제공한다. 여러분은 자신의 다이얼로그 레이아웃을 정의할 수 있다. 다이얼로그에 대한 베이스 클래스는 Dialog이다.

관련 :  Activity

Drawable
배경, 타이틀, 스크린의 다른 영역으로 사용될 수 있는 컴파일 된 시각적 리소스.
Drawable은 백그라운드 이미지 같은 다른 UI엘리먼트 안에 일반적을 로드된다. 드로어블은 이벤트를 받을 수 없지만, 애니메이션 오브젝트나 이미지 라이브러리와 같은 서브 클래스를 활성화 하기 위해 "state"와 스케쥴링과 같은 다양한 다른 속성들이 부여한다. 많은 드로어블 오브젝트들은 드로어블 리소스 파일들, xml 또는 이미지를 그리는 비트맵 파일들로부터 적재된다. 드로어블 리소스들은 Android.graphics.drawable의 서브클래스로 컴파일된다.

관련 : Resources, Canvas

Intent
다른 애플리케이션/액티비티를 런치하거나 비동기적으로 커뮤니케이션하는데 사용할 수 있는 메시지 오브젝트.
인텐트 오브젝트는 인텐트에 대한 하나의 인스턴스이다. 그것은 어떤 애플리케이션/액티비티가 인텐트를 수신할지와 그 인텐트를 처리할 때 그 리시버가 무엇을 하는지를 결정하기 위해, 여러분이 제공할 수 있는 다양한 기준 필드들을 포함한다. 유용한 기준들은 요구되는 액션, 카테고리, 데이터 문자열, 데이터의 MIME 타입, 처리할 클래스, 그리고 그 밖의 것들을 포함한다. 하나의 애플리케이션은 다른 애플리케이션/액티비티에게 직접 인텐트를 전송한다기보다는 안드로이드 시스템에 인텐트를 보낸다. 애플리케이션은 하나의 타겟 애플리케이션에 인텐트를 보낼 수 있다. 또한 그것은 여러 개의 애플리케이션에 의해 순서대로 차례로 처리될 수 있는 브로드캐스트로 그것을 전송할 수도 있다. 안드로이드에 시스템은 인텐트에 제공된 기준들과 다른 애플리케이션에 의해 정의된 인텐트 필터에 기반해서, 각각의 인텐트에 대한 가장 유용한 리시버를 확정하는 것에 대해 책임을 진다.

관련 : Intent Filter, Broadcast Receiver

Intent Filter
애플리케이션이 매니페스트 파일에 선언하는 필터 오브젝트로, 시스템에게 그것의 컴포넌트 각각이 받아들이고자 하는 인텐트의 타입, 어떤 기준을 가지고 있는지를 알려준다. 인텐트 필터를 통해, 애플리케이션은 특정한 데이터 타입, 인텐트 액션, URI 포맷 등에 관심을 표현할 수 있다. 인텐트를 확장할 때, 시스템은 모든 애플리케이션 내의 유용한 인텐트 필터 모두를 평가하고, 그 인텐트와 기준들이 가장 일치하는 애플리케이션/액티비티에 인텐트를 전달한다.

관련 : Intent, Broadcast Receiver

Broadcast Receiver
하나의 타겟 애플리케이션/액티비티에게 전송되는 것보다는 브로드캐스트된 인텐트를 수신하는 애플리케이션 클래스.
시스템은 모든 관심갖는 브로드캐스트 리시버에게 브로드캐스트 인텐트를 전달한다. 그것들은 순차적으로 인텐트를 처리한다.

관련 : Intent, Intent Filter

Layout Resource
액티비티 스크린의 레이아웃을 설명하는 XML 파일.

관련 : Resources

Manifest File
각각의 애플리케이션이 애플리케이션의 패키지 이름, 버전, 컴포넌트(액티비티, 프로바이더, 리시버, 서비스)., 임포트 라이브러리, 그리고 다양한 액티비티를 설명하고, 기타 등등을 설명하기 위해 정의해야 하는 XML 파일.

Nine-patch / 9-patch / Ninepatch Image
디바이스 상의 배경이나 다른 이미지를 위해 사용될 수 있는 크기 조정이 가능한 비트맵 리소스.

관련 : Resources

OpenGL|ES
빠르고 복잡한 3D 이미지를 위해 여러분이 사용할 수 있는 OpenGL|ES 라이브러리를 제공한다. 이것은 캔버스 오브젝트보다 사용하기는 어렵지만 3D 오브젝트를 위해서는 더 좋다. Android.opengl과 javax.microedition.khronos.opengles 패키지는 OpenGL|ES 기능을 보여준다.

관련 : Canvas, Surface

Resources
컴파일된 애플리케이션 코드 외부에 있는 프로그램적이지 않은 애플리케이션 컴포넌트. 그러나 잘 알려진 참조 포맷을 사용하여 애플리케이션 코드로 부터 적재될 수 있다. 안드로이드는 다양한 리소스 타입을 지원하지만 일반적인 애플리케이션 리소스는 UI 문자열, UI 레이아웃 컴포넌트, 그래픽, 미디어 파일, 기타 등등으로 구성된다. 애플리케이션은 효율적으로 localization과 다양한 디바이스 프로파일과 상태를 지원하기 위해 리소스를 사용한다. 예를 들어 애플리케이션은 지원되는 각각의 로컬 또는 디바이스 타입에 대해 별도의 리소스 집합을 포함할 것이고, 그것은 현재의 스크린 방위(landscape or portrait)에 대한 특정 레이아웃 리소스를 포함할 수 있다. 애플리케이션의 리소스는 항상 프로젝트의 res/* 하위 폴더에 저장되어 있다.

Service
음악 재생 또는 네트워크 액티비티 모니터링과 같은 다양한 지속적인 액션들을 수행하기 위해 (UI를 표시하지 않고) 백그라운드에서 실행되는 클래스 서비스의 오브젝트

관련 : Activity

Surface
스크린으로 composited 되는 메모리 블록을 나타내는 surface 타입의 오브젝트.
서피스는 그리기 위한 하나의 캔버스 오브젝트를 보유하며, 레이어를 그리고 그 서피스의 크기를 바꾸기 위한 다양한 헬퍼 메쏘드를 제공한다. 이 클래스를 직접 사용하지 말아야 하며, 대신 서피스뷰를 사용하라.

관련 : Canvas

SurfaceView
그리기 위한 Surface를 감싸고 있는 뷰 오브젝트ㅡ 동적으로 크기와 포맷을 지정하기 위한 메쏘드들을 제시한다.
서피스뷰는 리소스 집약적 오퍼레이션을 위해 UI thread와는 독립적으로 그리는 방법을 제공한다. 그러나 그것은 결과적으로 추가적인 메모리를 사용한다. 서피스뷰는 캔버스와 OpenGL|ES 그래픽 모두를 지원한다. 베이스 클래스는 서비스뷰이다.

관련 : Surface

Theme
다양한 디폴트 디스플레이 설정을 정의하기 위해 함께 묶어진 속성들(텍스트 크기, 백그라운드컬러, 그리고 기타 등등)의 집합.
안드로이드는 ("Theme_"으로 시작하는) R.style에 리스트된 몇 가지 표준 테마를 제공한다.

URIs in Android
안드로이드는 컨텐트 프로바이더에 데이터를 요청하는 것과 인텐트에 액션을 요청하는 것에 대한 기초로 URI 문자열을 사용한다. 그 URI 스키마과 포맷은 사용 유형에 따라 달라지며, 애플리케이션은 원하는 어떠한 방식으로도 특정 URI 스키마와 문자열을 처리할 수 있다. 어떤 URI 스키마는 시스템 컴포넌트에 의해 예약되어 있다. 예를 들어 컨텐트 프로바이더로부터의 데이터에 대한 요청은 content://를 사용해야 한다. 인텐트에서 http:// 스키마를 사용하는 URI는 브라우저에 의해 처리될 것이다.

View
스크린에서 직사각형의 영역을 그리는 오브젝트이며, 클릭, 키스트로크, 그리고 다른 상호작용 이벤트를 처리한다. 뷰는 액티비티나 다이얼로그 스크린의 레이아웃 컴포넌트 대부분에 대한 베이스 클래스이다. 뷰는 스스로를 그리기 위해 그것의 부모 오브젝트로부터 호출을 받는다. 그리고 (부모 오브젝트에 의해 반영될 수도 있고 그렇지 않을 수도 있지만) 그것이 어디에 있어야 하고 얼마나 커야 하는지에 대해 그것의 부모 오브젝트에게 알려준다.

관련 : Viewgroup, Widget

Viewgroup
child view들의 집합을 그룹화하는 컨테이너 오브젝트.
viewgroup은 자식 뷰들이 적절할 때 스스로를 그리도록 하기 위해 각각을 호출하는 것뿐만 아니라, 자식뷰들이 어디에 위치하고 얼마나 커야하는가를 결정하는 것에 대해 책임을 진다. 어떤 뷰그룹은 다른 것들이 고유의 UI(예를 들면 스크롤되는 리스트 상자)를 가지는 것에 반해, 보여지지 않고 단지 레이아웃을 위해서만 존재하게 된다. 뷰그룹은 widget 패키지 안에 모두 있지만, Viewgroup을 확장 한다.

관련 : View

Widget
텍스트 상자 또는 팝업 메뉴와 같은 폼 엘리먼트와 다른 UI 컴포넌트를 렌더하는 완전하게 구현된 뷰 서브클래스들의 집합 중 하나.
위젯은 완전하게 구현되었기 때문에, 그것은 스스로를 측정하는 것과 그리는 것, 그리고 스크린 이벤트에 반응하는 것을 처리한다. 위젯은 모두 android.widget 패키지에 있다.

Window
안드로이드 애플리케이션에서 look and feel (title bar text, location and content of menus, and so on)과 같은 일반적인 윈도우의 엘리먼트를 명시하는 추상 클래스인 Window로부터 파생된 오브젝트.
다이얼로그와 액티비티는 원도우를 렌더하기 위해서 이 클래스의 구현물을 사용한다. 여러분은 이 클래스를 구현할 필요없이 여러분의 애플리케이션에서 윈도우를 사용할 수 있다.

'Android > Android&Kernel' 카테고리의 다른 글

Android Source Build Error  (3) 2009/11/26
Android 2.0 Eclair Source Merge Completion  (0) 2009/11/15
Android Glossary  (0) 2009/11/10
4th Korea Android Conference - Android Binder -  (0) 2009/10/24
Building on Mac OSX 10.6 Snow Leopard  (0) 2009/10/08
Android Architecture  (0) 2009/09/22
Posted by mirwing
Android/Android&Kernel2009/10/24 10:11
발표자 : 오동권님(www.flowdas.com)




발표 내용
  • 안드로이드 RPC 메카니즘의 이해
  1. 바인더의 탄생
  2. 바인더 IPC
  3. 바인더의 데이터 전달
  4. 서비스 관리자
  5. 바인더의 한계와 전망

+ 생략된 강의 내용
Flat Binder Object 로 IBinder 외에 File Descriptor를 전달할 수 있습니다.
One-way Call이 존재한다는 사실을 알리지 않았습니다.
Reference Counting 과 관련된 일체의 내용을 생략했습니다.
Thread Priority 와 관련된 내용을 다루지 않았습니다.
Death Notification 을 생략했습니다.
/proc 로 노출되는 데이터들에 관한 설명을 생략했습니다.
Activity Manager 와 관련된 모든 것들을 생략했음은 발표 때 이미 설명 드렸습니다.

Binder는 Linker와 하는 일이 비슷
Linker - 오브젝트 간에 심볼을 연결
Binder - Process 간에 함수의 심볼을 연결

Dannie Hackborn
  • OpenBinder
BeOS의 Project로 시작 -> PalmOS 6 Cobalt에 처음 구현 -> Linux 구현이 오픈 소스로 공개
2005년 개발 중단(Google로 이직)
  • Android Binder
OpenBinder(C++) -> Android Binder(C++/JAVA)
Kernel Module은 OpenBinder 코드 재사용
OpenBinder와 설계 철학을 공유
Android Binder Document는 존재하지 않아서 Source Code를 보고 직접 확인

Thread Model
  • stub는 어떤 thread에서 수행 되는가?
callee가 결정 해야함
여러개의 caller가 호출하게 되면 callee가 알아서 Thread를 만들어 줘야함
service 제작시 유의사항
  • thread looper를 직접 디자인
  • service manager의 경우는 모든 요청을 단일 Thread로 동작
  • stub()의 수행이 짧음

  • return value는 어떻게 caller에게 돌아가는가?
Binder Diver가 History를 기억

  • stub의 내부에서 callback 함수가 수행되면 누가 보장해주냐?
Transparent Recursion - Android Binder만의 Unique한 특징
stub에서 callback함수를 호출하게 되면 caller에게 BC_TRANSACTION으로 caller의 callback함수를 사용
caller에서는 자신에게 온게 BR_REPLY가 아닌 BR_TRANSACTION임을 확인하고 callee에서 callback함수를 호출 한 것임을 알아야 함
이 때의 Thread는 원래의 caller thread를 이용하게 됨

  • caller는 LPC와 RPC의 차이를 구분하지 못하도록 하자!
timing를 제외한 나머지는 동일하게 작업된다.

/dev/binder
Binder의 IPC의 단 하나의 기능을 제외한 모든 기능을 넣어둠
  • 단 하나의 기능 : share memory -> ashmem을 사용
Protocol Version 7


BINDER_WRITE_READ
struct binde_write_read {
long write_size;
long write_consumed;
unsigned long write_buffer;
long read_size;
long read_consumed;
unsigned long read_buffer;
}

  • read_size가 0이 아니면 계속 return을 기다림
  • consumed -> 진척 상황을 보여줌

Binder Transaction

binder.



  • Target Method
handle : Remote Interface
ptr & cookie : Local Interface
code : Method ID -> 호출 하고자 하는 Method ID(함수 선언 순서)

  • Parcel - Input/Output Parameters
data.ptr.buffer
data_size

  • Object Reference Management
data.ptr.offsets
offsets_size
  • Security
sender_pid
sender_euid
binder 드라이버가 caller의 uid와 pid를 넣어줌
callee가 알아서 Security Model을 결정
Service Manager
  • System이 외에는 모두 무시

  • Transaction GUID
누구에게 return을 해야 하는지 알려줌
Android Binder에는 없음

Standard Parcel
Android의 대부분에서 사용되어 지는 Parcel
BC_TRANSACTION
  • Interface의 이름 -> String16 : full name이 들어가기 때문에 overhead를 예상
  • Input Parameters
BC_REPLY
  • Return Value
  • Output Parameters

Object Reference Management

'Android > Android&Kernel' 카테고리의 다른 글

Android 2.0 Eclair Source Merge Completion  (0) 2009/11/15
Android Glossary  (0) 2009/11/10
4th Korea Android Conference - Android Binder -  (0) 2009/10/24
Building on Mac OSX 10.6 Snow Leopard  (0) 2009/10/08
Android Architecture  (0) 2009/09/22
Android 구성요소  (0) 2009/09/22
Posted by mirwing
Android/Android&Kernel2009/10/08 15:09
[출처 : android-platform]

google groups의 메일을 검색해보니......떡하니 바로 뜨는 메일 하나!

해당 메일을 따라 설정을 해보니....

Snow Leopard에서도 원래 되는게 아닌가 라는 생각이 들었습니다.


제일 먼저 source android에 따라 MAC의 Android 개발 환경을 설정한다.

Snow Leopard에 설정 되어 있는 java를 바꿔치지 하는거 같습니다(?)...흠흠


이렇게 하면 기본 환경을 설정이 된거 같습니다.

마지막으로 Android Compiler를 패치를 합니다....


git pull git://android.git.kernel.org/platform/system/core refs/changes/97/12597/1
cd ../..
pwd

이제 Android를 파헤쳐 봅시닷! >.<

'Android > Android&Kernel' 카테고리의 다른 글

Android Glossary  (0) 2009/11/10
4th Korea Android Conference - Android Binder -  (0) 2009/10/24
Building on Mac OSX 10.6 Snow Leopard  (0) 2009/10/08
Android Architecture  (0) 2009/09/22
Android 구성요소  (0) 2009/09/22
What is Android?  (0) 2009/09/22
Posted by mirwing