Archive for the ‘Android’ Category

Android雾里看花

May 6, 2010

一个Android应用是由一个或多个Activity组成的(也有可能没有Activity,而是Service等)

    <activity android:name=".app.DialogActivity"
            android:label="@string/activity_dialog"
            android:theme="@android:style/Theme.Dialog">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.SAMPLE_CODE" />
        </intent-filter>
    </activity>

一个activity,可以用theme来装饰。

雾里看花2

May 6, 2010

Android里有很多 property,包括系统版本等,都是property。这个有点儿像环境变量。不同的是,环境变量不是全局的,比如,父进程的环境变量可以被子进程继承。但是一旦子进程创建之后,父子进程之间的环境变量就是独立的了。父进程对自己的环境变量的修改不会影响到子进程,反之亦然。

Android里的property却不是这样,它是全局的。系统中任意一个进程对property进行修改,都会被其他进程看到。系统的第一个进程,也就是init进程被创建的时候,就会打开/dev/ashmem,并对它映射到内存中,然后把其fd(file descriptor,文件描述符)以及ashmem的大小放到环境变量里。以后运行的每个程序,只要它是链接了bionic库(Andriod的C 库),在这个库初始化的时候,就会自动针对这个环境变量作property的初始化。

这无疑是一种很特别的IPC(Inter Process Communication,进程间通信)机制。

IPC有很多种,详情可以看已故的Richard Stevens写的UNIX Network Programming,Volume 2,这本书是专门讲IPC的。

这俩是干嘛的?

April 30, 2010

这俩看到出现的地方还挺多,应该是很重要的东西,不知道怎么用呢?

        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/email_v2";
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/email_v2";

Android都能有哪些Intent

