android基础

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 DatePicker tutorial.
TimePickerDialog
A dialog that allows the user to select a time. See the  Hello TimePicker tutorial.12.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值