android菜鸟日记1

http://ask.lurencun.com
海大知道

Android菜鸟日记

Android 应用程序主要由3部分组成:应用程序描述文件[xml], 各种资源的集合[res], 以及应用程序的源代码。

j2ee 开发与 android发开有高度的类似
j2ee 用标记语言构建view android也是,但Android用的标记语言xml 这种标记语言更好,无需硬编码应用程序的view,可以通过标记来修改应用程序的外观。

Android不允许在res 文件夹中的文件夹中创建文件夹
即不支持res/a/b如此。
只支持res/a




<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.notepad"
>
根包名(package)的定义是<mainfest>元素的一个特性[特性必须有]
每个activity 都有一个name特性。Name名即为类名[每个activity 对应一个类 此类完整包名为mainfestp package.name 这里的name对应的是根包名目录下的类]
确定了入口的activity 程序会调用onCreate()方法


<application android:icon="@drawable/app_notes"
android:label="@string/app_name"
>
<provider android:name="NotePadProvider"
android:authorities="com.google.provider.NotePad"
/>


<activity android:name="NotesList" android:label="@string/title_notes_list">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
</intent-filter>
</activity>

<activity android:name="NoteEditor"
android:theme="@android:style/Theme.Light"
android:label="@string/title_note"
android:screenOrientation="sensor"
android:configChanges="keyboardHidden|orientation"
>
<!-- This filter says that we can view or edit the data of
a single note -->
<intent-filter android:label="@string/resolve_edit">
Intent 通常定义了某种工作的“意图”

<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="com.android.notepad.action.EDIT_NOTE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
</intent-filter>

<!-- This filter says that we can create a new note inside
of a directory of notes. -->
<intent-filter>
<action android:name="android.intent.action.INSERT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />
</intent-filter>

</activity>

<activity android:name="TitleEditor"
android:label="@string/title_edit_title"
android:theme="@android:style/Theme.Dialog"
android:windowSoftInputMode="stateVisible">
<!-- This activity implements an alternative action that can be
performed on notes: editing their title. It can be used as
a default operation if the user invokes this action, and is
available as an alternative action for any note data. -->
<intent-filter android:label="@string/resolve_title">
<!-- This is the action we perform. It is a custom action we
define for our application, not a generic VIEW or EDIT
action since we are not a general note viewer/editor. -->
<action android:name="com.android.notepad.action.EDIT_TITLE" />
<!-- DEFAULT: execute if being directly invoked. -->
<category android:name="android.intent.category.DEFAULT" />
<!-- ALTERNATIVE: show as an alternative action when the user is
working with this type of data. -->
<category android:name="android.intent.category.ALTERNATIVE" />
<!-- SELECTED_ALTERNATIVE: show as an alternative action the user
can perform when selecting this type of data. -->
<category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
<!-- This is the data type we operate on. -->
<data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
</intent-filter>
</activity>

<activity android:name="NotesLiveFolder" android:label="@string/live_folder_name"
android:icon="@drawable/live_folder_notes">
<intent-filter>
<action android:name="android.intent.action.CREATE_LIVE_FOLDER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

</application>

<uses-sdk android:targetSdkVersion="4" android:minSdkVersion="3"/>
</manifest>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值