android基础
来源:互联网 发布:java手机游戏编程 编辑:程序博客网 时间:2024/05/18 07:09
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
TimePickerDialog
- android基础--activity基础
- 【Android基础】AsyncTask基础
- Android基础
- android基础
- Android基础
- Android基础
- android 基础
- android基础
- android基础
- android基础
- android基础
- android基础
- android基础
- android基础
- android基础
- android基础
- Android基础
- android 基础
- 黑马程序员------------------类加载器
- S4加入T9检索
- 小强的HTML5移动开发之路(14)——Video标签详解
- C# 学习教程之一
- Citrix - XenDesktop相关
- android基础
- LeetCode - Single Number
- CSS实现居中代码
- 从skyeye学习arm( u-boot篇)
- 黑马程序员_Java语言基础
- Android游戏开发(一)
- 2014年 写给自己
- CentOS下的几个非官方软件仓储
- 快速排序