应用、permission、资源

应用
为程序添加Menu菜单
//创建OptionsMenu publi c bool ean onCreateOpti onsMenu(Menu menu)
//处理选择事件publi c bool ean onOpti onsIt emSel ect ed(MenuIt em i t em)
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
boolean result = super.onCreateOptionsMenu(menu);
menu.add(0, INSERT_ID_Play, 0, R.string.menu_toPlay);
menu.add(0, INSERT_ID_Stop, 0, R.string.menu_toStop);
return result;
}//创建菜单
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
if(item.getItemId()==INSERT_ID_Play){
Play_Music();
} if if(item.getItemId()==INSERT_ID_Stop){
Stop_Music();
} return super.onOptionsItemSelected(item);
}
-----------------------------------Android 编程基础
3
应用SDCard
① 打开CMD
② 进入C:\Documents and Settings\地狱怒兽\Local Settings\Application Data\Android\SDK-1.1 目录
③ 创建sdcard 镜像mksdcard 256M ./sdcard.img
④ 往SDCard 中添加资源:adb push zyf.mp3 /sdcard/zyf.mp3
⑤ 往SDCard 中获取资源:adb pull /sdcard/mybaby.jpg C:\
⑥ 重启模拟器后,文件即在虚拟SDCard 中
向模拟器安装APK软件包
① 打开cmd
② 切换到Android SDK tools 目录下
③ 把APK 软件包复制到Android SDK tools 目录下
④ adb install Snake.pak
删除模拟器中APK软件包
① 打开模拟器
② 打开cmd
③ adb shell
④ cd data/app
⑤ ls -l
⑥ rm 文件名.apk
-----------------------------------Android 编程基础
4
对话框的简单应用
AlertDialog.Builder
Dialog
排版布局Layout
public class DialogDemo extends Activity implements OnClickListener{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
AlertDialog.Builder myBuilder=new AlertDialog.Builder(this);
myBuilder.setIcon(R.drawable.hermes);
myBuilder.setTitle("我的对话框");
myBuilder.setPositiveButton("退出", this);
myBuilder.show();
} public void onClick(DialogInterface dialog, int which) {
}
}
public class DialogDemo extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Dialog myDialog=new Dialog(this);
myDialog.setTitle("this is a Dialog");
myDialog.show();
}
}
元件名稱説明
FrameLayout 單一物件的容器
AbsoluteLayout 以絕對座標排版的容器
LinearLayout 線性(水平或垂直) 排版的容器
RelativeLayout 以相對座標(相對於父元件或兄弟元件) 排版的容器
TableLayout 以表格方式排版的容器
-----------------------------------Android 编程基础
5
TextView 中的超链接文本
<TextView
android:id="@+id/linkText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/linktext"
android:autoLink="all"
> </TextView>
关键点:设置了该属性则可
以自动链接,否则没有链接
-----------------------------------Android 编程基础
6
时间设置对话框DatePickerDialog的使用
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
Button btn = (Button) findViewById(R.id.date);
btn.setOnClickListener(this);
}
@Override
public void onClick(View v) {//普通按钮事件
Calendar d = Calendar.getInstance(Locale.CHINA);
//创建一个日历引用d,通过静态方法getInstance() 从指定时区Locale.CHINA 获得一个日期实例
Date myDate=new Date();
//创建一个Date实例
d.setTime(myDate);
//设置日历的时间,把一个新建Date实例myDate传入
int year=d.get(Calendar.YEAR);
int month=d.get(Calendar.MONTH);
int day=d.get(Calendar.DAY_OF_MONTH);
//获得日历中的year month day
DatePickerDialog dlg=new DatePickerDialog(this,this,year,month,day);
//新建一个DatePickerDialog 构造方法中
(设备上下文,OnDateSetListener时间设置监听器,默认年,默认月,默认日)
dlg.show();
//让DatePickerDialog显示出来
}
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,int dayOfMonth){
//DatePickerDialog 中按钮Set按下时自动调用
TextView txt = (TextView) findViewById(R.id.text);
//通过id获得TextView对象
txt.setText(Integer.toString(year) + "-" +
Integer.toString(monthOfYear) + "-" +
Integer.toString(dayOfMonth));
//设置text
}
-----------------------------------Android 编程基础
7
ListView的使用1
① ListView 的声明、定义
② 数组适配器的生命定义
③ 给ListView 设置数组适配器
④ 设置ListView 的元素被选中时的事件处理监听器
⑤ 事件处理监听器方法
⑥ 让ListView 中的内容变化,重新设置一个ArrayAdapter 即可
ListView list=new ListView(this);
String []name=new String[]{"Java","C++","C","C#","VB","XML",".NET","J#"};
ArrayAdapter<String> arrayadapter
=new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1,name);
list.setAdapter(arrayadapter);
list.setOnItemClickListener(this);
@Override
public void onItemClick(AdapterView<?> arg0,
View arg1, int arg2, long arg3) {
// TODO Auto-generated method stub
setTitle(GetData(arg2));
}
String []score=new String[]{"93","76","84","85","93","84","88","78"};
ArrayAdapter<String> arratadapter2=new ArrayAdapter<String>(this,
android.R.layout.simple_expandable_list_item_1,score);
list.setAdapter(arratadapter2);
-----------------------------------Android 编程基础
8
ListView的使用2
① ListView 在XML 文件中声明
② ListView 在java 文件中获得
③ 声明和定义、初始化一个ArrayList
④ 声明和定义、初始化一个SimpleAdepter
⑤ LixtView 设置适配器
⑥ 为ListView 设置选项事件监听器
<ListView android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
listview = (ListView) findViewById(R.id.list);
//从list.xml 中获得ListView 对象list
private ArrayList<Map<String, Object>> arrayList;
arrayList= new ArrayList<Map<String, Object>>();
Map<String, Object> map;
map= new HashMap<String, Object>();
map.put("System", "Linux");
map.put("Ability", "Cool");
arrayList.add(item);
SimpleAdapter adapter;
adapter= new SimpleAdapter(this, coll,
android.R.layout.simple_list_item_1,
new String[] { "System" }, new int[] { android.R.id.text1 });
listview.setAdapter(adapter);//设置适配器
listview.setOnItemClickListener(listener);
OnItemClickListener listener = new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
textview.setTextColor(Color.YELLOW);
textview.setText(coll.get(arg2).get("prod_type").toString());
}
};//事件处理接口实现
-----------------------------------Android 编程基础
9
ListActivity的使用
① 定义一个类继承自ListActivity
② 声明和定义、初始化一个ArrayList
③ 声明和定义、初始化一个SimpleAdepter
④ LixtView 设置适配器
⑤ 选项按键事件处理,不需要.setOnItemClickListener(); 直接实现以下方法
public class ListActivityOfMe extends ListActivity {}
private ArrayList<Map<String, Object>> arrayList;
arrayList= new ArrayList<Map<String, Object>>();
Map<String, Object> map;
map= new HashMap<String, Object>();
map.put("System", "Linux");
map.put("Ability", "Cool");
arrayList.add(item);
SimpleAdapter adapter;
adapter= new SimpleAdapter(this, arrayList,
android.R.layout.simple_list_item_1,
new String[] { "System" }, new int[] { android.R.id.text1 });
this.setAdapter(adapter);//设置适配器
protected void onListItemClick(ListView l, View v, int position, long id)
{
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
actionTo(position);
}
-----------------------------------Android 编程基础
10
数据共享SharedPreferences
① 数据请求端,线先开启另一个Activity
② 数据选择端,设置好数据,利用实现了SharePreferences 接口的Editor 子类添加并修改数据
③ 数据选择端,存入数据,关闭Activity。
④ 数据请求端,利用SharePreferences 接口来获取数据Key,然后通过getString(String Key,String
Defaultvalue)来获得Key 中数据
Intent startNextLayout=new Intent();
startNextLayout.setClass(myEx.this,choiceGroupActivity.class);
startActivity(startNextLayout);
//开启另一个Activity
Editor passfileEditor=getSharedPreferences("ITEM", 0).edit();
passfileEditor.putString("ChoiceKye", myContentString);
//设置数据Key,并添加数据myContentString 到共享区
passfileEditor.commit();//委托,存入数据
finish();//
SharedPreferences sharedPreferences=getSharedPreferences("ITEM", 0);
//得到共享区"ITEM"的接口引用
String show=sharedPreferences.getString("ChoiceKye", "there is NONE")
/*利用Key"ChoiceKye"从SharePreferences 接口引用中
得到ChoiceKye 的内容,没有时为默认值"there is NONE"*/
TextView showTextView=(TextView)findViewById(R.id.showR);
showTextView.setText(show);//显示ChoiceKye 的内容
获得实现了SharePreferences
接口的Editor 对象
-----------------------------------Android 编程基础
11
Intents和ListActivity:
创建联系人列表并和联系人打电话应用程序
内容: 这个教程教我们怎么开发一个ListActivity 应用, 联系人的列表装载到了基于List 的View. 然后可以选
择其中之一打电话.
目的: 可以非常容易的学会Intents 和ListActivities 的使用.
Main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name: "
/>
<TextView
android:id="@+id/row_entry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
-----------------------------------Android 编程基础
12
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="zyf.CallME"
android:versionCode="1"
android:versionName="1.0">
<application
android:label="@string/app_name"
android:icon="@drawable/android">
<activity
android:name=".CallME"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name=
"android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="2" />
<uses-permission android:name="android.permission.READ_CONTACTS">
</uses-permission>
<uses-permission android:name="android.permission.CALL_PHONE"></usespermission>
</manifest>
-----------------------------------Android 编程基础
13
Java
package zyf.CallME;
import android.app.ListActivity;
import android.content.*;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.Contacts.People;
import android.view.View;
import android.widget.*;
public class CallME extends ListActivity {
private String[] name;
private int[] to;
private SimpleCursorAdapter sadapter;
private Intent callIntent;
private long PhoneID;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
try {
Cursor c =
getContentResolver().query(People.CONTENT_URI, null,
null, null, null);
startManagingCursor(c);
name = new String[] { People.NAME };
to = new int[] { R.id.row_entry };
sadapter = new SimpleCursorAdapter(this,R.layout.main, c, name, to);
this.setListAdapter(sadapter);
} catch (Exception e) {
Toast.makeText(this, "联系人读取错误",
Toast.LENGTH_LONG).show();
}
} @
Override
protected void onListItemClick(ListView l,
View v, int position, long id) {
super.onListItemClick(l, v, position, id);
callIntent=new Intent(Intent.ACTION_CALL);
Cursor c=(Cursor)sadapter.getItem(position);
PhoneID=c.getLong(c.getColumnIndex(People.PRIMARY_PHONE_ID));
callIntent.setData(ContentUris.withAppendedId(android.provider.
Contacts.Phones.CONTENT_URI, PhoneID));
startActivity(callIntent);
}
}
-----------------------------------Android 编程基础
14
解析
① 在main.xml 中添加两个TextView
用于显示"Name:"的静态标签
用于动态添加并显示联系人的姓名内容的TextView
② 修改LinearLayout 的布局方向
③ AndroidManifest.xml 中说明使用权限
④ Java 代码中的读取联系人信息处理
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name: "
/>
<TextView
android:id="@+id/row_entry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:orientation="horizontal" //说明横向排布
<uses-permission
android:name="android.permission.READ_CONTACTS"></uses-permission>
//说明可以访问读取联系人信息
<uses-permission
android:name="android.permission.CALL_PHONE"></uses-permission>
//说明可以使用打电话功能
try {
Cursor c =
getContentResolver().query(People.CONTENT_URI, null,null, null, null);
//Cursor,该接口提供从数据库提取信息返回结果中随机读写访问
//ContentResolver 提供应用程序访问Content模型
//ContentResolver.query()抽取给定的URI,返回一个在结果之上的Cursor
startManagingCursor(c);
//该方法允许Activity基于Activity的生命周期来为你处理管理给定的Cursor的生命周期
name = new String[] { People.NAME };
//新建用户名数组People类用于列出联系人People.NAME得到联系人姓名
-----------------------------------Android 编程基础
15
⑤ Java 代码中的点击事件处理(选择后电话联系该联系人)
to = new int[] { R.id.row_entry };
//创建一个TextView引用数组用来放置获取的People.NAME
sadapter = new SimpleCursorAdapter(this,R.layout.main, c, name, to);
this.setListAdapter(sadapter);
//创建一个简单的适配器从一个cursor指针到TextView或是ImageView的map专栏适配器。
//构造方法(Context,layout,Cursor,from,to),第一参数是设备上下文,第二个参数是布局文
件,第三个参数是指向联系人URI的Cursor指针,form代表来源的字符串(联系人名),to把联系人名放到
的地方(TextView)
} catch (Exception e) {
Toast.makeText(this, "联系人读取错误",Toast.LENGTH_LONG).show();
//Toast显示提示,不打扰用户。.show()用来显示Toast
}
protected void onListItemClick(ListView l,View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
callIntent=new Intent(Intent.ACTION_CALL);
//创建一个带有Call动作的Intent
Cursor c=(Cursor)sadapter.getItem(position);
//通过选中的Items位置来获取相应的联系人指针Cursor
PhoneID=c.getLong(c.getColumnIndex(People.PRIMARY_PHONE_ID));
//获取相应联系人电话号码
//getLong()返回请求数据的一个长整型
//为给定的列,返回基于0的索引值
//People.PRIMARY_PHONE_ID 获取主键电话号码
callIntent.setData(ContentUris.withAppendedId(android.provider.
Contacts.Phones.CONTENT_URI, PhoneID));
//为Intent设置操作的数据
//ContentUris操作带有数据内容的Uri的实用方法、它们带有"Content"体制
//withAppendedId()把给定的ID添加到path后面第一个参数是开始的,后面参数是添加的
startActivity(callIntent);
//开启Intent
}
-----------------------------------Android 编程基础
16
Android Permission大全
Android SDK 1.0 访问权限许可
程序执行需要读取到安全敏感项必需在androidmanifest.xml 中声明相关权限请求, 完整列表如下:
允许读写访问"properties"表在checkin 数据库中,改值可以修改上传( Allows read/write access to the "properties"
table in the checkin database, to change values that get uploaded)
允许一个程序访问CellID 或WiFi 热点来获取粗略的位置(Allows an application to access coarse (e.g., Cell-ID,
WiFi) location)
允许一个程序访问精良位置(如GPS) (Allows an application to access fine (e.g., GPS) location)
允许应用程序访问额外的位置提供命令(Allows an application to access extra location provider commands)
允许程序创建模拟位置提供用于测试(Allows an application to create mock location providers for testing)
允许程序访问有关GSM 网络信息(Allows applications to access information about networks)
允许程序使用SurfaceFlinger 底层特性(Allows an application to use SurfaceFlinger's low level features)
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
android.permission.ACCESS_MOCK_LOCATION
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_SURFACE_FLINGER
-----------------------------------Android 编程基础
17
允许程序访问Wi-Fi 网络状态信息(Allows applications to access information about Wi-Fi networks)
允许程序发布系统级服务(Allows an application to publish system-level services).
允许程序更新手机电池统计信息(Allows an application to update the collected battery statistics)
允许程序连接到已配对的蓝牙设备(Allows applications to connect to paired bluetooth devices)
允许程序发现和配对蓝牙设备(Allows applications to discover and pair bluetooth devices)
请求能够禁用设备(非常危险)(Required to be able to disable the device (very *erous!).)
允许程序广播一个提示消息在一个应用程序包已经移除后(Allows an application to broadcast a notification that
an application package has been removed)
允许一个程序广播常用intents(Allows an application to broadcast sticky intents)
android.permission.ACCESS_WIFI_STATE
android.permission.ADD_SYSTEM_SERVICE
android.permission.BATTERY_STATS
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
android.permission.BRICK
android.permission.BROADCAST_PACKAGE_REMOVED
android.permission.BROADCAST_STICKY
-----------------------------------Android 编程基础
18
允许一个程序初始化一个电话拨号不需通过拨号用户界面需要用户确认(Allows an application to initiate a
phone call without going through the Dialer user interface for the user to confirm the call being placed.)
允许一个程序拨打任何号码,包含紧急号码无需通过拨号用户界面需要用户确认(Allows an application to call
any phone number, including emergency numbers, without going through the Dialer user interface for the user to
confirm the call being placed)
请求访问使用照相设备(Required to be able to access the camera device. )
允许一个程序是否改变一个组件或其他的启用或禁用(Allows an application to change whether an application
component (other than its own) is enabled or not. )
允许一个程序修改当前设置,如本地化(Allows an application to modify the current configuration, such as locale. )
允许程序改变网络连接状态(Allows applications to change network connectivity state)
允许程序改变Wi-Fi 连接状态(Allows applications to change Wi-Fi connectivity state)
允许一个程序清楚缓存从所有安装的程序在设备中(Allows an application to clear the caches of all installed
applications on the device. )
android.permission.CALL_PHONE
android.permission.CALL_PRIVILEGED
android.permission.CAMERA
android.permission.CHANGE_COMPONENT_ENABLED_STATE
android.permission.CHANGE_CONFIGURATION
android.permission.CHANGE_NETWORK_STATE
android.permission.CHANGE_WIFI_STATE
android.permission.CLEAR_APP_CACHE
-----------------------------------Android 编程基础
19
允许一个程序清除用户设置(Allows an application to clear user data)
允许启用禁止位置更新提示从无线模块(Allows enabling/disabling location update notifications from the radio. )
允许程序删除缓存文件(Allows an application to delete cache files)
允许一个程序删除包(Allows an application to delete packages)
允许访问底层电源管理(Allows low-level access to power management)
允许程序RW 诊断资源(Allows applications to RW to diagnostic resources. )
允许程序禁用键盘锁(Allows applications to disable the keyguard )
允许程序返回状态抓取信息从系统服务(Allows an application to retrieve state dump information from system
services.)
android.permission.CLEAR_APP_USER_DATA
android.permission.CONTROL_LOCATION_UPDATES
android.permission.DELETE_CACHE_FILES
android.permission.DELETE_PACKAGES
android.permission.DEVICE_POWER
android.permission.DIAGNOSTIC
android.permission.DISABLE_KEYGUARD
android.permission.DUMP
-----------------------------------Android 编程基础
20
允许一个程序扩展收缩在状态栏,android 开发网提示应该是一个类似Windows Mobile 中的托盘程序(Allows an
application to expand or collapse the status bar. )
作为一个工厂测试程序,运行在root 用户(Run as a manufacturer test application, running as the root user. )
访问闪光灯,android 开发网提示HTC Dream 不包含闪光灯(Allows access to the flashlight )
允许程序强行一个后退操作是否在顶层activities(Allows an application to force a BACK operation on whatever is
the top activity. )
暂时不了解这是做什么使用的,android 开发网分析可能是一个预留权限.
访问一个帐户列表在Accounts Service 中(Allows access to the list of accounts in the Accounts Service)
允许一个程序获取任何package 占用空间容量(Allows an application to find out the space used by any package. )
允许一个程序获取信息有关当前或最近运行的任务,一个缩略的任务状态,是否活动等等(Allows an
application to get information about the currently or recently running tasks: a thumbnail representation of the tasks,
what activities are running in it, etc.)
android.permission.EXPAND_STATUS_BAR
android.permission.FACTORY_TEST
android.permission.FLASHLIGHT
android.permission.FORCE_BACK
android.permission.FOTA_UPDATE
android.permission.GET_ACCOUNTS
android.permission.GET_PACKAGE_SIZE
android.permission.GET_TASKS
-----------------------------------Android 编程基础
21
允许访问硬件(Allows access to hardware peripherals. )
允许一个程序截获用户事件如按键、触摸、轨迹球等等到一个时间流,android 开发网提醒算是hook 技术吧
(Allows an application to inject user events (keys, touch, trackball) into the event stream and deliver them to ANY
window.)
允许一个程序安装packages(Allows an application to install packages. )
允许打开窗口使用系统用户界面(Allows an application to open windows that are for use by parts of the system
user interface. )
允许程序打开网络套接字(Allows applications to open network sockets)
允许程序管理(创建、催后、z- order 默认向z 轴推移)程序引用在窗口管理器中(Allows an application to manage
(create, destroy, Z-order) application tokens in the window manager. )
目前还没有明确的解释,android 开发网分析可能是清除一切数据,类似硬格机
允许程序修改全局音频设置(Allows an application to modify global audio settings)
android.permission.HARDWARE_TEST
android.permission.INJECT_EVENTS
android.permission.INSTALL_PACKAGES
android.permission.INTERNAL_SYSTEM_WINDOW
android.permission.INTERNET
android.permission.MANAGE_APP_TOKENS
android.permission.MASTER_CLEAR
android.permission.MODIFY_AUDIO_SETTINGS
-----------------------------------Android 编程基础
22
允许修改话机状态,如电源,人机接口等(Allows modification of the telephony state - power on, mmi, etc. )
允许挂载和反挂载文件系统可移动存储(Allows mounting and unmounting file systems for removable storage. )
允许一个程序设置他的activities 显示(Allow an application to make its activities persistent. )
允许程序监视、修改有关播出电话(Allows an application to monitor, modify, or abort outgoing calls)
允许程序读取用户日历数据(Allows an application to read the user's calendar data.)
允许程序读取用户联系人数据(Allows an application to read the user's contacts data.)
允许程序屏幕波或和更多常规的访问帧缓冲数据(Allows an application to take screen shots and more generally
get access to the frame buffer data)
允许程序返回当前按键状态(Allows an application to retrieve the current state of keys and switches. )
允许程序读取底层系统日志文件(Allows an application to read the low-level system log files. )
android.permission.MODIFY_PHONE_STATE
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
android.permission.PERSISTENT_ACTIVITY
android.permission.PROCESS_OUTGOING_CALLS
android.permission.READ_CALENDAR
android.permission.READ_CONTACTS
android.permission.READ_FRAME_BUFFER
android.permission.READ_INPUT_STATE
android.permission.READ_LOGS
-----------------------------------Android 编程基础
23
允许程序读取所有者数据(Allows an application to read the owner's data)
允许程序读取短信息(Allows an application to read SMS messages.)
允许程序读取同步设置(Allows applications to read the sync settings)
允许程序读取同步状态(Allows applications to read the sync stats)
请求能够重新启动设备(Required to be able to reboot the device. )
允许一个程序接收到ACTION_BOOT_COMPLETED 广播在系统完成启动(Allows an application to receive the
ACTION_BOOT_COMPLETED that is broadcast after the system finishes booting. )
允许一个程序监控将收到MMS 彩信,记录或处理(Allows an application to monitor incoming MMS messages, to
record or perform processing on them. )
允许程序监控一个将收到短信息,记录或处理(Allows an application to monitor incoming SMS messages, to
record or perform processing on them.)
android.permission.READ_OWNER_DATA
android.permission.READ_SMS
android.permission.READ_SYNC_SETTINGS
android.permission.READ_SYNC_STATS
android.permission.REBOOT
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.RECEIVE_MMS
android.permission.RECEIVE_SMS
-----------------------------------Android 编程基础
24
允许程序监控将收到WAP PUSH 信息(Allows an application to monitor incoming WAP push messages. )
允许程序录制音频(Allows an application to record audio)
允许程序改变Z 轴排列任务(Allows an application to change the Z-order of tasks)
允许程序重新启动其他程序(Allows an application to restart other applications)
允许程序发送SMS 短信(Allows an application to send SMS messages)
允许程序监控或控制activities 已经启动全局系统中Allows an application to watch and control how activities are
started globally in the system.
允许程序控制是否活动间接完成在处于后台时Allows an application to control whether activities are immediately
finished when put in the background.
修改全局信息比例(Modify the global animation scaling factor.)
android.permission.RECEIVE_WAP_PUSH
android.permission.RECORD_AUDIO
android.permission.REORDER_TASKS
android.permission.RESTART_PACKAGES
android.permission.SEND_SMS
android.permission.SET_ACTIVITY_WATCHER
android.permission.SET_ALWAYS_FINISH
android.permission.SET_ANIMATION_SCALE
-----------------------------------Android 编程基础
25
配置一个程序用于调试(Configure an application for debugging.)
允许底层访问设置屏幕方向和实际旋转(Allows low-level access to setting the orientation (actually rotation) of the
screen.)
允许一个程序修改列表参数
PackageManager.addPackageToPreferred() 和PackageManager.removePackageFromPreferred() 方法(Allows an
application to modify the list of preferred applications with the PackageManager.addPackageToPreferred()
and PackageManager.removePackageFromPreferred() methods.)
允许程序当前运行程序强行到前台(Allows an application to force any currently running process to be in the
foreground.)
允许设置最大的运行进程数量(Allows an application to set the maximum number of (not needed) application
processes that can be running. )
允许程序设置时间区域(Allows applications to set the system time zone)
允许程序设置壁纸(Allows applications to set the wallpaper )
android.permission.SET_DEBUG_APP
android.permission.SET_ORIENTATION
android.permission.SET_PREFERRED_APPLICATIONS
android.permission.SET_PROCESS_FOREGROUND
android.permission.SET_PROCESS_LIMIT
android.permission.SET_TIME_ZONE
android.permission.SET_WALLPAPER
-----------------------------------Android 编程基础
26
允许程序设置壁纸hits(Allows applications to set the wallpaper hints)
允许程序请求发送信号到所有显示的进程中(Allow an application to request that a signal be sent to all persistent
processes)
允许程序打开、关闭或禁用状态栏及图标Allows an application to open, close, or disable the status bar and its
icons.
允许一个程序访问订阅RSS Feed 内容提供(Allows an application to allow access the subscribed feeds
ContentProvider. )
系统暂时保留改设置,android 开发网认为未来版本会加入该功能。
允许一个程序打开窗口使用TYPE_SYSTEM_ALERT,显示在其他所有程序的顶层(Allows an application to
open windows using the type TYPE_SYSTEM_ALERT, shown on top of all other applications. )
允许访问振动设备(Allows access to the vibrator)
允许使用PowerManager 的WakeLocks 保持进程在休眠时从屏幕消失( Allows using PowerManager WakeLocks
to keep processor from sleeping or screen from dimming)
android.permission.SET_WALLPAPER_HINTS
android.permission.SIGNAL_PERSISTENT_PROCESSES
android.permission.STATUS_BAR
android.permission.SUBSCRIBED_FEEDS_READ
android.permission.SUBSCRIBED_FEEDS_WRITE
android.permission.SYSTEM_ALERT_WINDOW
android.permission.VIBRATE
android.permission.WAKE_LOCK
-----------------------------------Android 编程基础
27
允许程序写入API 设置(Allows applications to write the apn settings)
允许一个程序写入但不读取用户日历数据(Allows an application to write (but not read) the user's calendar data. )
允许程序写入但不读取用户联系人数据(Allows an application to write (but not read) the user's contacts data. )
允许程序修改Google 服务地图(Allows an application to modify the Google service map. )
允许一个程序写入但不读取所有者数据(Allows an application to write (but not read) the owner's data.)
允许程序读取或写入系统设置(Allows an application to read or write the system settings. )
允许程序写短信(Allows an application to write SMS messages)
允许程序写入同步设置(Allows applications to write the sync settings)
android.permission.WRITE_APN_SETTINGS
android.permission.WRITE_CALENDAR
android.permission.WRITE_CONTACTS
android.permission.WRITE_GSERVICES
android.permission.WRITE_OWNER_DATA
android.permission.WRITE_SETTINGS
android.permission.WRITE_SMS
android.permission.WRITE_SYNC_SETTINGS
-----------------------------------Android 编程基础
28
Android SDK1.5新视角
用户界面的改进
Android SDK1.5 的UI 做了很多细节的改进,Google 微调了所有核心UI 组件的样式,使其更加美观,并且对
包括Browser,Gmail,Email,Calendar,Camera&Gallery 以及Contacts 等在内的自带程序界面都作了优化。
让我们来看一个例子,这是新建联系人的界面,左侧是来自Android 1.1 的截图,右侧是来自1.5 的截图(此
图来自Google Android 官方Blog)。我们可以看到下拉选择框和按钮的样式发生了不小的变化,而且添加联
系人详情的方式也更加简便了,1.1 中的More Info 按钮不见了,取而代之的是每一个项目后面的添加和删除
按钮。有兴趣的朋友可以打开1.1 和1.5 的模拟器来比较一下两者在操作上的差异。
-----------------------------------Android 编程基础
29
全新的视屏录制功能
上传视频到Youtube,上传照片到Picasa
Android 1.5 中,用户可以利用内置的摄像头来拍摄视频,并且立即上传到Youtube 与朋友分享(尽管目前看
来G1 的3M 摄像头效果不太理想,希望G2 的5M 摄像头效果会好一些)。同样,用户所拍的照片也将可以
方便的上传到Picasa 相册。
当用户完成拍摄/拍照后,只需按一下“Share”按钮,Android 便会让你选择Share 的方式,只要选择
Youtube/Picasa,然后输入你的账户信息,就可以开始上传了。
软键盘的支持
G1 带有一个QWERTY 物理键盘,而G2 将取消全键盘而改用全触摸的设计,所以软键盘也是Android 1.5 中
一个非常重要的特性。下面我们来看一张Android 1.5 软键盘的截图吧,键盘的布局还是标准的QWERTY,
有一个Shift 键以及输入模式切换键,进入数字模式以后,可以输入数字以及+-*/?!等常用符号,按ALT 就可
以输入一些不太常用的符号。
-----------------------------------Android 编程基础
30
中文显示和中文输入的支持
Android 1.1 除了英语以外,只能支持德语,而Android 1.5 的国际化有了更进一步的发展,支持了包括简体/
繁体中文、日语、朝鲜语、西班牙语、法语、意大利语、荷兰语、波兰语、俄语在内的各国语言(大概主要
语种就差葡萄牙语了吧,Correct me if I’m wrong :))。当然我最关心的就是对于中文显示和输入的支持了。
启动模拟器,载入1.5 的Image 后,默认语言依旧是英语,当我在Settings–>Locale & text 中把Locale 改成
Chinese(China)之后,界面语言就切换到中文了。
不过这时候,Google 拼音输入法却并不工作,我们调出软键盘以后还是看不到切换到中文的按键,尽管在
Locale & text 设置中,它是被选中的。我们需要反选“Android 键盘”这一选项,然后退出设置菜单,这时Google
拼音输入法就可以工作了。
关于输入的另一个值得注意的特性是,得益于IMF 我们可以安装第3 方的输入法来取代Google 拼音,也许
不久以后就会有Android 版的搜狗拼音、五笔加加。
-----------------------------------Android 编程基础
31
桌面Widgets和Live folders
首先,相对于Android1.1 来说,自带的桌面Widge 增加了Calendar 和Music player,Music player widget 的样
式看起来还不错。
至于Live folder,自带的包括列出所有联系人,列出所有有电话号码的联系人,以及列出Starred 联系人,因
为缺少可定制性,这个功能现在看来似乎并不怎么吸引人。不过新增的Home screen widgets API 和Live folders
API 使得开发者可以编写各种新奇的Widget 和Live Folder 来丰富Android 的应用。
蓝牙功能改进
Android 1.5 的蓝牙增加了A2DP(Advanced Audio Distribution Profile)和AVRCP(Audio Video Remote Cortrol
Profile)的支持,立体声显著提升了通过蓝牙听音乐的用户体验,AVRCP 则允许用户通过蓝牙进行包括暂停、
停止、启动重放、音量控制及其它类型的远程控制操作。另外,Auto-pairing 则使耳机与手机连接更加快捷方
便。
-----------------------------------Android 编程基础
32
捆绑应用功能改进
Android 1.5 内置的Chrome lite 浏览器采用了最新的Webkit 引擎和Squirrelfish Javascript 引擎,并且开始支持
网页内容复制和页内搜索功能,窗口下方的Zoom In/Out 菜单也有变化,同时用户可以指定网页默认编码。
我比较感兴趣的就是网页内容复制和页内搜索了,看一下截图吧。
Gtalk、Contacts、SMS、MMS、Gmail 和Email 程序直接的集成也更加紧密,使得用户可以在Contacts、SMS、
MMS、Gmail 和Email 中查看Gtalk 联系人的状态等
Gmail 客户端软件中,批量的存档、删除、加Label 操作也已经得到支持。
另外,Android 1.5 还对SD 卡的管理做了改进,增加了文件系统检查和自动修复功能。
系统性能优化
除了上面提到的新功能,Android 1.5 还有不少性能上的改进
包括:
.. * 更快的摄像头启动和拍摄速度
.. * 更快地获取GPS 位置
.. * 浏览器中更平滑的滚屏
.. * Gmail 中更快的对话列表滚屏等
-----------------------------------Android 编程基础
33
Android图书大全
Android 中文教程图书
Google Android 开发入门与实战
-----------------------------------Android 编程基础
34
Google Android SDK 开发范例大全/ 佘志龙
-----------------------------------Android 编程基础
35
Google Android 程式设计与应用/ 杨文志
Google!Android 手机应用程式设计入门/ 盖索林
-----------------------------------Android 编程基础
36
Android 应用框架原理与程式设计36 技/ 高焕堂
-----------------------------------Android 编程基础
37
Google Android 设计招式之美/ 高焕堂
-----------------------------------Android 编程基础
38
Android 应用软体架构设计/ 高焕堂
-----------------------------------Android 编程基础
39
Android 与物件导向技术/ 高焕堂
-----------------------------------Android 编程基础
40
Android外文书籍
-----------------------------------Android 编程基础
41
Android 网站资源收集大全
eoeAndroid 国内一流的Android开发社区
http://www.eoeandroid.com/?fromuid=3245
eoeMobile 国内一流的Android开发团队
http://www.eoemobile.com/index
Android 爱好者论坛
http://www.loveandroid.com/
Android 开发者论坛
http://www.androidin.com/
google 主站:
http://code.google.com/android/
E 文文档
http://code.google.com/android/documentation.html
Android 中国开发者团队google groups
http://groups.google.com/group/android-developers-zh
中文社区
http://www.androidcn.net
http://www.androidcn.net/wiki
-----------------------------------Android 编程基础
42
google groups
http://groups.google.com/group/android-developers
Other Open HandsetAlliance Project
http://code.google.com/p/android/downloads/list
OHA:开放手持设备联盟官方网站
http://www.openhandsetalliance.com/
GPhone 论坛
http://bbs.gphone999.com/
Linux 基金会
http://www.linux-foundation.org/
MobileLinux
http://www.linux-foundation.org/en/Mobile_Linux
OMA: 开放移动联盟
http://www.linux-foundation.org/
LiPS Forum
http://www.lipsforum.org/
CE Linux Forum
http://tree.celinuxforum.org/
-----------------------------------Android 编程基础
43
GnomeMobile andEmbedded (GMAE)
http://www.gnome.org/mobile/
LiMo Foundation
https://www.limofoundation.org/sf/sfmain/do/home
UbuntuMobile
https://lists.ubuntu.com/archive ... 007-May/000289.html
Mobile& Internet Linux Project
http://www.moblin.org/
国外网站
http://www.androidboards.com/
http://www.androidev.com/
http://androidcommunity.com/
http://anddev.org/
AndroidWiki -Main Page
http://androidwiki.com/wiki/Main_Page
Official GoogleAndroidDevelopers Blog
http://android-developers.blogspot.com/
Open HandsetMagazine
http://openhandsetmagazine.com/
GoogleAndroid Platform- TheAndroidLog
http://theandroidlog.com/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
资源包主要包含以下内容: ASP项目源码:每个资源包中都包含完整的ASP项目源码,这些源码采用了经典的ASP技术开发,结构清晰、注释详细,帮助用户轻松理解整个项目的逻辑和实现方式。通过这些源码,用户可以学习到ASP的基本语法、服务器端脚本编写方法、数据库操作、用户权限管理等关键技术。 数据库设计文件:为了方便用户更好地理解系统的后台逻辑,每个项目中都附带了完整的数据库设计文件。这些文件通常包括数据库结构图、数据表设计文档,以及示例数据SQL脚本。用户可以通过这些文件快速搭建项目所需的数据库环境,并了解各个数据表之间的关系和作用。 详细的开发文档:每个资源包都附有详细的开发文档,文档内容包括项目背景介绍、功能模块说明、系统流程图、用户界面设计以及关键代码解析等。这些文档为用户提供了深入的学习材料,使得即便是从零开始的开发者也能逐步掌握项目开发的全过程。 项目演示与使用指南:为帮助用户更好地理解和使用这些ASP项目,每个资源包中都包含项目的演示文件和使用指南。演示文件通常以视频或图文形式展示项目的主要功能和操作流程,使用指南则详细说明了如何配置开发环境、部署项目以及常见问题的解决方法。 毕业设计参考:对于正在准备毕业设计的学生来说,这些资源包是绝佳的参考材料。每个项目不仅功能完善、结构清晰,还符合常见的毕业设计要求和标准。通过这些项目,学生可以学习到如何从零开始构建一个完整的Web系统,并积累丰富的项目经验。
资源包主要包含以下内容: ASP项目源码:每个资源包中都包含完整的ASP项目源码,这些源码采用了经典的ASP技术开发,结构清晰、注释详细,帮助用户轻松理解整个项目的逻辑和实现方式。通过这些源码,用户可以学习到ASP的基本语法、服务器端脚本编写方法、数据库操作、用户权限管理等关键技术。 数据库设计文件:为了方便用户更好地理解系统的后台逻辑,每个项目中都附带了完整的数据库设计文件。这些文件通常包括数据库结构图、数据表设计文档,以及示例数据SQL脚本。用户可以通过这些文件快速搭建项目所需的数据库环境,并了解各个数据表之间的关系和作用。 详细的开发文档:每个资源包都附有详细的开发文档,文档内容包括项目背景介绍、功能模块说明、系统流程图、用户界面设计以及关键代码解析等。这些文档为用户提供了深入的学习材料,使得即便是从零开始的开发者也能逐步掌握项目开发的全过程。 项目演示与使用指南:为帮助用户更好地理解和使用这些ASP项目,每个资源包中都包含项目的演示文件和使用指南。演示文件通常以视频或图文形式展示项目的主要功能和操作流程,使用指南则详细说明了如何配置开发环境、部署项目以及常见问题的解决方法。 毕业设计参考:对于正在准备毕业设计的学生来说,这些资源包是绝佳的参考材料。每个项目不仅功能完善、结构清晰,还符合常见的毕业设计要求和标准。通过这些项目,学生可以学习到如何从零开始构建一个完整的Web系统,并积累丰富的项目经验。
08-10
资源包主要包含以下内容: ASP项目源码:每个资源包中都包含完整的ASP项目源码,这些源码采用了经典的ASP技术开发,结构清晰、注释详细,帮助用户轻松理解整个项目的逻辑和实现方式。通过这些源码,用户可以学习到ASP的基本语法、服务器端脚本编写方法、数据库操作、用户权限管理等关键技术。 数据库设计文件:为了方便用户更好地理解系统的后台逻辑,每个项目中都附带了完整的数据库设计文件。这些文件通常包括数据库结构图、数据表设计文档,以及示例数据SQL脚本。用户可以通过这些文件快速搭建项目所需的数据库环境,并了解各个数据表之间的关系和作用。 详细的开发文档:每个资源包都附有详细的开发文档,文档内容包括项目背景介绍、功能模块说明、系统流程图、用户界面设计以及关键代码解析等。这些文档为用户提供了深入的学习材料,使得即便是从零开始的开发者也能逐步掌握项目开发的全过程。 项目演示与使用指南:为帮助用户更好地理解和使用这些ASP项目,每个资源包中都包含项目的演示文件和使用指南。演示文件通常以视频或图文形式展示项目的主要功能和操作流程,使用指南则详细说明了如何配置开发环境、部署项目以及常见问题的解决方法。 毕业设计参考:对于正在准备毕业设计的学生来说,这些资源包是绝佳的参考材料。每个项目不仅功能完善、结构清晰,还符合常见的毕业设计要求和标准。通过这些项目,学生可以学习到如何从零开始构建一个完整的Web系统,并积累丰富的项目经验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值