1.LogCat视图可以查看报错日志;可以点击“+”,即log filter过滤;
2.android项目打包apk,项目右键-->Export-->create keystore
3.FileExplorer可浏览手机文件目录
4.android View 可视控件的继承关系:(来源:http://blog.csdn.net/zqiang_55/article/details/7051282)
5.
6.调用android已有的activity功能:
(需查看已有功能的源码中的功能清单文件:AndroidManifest.xml)
Intent intent = new Intent();
intent.setAction("xxxaction");
intent.addCategory("xxx");
intent.setData("xxx");
startActivity(intent);
7.android项目目录说明:
gen/R.java-->开发工具自动生成的,生成各种资源的id,R.java是定义该项目所拥有资源的索引文件。
assets/-->此目录放私有文件,不能通过R.java访问,只能通过文件目录访问,R.java不生成相应的资源id;
res/-->存放图片、文字
res/drawable-hdpi-->高分辨率的图片
res/drawable-ldpi-->低分辨率的图片
res/drawable-mdpi-->中分辨率的图片
res/layout/main.xml-->界面
res/values/strings.xml-->文字、颜色、尺寸、字符串
res/AndroidManifest.xml-->功能清单,当你新增一个页面行为类别(Activity)时,你也需要先在此注册这个新增的Activity类别后,才能顺利调用。
res/default.properties-->eclipse使用的,列出android版本
8.TextView<==>Label
EditText<==>Input
9.Activity类中常用:
this.findViewById(R.id.idName);
button.onclickListener(new ButtonClickListener(){
public void onclick(View v){
.....
}
});
10.发送短信:
SmsManager manager = SmsManager.getDefault();
manager.setndTextMessage(number,null,content,null,null);
11.三种通知:
1)Toast:
Creating an AlertDialog
Context context = getApplicationContext();
CharSequence text = "Hello toast!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
2)
Status Bar Notifications
3)
Creating an AlertDialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Are you sure you want to exit?")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
MyActivity.this.finish();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
Creating a ProgressDialog
ProgressDialog dialog = ProgressDialog.show(MyActivity.this, "",
"Loading. Please wait...", true);
DatePickerDialog
A dialog that allows the user to select a date. See the
Hello DatePickertutorial.
TimePickerDialog
A dialog that allows the user to select a time. See the
Hello TimePickertutorial.12.