April 23, 2010
146 matches for "public static final String" in buffer: Intent.java
    590:    public static final String ACTION_MAIN = "android.intent.action.MAIN";
    604:    public static final String ACTION_VIEW = "android.intent.action.VIEW";
    610:    public static final String ACTION_DEFAULT = ACTION_VIEW;
    621:    public static final String ACTION_ATTACH_DATA = "android.intent.action.ATTACH_DATA";
    629:    public static final String ACTION_EDIT = "android.intent.action.EDIT";
    640:    public static final String ACTION_INSERT_OR_EDIT = "android.intent.action.INSERT_OR_EDIT";
    649:    public static final String ACTION_PICK = "android.intent.action.PICK";
    666:    public static final String ACTION_CREATE_SHORTCUT = "android.intent.action.CREATE_SHORTCUT";
    673:    public static final String EXTRA_SHORTCUT_INTENT = "android.intent.extra.shortcut.INTENT";
    679:    public static final String EXTRA_SHORTCUT_NAME = "android.intent.extra.shortcut.NAME";
    685:    public static final String EXTRA_SHORTCUT_ICON = "android.intent.extra.shortcut.ICON";
    692:    public static final String EXTRA_SHORTCUT_ICON_RESOURCE =
    804:    public static final String ACTION_CHOOSER = "android.intent.action.CHOOSER";
    865:    public static final String ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT";
    876:    public static final String ACTION_DIAL = "android.intent.action.DIAL";
    891:    public static final String ACTION_CALL = "android.intent.action.CALL";
    900:    public static final String ACTION_CALL_EMERGENCY = "android.intent.action.CALL_EMERGENCY";
    909:    public static final String ACTION_CALL_PRIVILEGED = "android.intent.action.CALL_PRIVILEGED";
    916:    public static final String ACTION_SENDTO = "android.intent.action.SENDTO";
    942:    public static final String ACTION_SEND = "android.intent.action.SEND";
    969:    public static final String ACTION_SEND_MULTIPLE = "android.intent.action.SEND_MULTIPLE";
    976:    public static final String ACTION_ANSWER = "android.intent.action.ANSWER";
    984:    public static final String ACTION_INSERT = "android.intent.action.INSERT";
    991:    public static final String ACTION_DELETE = "android.intent.action.DELETE";
    998:    public static final String ACTION_RUN = "android.intent.action.RUN";
   1005:    public static final String ACTION_SYNC = "android.intent.action.SYNC";
   1015:    public static final String ACTION_PICK_ACTIVITY = "android.intent.action.PICK_ACTIVITY";
   1024:    public static final String ACTION_SEARCH = "android.intent.action.SEARCH";
   1033:    public static final String ACTION_SYSTEM_TUTORIAL = "android.intent.action.SYSTEM_TUTORIAL";
   1045:    public static final String ACTION_WEB_SEARCH = "android.intent.action.WEB_SEARCH";
   1052:    public static final String ACTION_ALL_APPS = "android.intent.action.ALL_APPS";
   1059:    public static final String ACTION_SET_WALLPAPER = "android.intent.action.SET_WALLPAPER";
   1067:    public static final String ACTION_BUG_REPORT = "android.intent.action.BUG_REPORT";
   1076:    public static final String ACTION_FACTORY_TEST = "android.intent.action.FACTORY_TEST";
   1085:    public static final String ACTION_CALL_BUTTON = "android.intent.action.CALL_BUTTON";
   1093:    public static final String ACTION_VOICE_COMMAND = "android.intent.action.VOICE_COMMAND";
   1102:    public static final String ACTION_SEARCH_LONG_PRESS = "android.intent.action.SEARCH_LONG_PRESS";
   1114:    public static final String ACTION_APP_ERROR = "android.intent.action.APP_ERROR";
   1122:    public static final String ACTION_POWER_USAGE_SUMMARY = "android.intent.action.POWER_USAGE_SUMMARY";
   1136:    public static final String ACTION_UPGRADE_SETUP = "android.intent.action.UPGRADE_SETUP";
   1143:    public static final String METADATA_SETUP_VERSION = "android.SETUP_VERSION";
   1156:    public static final String ACTION_SCREEN_OFF = "android.intent.action.SCREEN_OFF";
   1164:    public static final String ACTION_SCREEN_ON = "android.intent.action.SCREEN_ON";
   1174:    public static final String ACTION_USER_PRESENT= "android.intent.action.USER_PRESENT";
   1187:    public static final String ACTION_TIME_TICK = "android.intent.action.TIME_TICK";
   1192:    public static final String ACTION_TIME_CHANGED = "android.intent.action.TIME_SET";
   1197:    public static final String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED";
   1208:    public static final String ACTION_TIMEZONE_CHANGED = "android.intent.action.TIMEZONE_CHANGED";
   1216:    public static final String ACTION_ALARM_CHANGED = "android.intent.action.ALARM_CHANGED";
   1223:    public static final String ACTION_SYNC_STATE_CHANGED
   1236:    public static final String ACTION_BOOT_COMPLETED = "android.intent.action.BOOT_COMPLETED";
   1242:    public static final String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS";
   1252:    public static final String ACTION_PACKAGE_INSTALL = "android.intent.action.PACKAGE_INSTALL";
   1268:    public static final String ACTION_PACKAGE_ADDED = "android.intent.action.PACKAGE_ADDED";
   1282:    public static final String ACTION_PACKAGE_REPLACED = "android.intent.action.PACKAGE_REPLACED";
   1300:    public static final String ACTION_PACKAGE_REMOVED = "android.intent.action.PACKAGE_REMOVED";
   1317:    public static final String ACTION_PACKAGE_CHANGED = "android.intent.action.PACKAGE_CHANGED";
   1333:    public static final String ACTION_PACKAGE_RESTARTED = "android.intent.action.PACKAGE_RESTARTED";
   1348:    public static final String ACTION_PACKAGE_DATA_CLEARED = "android.intent.action.PACKAGE_DATA_CLEARED";
   1357:    public static final String ACTION_UID_REMOVED = "android.intent.action.UID_REMOVED";
   1363:    public static final String ACTION_WALLPAPER_CHANGED = "android.intent.action.WALLPAPER_CHANGED";
   1386:    public static final String ACTION_CONFIGURATION_CHANGED = "android.intent.action.CONFIGURATION_CHANGED";
   1394:    public static final String ACTION_LOCALE_CHANGED = "android.intent.action.LOCALE_CHANGED";
   1415:    public static final String ACTION_BATTERY_CHANGED = "android.intent.action.BATTERY_CHANGED";
   1424:    public static final String ACTION_BATTERY_LOW = "android.intent.action.BATTERY_LOW";
   1434:    public static final String ACTION_BATTERY_OKAY = "android.intent.action.BATTERY_OKAY";
   1446:    public static final String ACTION_POWER_CONNECTED = "android.intent.action.ACTION_POWER_CONNECTED";
   1458:    public static final String ACTION_POWER_DISCONNECTED =
   1471:    public static final String ACTION_SHUTDOWN = "android.intent.action.ACTION_SHUTDOWN";
   1482:    public static final String ACTION_REQUEST_SHUTDOWN = "android.intent.action.ACTION_REQUEST_SHUTDOWN";
   1491:    public static final String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
   1499:    public static final String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
   1507:    public static final String ACTION_MANAGE_PACKAGE_STORAGE = "android.intent.action.MANAGE_PACKAGE_STORAGE";
   1515:    public static final String ACTION_UMS_CONNECTED = "android.intent.action.UMS_CONNECTED";
   1524:    public static final String ACTION_UMS_DISCONNECTED = "android.intent.action.UMS_DISCONNECTED";
   1531:    public static final String ACTION_MEDIA_REMOVED = "android.intent.action.MEDIA_REMOVED";
   1538:    public static final String ACTION_MEDIA_UNMOUNTED = "android.intent.action.MEDIA_UNMOUNTED";
   1545:    public static final String ACTION_MEDIA_CHECKING = "android.intent.action.MEDIA_CHECKING";
   1552:    public static final String ACTION_MEDIA_NOFS = "android.intent.action.MEDIA_NOFS";
   1561:    public static final String ACTION_MEDIA_MOUNTED = "android.intent.action.MEDIA_MOUNTED";
   1568:    public static final String ACTION_MEDIA_SHARED = "android.intent.action.MEDIA_SHARED";
   1575:    public static final String ACTION_MEDIA_BAD_REMOVAL = "android.intent.action.MEDIA_BAD_REMOVAL";
   1582:    public static final String ACTION_MEDIA_UNMOUNTABLE = "android.intent.action.MEDIA_UNMOUNTABLE";
   1590:    public static final String ACTION_MEDIA_EJECT = "android.intent.action.MEDIA_EJECT";
   1597:    public static final String ACTION_MEDIA_SCANNER_STARTED = "android.intent.action.MEDIA_SCANNER_STARTED";
   1604:    public static final String ACTION_MEDIA_SCANNER_FINISHED = "android.intent.action.MEDIA_SCANNER_FINISHED";
   1611:    public static final String ACTION_MEDIA_SCANNER_SCAN_FILE = "android.intent.action.MEDIA_SCANNER_SCAN_FILE";
   1619:    public static final String ACTION_MEDIA_BUTTON = "android.intent.action.MEDIA_BUTTON";
   1627:    public static final String ACTION_CAMERA_BUTTON = "android.intent.action.CAMERA_BUTTON";
   1636:    public static final String ACTION_GTALK_SERVICE_CONNECTED =
   1643:    public static final String ACTION_GTALK_SERVICE_DISCONNECTED =
   1650:    public static final String ACTION_INPUT_METHOD_CHANGED =
   1666:    public static final String ACTION_AIRPLANE_MODE_CHANGED = "android.intent.action.AIRPLANE_MODE";
   1695:    public static final String ACTION_PROVIDER_CHANGED =
   1710:    public static final String ACTION_HEADSET_PLUG =
   1748:    public static final String ACTION_NEW_OUTGOING_CALL =
   1759:    public static final String ACTION_REBOOT =
   1771:    public static final String ACTION_DOCK_EVENT =
   1786:    public static final String ACTION_REMOTE_INTENT =
   1798:    public static final String ACTION_PRE_BOOT_COMPLETED =
   1814:    public static final String CATEGORY_DEFAULT = "android.intent.category.DEFAULT";
   1826:    public static final String CATEGORY_BROWSABLE = "android.intent.category.BROWSABLE";
   1849:    public static final String CATEGORY_ALTERNATIVE = "android.intent.category.ALTERNATIVE";
   1858:    public static final String CATEGORY_SELECTED_ALTERNATIVE = "android.intent.category.SELECTED_ALTERNATIVE";
   1863:    public static final String CATEGORY_TAB = "android.intent.category.TAB";
   1868:    public static final String CATEGORY_LAUNCHER = "android.intent.category.LAUNCHER";
   1875:    public static final String CATEGORY_INFO = "android.intent.category.INFO";
   1881:    public static final String CATEGORY_HOME = "android.intent.category.HOME";
   1886:    public static final String CATEGORY_PREFERENCE = "android.intent.category.PREFERENCE";
   1891:    public static final String CATEGORY_DEVELOPMENT_PREFERENCE = "android.intent.category.DEVELOPMENT_PREFERENCE";
   1896:    public static final String CATEGORY_EMBED = "android.intent.category.EMBED";
   1901:    public static final String CATEGORY_MONKEY = "android.intent.category.MONKEY";
   1905:    public static final String CATEGORY_TEST = "android.intent.category.TEST";
   1909:    public static final String CATEGORY_UNIT_TEST = "android.intent.category.UNIT_TEST";
   1914:    public static final String CATEGORY_SAMPLE_CODE = "android.intent.category.SAMPLE_CODE";
   1921:    public static final String CATEGORY_OPENABLE = "android.intent.category.OPENABLE";
   1926:    public static final String CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST =
   1934:    public static final String CATEGORY_CAR_DOCK = "android.intent.category.CAR_DOCK";
   1941:    public static final String CATEGORY_DESK_DOCK = "android.intent.category.DESK_DOCK";
   1953:    public static final String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE";
   1962:    public static final String EXTRA_TEXT = "android.intent.extra.TEXT";
   1968:    public static final String EXTRA_STREAM = "android.intent.extra.STREAM";
   1973:    public static final String EXTRA_EMAIL       = "android.intent.extra.EMAIL";
   1978:    public static final String EXTRA_CC       = "android.intent.extra.CC";
   1983:    public static final String EXTRA_BCC      = "android.intent.extra.BCC";
   1988:    public static final String EXTRA_SUBJECT  = "android.intent.extra.SUBJECT";
   1994:    public static final String EXTRA_INTENT = "android.intent.extra.INTENT";
   2000:    public static final String EXTRA_TITLE = "android.intent.extra.TITLE";
   2009:    public static final String EXTRA_INITIAL_INTENTS = "android.intent.extra.INITIAL_INTENTS";
   2015:    public static final String EXTRA_KEY_EVENT = "android.intent.extra.KEY_EVENT";
   2023:    public static final String EXTRA_KEY_CONFIRM = "android.intent.extra.KEY_CONFIRM";
   2030:    public static final String EXTRA_DONT_KILL_APP = "android.intent.extra.DONT_KILL_APP";
   2037:    public static final String EXTRA_PHONE_NUMBER = "android.intent.extra.PHONE_NUMBER";
   2045:    public static final String EXTRA_UID = "android.intent.extra.UID";
   2053:    public static final String EXTRA_DATA_REMOVED = "android.intent.extra.DATA_REMOVED";
   2061:    public static final String EXTRA_REPLACING = "android.intent.extra.REPLACING";
   2071:    public static final String EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT";
   2080:    public static final String EXTRA_DOCK_STATE = "android.intent.extra.DOCK_STATE";
   2104:    public static final String METADATA_DOCK_HOME = "android.dock_home";
   2112:    public static final String EXTRA_BUG_REPORT = "android.intent.extra.BUG_REPORT";
   2121:    public static final String EXTRA_INSTALLER_PACKAGE_NAME
   2128:    public static final String EXTRA_REMOTE_INTENT_TOKEN =
   2135:    @Deprecated public static final String EXTRA_CHANGED_COMPONENT_NAME =
   2142:    public static final String EXTRA_CHANGED_COMPONENT_NAME_LIST =
   2151:    public static final String EXTRA_CLIENT_LABEL =
   2160:    public static final String EXTRA_CLIENT_INTENT =