トラッキング コード

1/21/2012

Build speed up : out directory changed to SSD

Link:
New experimental build system feature: out/ directories in another location
http://groups.google.com/group/android-building/browse_thread/thread/ca6c1648aa52acb9

This should be useful when storing the build output on a physically
different volume. Additional benefits might come from using a
dedicated volume for that where journaling is disabled, and/or from
using an SSD.

To use it, set the OUT_DIR_COMMON_BASE environment to the directory
where the output directories will be created. A subdirectory will be
created there for each source tree. The name of the subdirectory
matches that of the source tree.

memo:
- we can change "out directory" with OUT_DIR_COMMON_BASE
- use SSD to build speed up.

but, This patch is commited in Master blanch, so is not in Android-4.0.3_r1 blanch.

check it !!
\build\core\envsetup.mk

# ---------------------------------------------------------------
# figure out the output directories

ifeq (,$(strip $(OUT_DIR)))
ifeq (,$(strip $(OUT_DIR_COMMON_BASE)))
OUT_DIR := $(TOPDIR)out
else
OUT_DIR := $(OUT_DIR_COMMON_BASE)/$(notdir $(PWD))
endif
endif

DEBUG_OUT_DIR := $(OUT_DIR)/debug

1/19/2012

Adding share action in ActionBar

See Gallery app



I introduce that how to add share action in ActionBar such as Galley app.


Creat menu resouce

You must to creat menu resouce with "android:actionProviderClass="android.widget.ShareActionProvider".

<menu xmlns:android="http://schemas.android.com/apk/res/android" >
    <item
        android:id="@+id/menu_share"
        android:title="share"
        android:icon="@android:drawable/ic_menu_share"
        android:showAsAction="ifRoom"
        android:actionProviderClass="android.widget.ShareActionProvider">
    </item>
</menu>

Adding Intent action

You must to add intent action with ShareActionProvider.class in onCreateOptionsMenu method.

public boolean onCreateOptionsMenu(Menu menu){
     getMenuInflater().inflate(R.menu.menu, menu);
        mShareActionProvider = (ShareActionProvider) menu.findItem(R.id.menu_share).getActionProvider();

        // If you use more than one ShareActionProvider, each for a different action,
        // use the following line to specify a unique history file for each one.
        // mShareActionProvider.setShareHistoryFileName("custom_share_history.xml");

        // Set the share intent
        Intent shareIntent = new Intent(Intent.ACTION_SEND);
        shareIntent.setAction(Intent.ACTION_SEND);
        shareIntent.setType("text/plain");
        shareIntent.putExtra(Intent.EXTRA_TEXT, "shareIntent Test");
        
        mShareActionProvider.setShareIntent(shareIntent);

        return true;
    }


1/18/2012

Using the App Icon for Navigation

What is the App Icon for Navigation?

You can see the App Icon for Navigation in Market App.



How to use the App Icon for Navigation

To enable the icon for up navigation, call setDisplayHomeAsUpEnabled(true) on your ActionBar.

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ActionBar actionBar = getActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);
    }

When the user touches the icon, Android framework is called onOptionsItemSelected() method with the android.R.id.home ID in Activity Class.

    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
        case android.R.id.home:
            // app icon in action bar clicked;
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }

1/16/2012

Adding the ActionBar

Developer site:
http://developer.android.com/intl/ja/guide/topics/ui/actionbar.html

Adding the Action Bar

Beginning with Android 3.0 (API level 11), the action bar is included in all activitie.
If yuu want to use Action Bar, you should add android:targetSdkVersion="11" in AndroidManifest.xml.


<manifest ...="">
    <uses-sdk android:minsdkversion="8" android:targetsdkversion="11">
</uses-sdk>
</manifest>


Creating an Options Menu

Creating a Menu Resource

you should define a menu and all its items in an XML menu resource, then inflate the menu resource (load it as a programmable object) in your application code.
To create a menu resource, create an XML file inside your project's res/menu/ directory.

example.
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
    <item
        android:id="@+id/item1"
        android:icon="@android:drawable/ic_menu_edit"
        android:title="btn1">
    </item>
    <item
        android:id="@+id/item2"
        android:icon="@android:drawable/ic_menu_add"
        android:title="btn2">
    </item>
</menu>


Creating an Options Menu

When Press the menu key, Android Framework is called onCreateOptionsMenu method in Activity class.
To inflate a menu resource.

@Override
    public boolean onCreateOptionsMenu(Menu menu){
      super.onCreateOptionsMenu(menu);
      getMenuInflater().inflate(R.menu.menu,menu);
      return true;
    }

Responding to user action

When User selected in menu item, Android Framework is called onOptionsItemSelected method in Activity class.


@Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
        case R.id.item1:
         //action item1
            return true;
        case R.id.item2:
         //action item2
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }

1/14/2012

Building for maguro ICS

maguro is building name of "Galaxy Nexus for GSM/HSPA+".

Reference WebPage

http://source.android.com/source/building-devices.html
http://code.google.com/intl/ja/android/nexus/drivers.html


Obtaining "proprietary binaries"

You need to obtain "proprietary binaries" which is not include the Android Open-Source Project.
To run the script for obtaining device's "proprietary binaries"

$ cd device/samsung/maguro
$ ./extract-files.sh

After running script, "vendor" drectory is generated in the root of the build environment.

vender/samsung/maguro/*

If you don't have Galaxy Nexus, need to get "proprietary binaries".

Example for getting Android-4.0.3 IML74K "proprietary binaries".
$ wget https://dl.google.com/dl/android/aosp/imgtec-maguro-iml74k-a796ffae.tgz
$ wget https://dl.google.com/dl/android/aosp/samsung-maguro-iml74k-de1cc439.tgz
$ tar zxvf imgtec-maguro-iml74k-a796ffae.tgz
$ tar zxvf samsung-maguro-iml74k-de1cc439.tgz
$ ./extract-imgtec-maguro.sh
$ ./extract-samsung-maguro.sh


building the configuration that matches a device

running to build for maguro.

$ . build/envsetup.sh
$ lunch full_maguro-userdebug
$ make

Building for Crespo ICS

Reference WebPage

http://source.android.com/source/building-devices.html
http://code.google.com/intl/ja/android/nexus/drivers.html


Obtaining "proprietary binaries"

You need to obtain "proprietary binaries" which is not include the Android Open-Source Project.
To run the script for obtaining device's "proprietary binaries"

$ cd device/samsung/crespo
$ ./extract-files.sh

After running script, "vendor" drectory is generated in the root of the build environment.

vender/samsung/crespo/*


building the configuration that matches a device

running to build for crespo.

$ . build/envsetup.sh
$ lunch full_crespo-userdebug
$ make