android部分开发摘要
Async 异步 不会阻塞当前线程
sync 同步
数据库是应用软件|结构化数据存储 JDBC SQL
ellipsis 省略
content provider URI
thread--looper--messageQueue--多个message
反编译 classes.dex --> jar(dex2jar)-->jd-gui
|--List:元素是有序的(怎么存的就怎么取出来,顺序不会乱),元素可以重复(角标1上有个3,角标2上也可以有个3)因为该集合体系有索引,
|-- ArrayList:底层的数据结构使用的是数组结构(数组长度是可变的百分之五十延长)(特点是查询很快,但增删较慢)线程不同步
|-- LinkedList:底层的数据结构是链表结构(特点是查询较慢,增删较快)
|-- Vector:底层是数组数据结构 线程同步(数组长度是可变的百分之百延长)(无论查询还是增删都很慢,被ArrayList替代了)
mywebview.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
return true;
}
});
设置全屏
1. 方法1:AndroidManifest.xml 里,Activity的 android:theme 指定为" @android :style/Theme.NoTitleBar.Fullscreen"
示例:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme=" @android :style/Theme.NoTitleBar.Fullscreen">
<activity
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
2. 方法2: 在onCreate()里指定No title
要加入:
/*set it to be no title*/
requestWindowFeature(Window.FEATURE_NO_TITLE);
/*set it to be full screen*/
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
示例:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/*set it to be no title*/
requestWindowFeature(Window.FEATURE_NO_TITLE);
/*set it to be full screen*/
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
//文件写入模块
FileOutputStream fos=null;
try {
fos = openFileOutput("notice_list",MODE_PRIVATE);
fos.write(data.getBytes());
} catch (FileNotFoundException e) {
// TODO: handle exception
e.printStackTrace();
} catch (IOException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
finally{
if(fos != null){
try {
fos.close();
} catch (IOException e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
//文件读取模块
FileInputStream fis=null;
byte[] buffer = null;
try {
fis=openFileInput("notice_list");
buffer = new byte[fis.available()];
fis.read(buffer);
} catch (FileNotFoundException e) {
// TODO: handle exception
e.printStackTrace();
}catch (IOException e) {
// TODO: handle exception
e.printStackTrace();
}finally{
if(fis!=null)
try {
fis.close();
} catch (IOException e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
String datas = new String(buffer);
android:layout_gravity="bottom" 底部对齐
设置权重
android:layout_width="0dp"
android:layout_weight="1"
[java] view plaincopy在CODE上查看代码片派生到我的代码片
//分享文字
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "要分享的文本。");
intent.setType("text/plain");
startActivity(Intent.createChooser(intent, "分享"));
[java] view plaincopy在CODE上查看代码片派生到我的代码片
//分享图片
Uri uri = Uri.fromFile(new File("/storage/emulated/0/DCIM/Camera/img.jpg"));
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_STREAM, uri);
intent.setType("image/jpeg");
startActivity(Intent.createChooser(intent, "分享"));
[java] view plaincopy在CODE上查看代码片派生到我的代码片
//分享一系列图片
ArrayList<Uri> uris = new ArrayList<>();
uris.add(Uri.fromFile(new File("/storage/emulated/0/DCIM/Camera/img.jpg")));
uris.add(Uri.fromFile(new File("/storage/emulated/0/DCIM/Camera/aaa.jpeg")));
Intent intent = new Intent(Intent.ACTION_SEND_MULTIPLE);
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
intent.setType("image/*");
startActivity(Intent.createChooser(intent, "分享"));
设置actionbar背景
this.getActionBar().setBackgroundDrawable((getResources().getDrawable(R.drawable.action_back)));
this.getActionBar().setDisplayShowCustomEnabled(true);
this.getActionBar().setCustomView(R.layout.action_custom);
this.getActionBar().setDisplayShowHomeEnabled(false);
让textView里面的内容水平居中,还是让textView控件在它的父布局里水平居中呢?
1. 让textView里面的内容水平居中 : android:gravity="center_horizontal"
2. 让textView控件在它的父布局里水平居中 android:layout_gravity="center_horizontal"
BaseAdapter是一个抽象类,继承它需要实现较多的方法,所以也就具有较高的灵活性;
ArrayAdapter支持泛型操作,最为简单,只能展示一行字。
SimpleAdapter有最好的扩充性,可以自定义出各种效果。
SimpleCursorAdapter可以适用于简单的纯文字型ListView,它需要Cursor的字段和UI的id对应起来。如需要实现更复杂的UI也可以重写其他方法。可以认为是SimpleAdapter对数据库的简单结合,可以方便地把数据库的内容以列表的形式展示出来。
tabhost
layoutParam实例化布局后 可以对组件编辑 设置布局文件
设置intent新界面
android部分开发摘要的更多相关文章
- Android安全开发之通用签名风险
Android安全开发之通用签名风险 作者:伊樵.舟海.呆狐@阿里聚安全 1 通用签名风险简介 1.1 Android应用签名机制 阿里聚安全漏洞扫描器有一项检测服务是检测APP的通用签名风险.And ...
- Android应用开发-小巫CSDN博客clientJsoup篇
Android应用开发-小巫CSDN博客clientJsoup篇 距上一篇博客已经过去了两个星期,小巫也认为很抱歉,由于在忙着做另外一个项目,差点儿抽不出空来,这不小巫会把剩下的博文全部在国庆补上.本 ...
- Android应用开发-小巫CSDN博客client之显示博文具体内容
Android应用开发-小巫CSDN博客客户端之显示博文具体内容 上篇博文给大家介绍的是怎样嵌入有米广告而且获取收益,本篇博客打算讲讲关于怎样在一个ListView里显示博文的具体信息.这个可能是童鞋 ...
- Android N开发 你需要知道的一切
title: Android N开发 你需要知道的一切 tags: Android N,Android7.0,Android --- 转载请注明出处:http://www.cnblogs.com/yi ...
- Android游戏开发实践(1)之NDK与JNI开发03
Android游戏开发实践(1)之NDK与JNI开发03 前面已经分享了两篇有关Android平台NDK与JNI开发相关的内容.以下列举前面两篇的链接地址,感兴趣的可以再回顾下.那么,这篇继续这个小专 ...
- Android游戏开发实践(1)之NDK与JNI开发01
Android游戏开发实践(1)之NDK与JNI开发01 NDK是Native Developement Kit的缩写,顾名思义,NDK是Google提供的一套原生Java代码与本地C/C++代码&q ...
- Android游戏开发实践(1)之NDK与JNI开发02
Android游戏开发实践(1)之NDK与JNI开发02 承接上篇Android游戏开发实践(1)之NDK与JNI开发01分享完JNI的基础和简要开发流程之后,再来分享下在Android环境下的JNI ...
- 【转】Android 底层开发的几点
我干了3年Android sdk开发,觉得到了瓶劲没法更进一步,于是花了一年多点时间,大概摸到点门径.根据前辈的经验,Android底层完全入门需要两年. 先说下我的入门过程:第零步,下载源码,我下的 ...
- 《Android NFC 开发实战详解 》简介+源码+样章+勘误ING
<Android NFC 开发实战详解>简介+源码+样章+勘误ING SkySeraph Mar. 14th 2014 Email:skyseraph00@163.com 更多精彩请直接 ...
随机推荐
- (一)半小时开发一个APP
[前言] HPP是什么? HybirdApp的简称,详细介绍参见:HPP--让所有中小企业拥有自己的APP 说白了就是用html+css+js开发app,包括ios和android版本. HBuild ...
- 理解 OpenStack + Ceph (4):Ceph 的基础数据结构 [Pool, Image, Snapshot, Clone]
本系列文章会深入研究 Ceph 以及 Ceph 和 OpenStack 的集成: (1)安装和部署 (2)Ceph RBD 接口和工具 (3)Ceph 物理和逻辑结构 (4)Ceph 的基础数据结构 ...
- ComboBox的联动
窗体搭建: 实现功能: 加载年级下拉框 选中年级时加载出科目下拉框 加载年级下拉框: 第一步,在DAL层中写一个方法,检索所有的年级名称集合,返回的是泛型集合List<> public L ...
- 如何查看文件是dos格式还是unix格式的?
一.背景 由于windows和linux对换行的标识不一样,不同系统的代码传递导致代码格式的改变中可能会带来程序无法正常编译通过的问题.因此根据一些编译的错误提示,可以定位到是文件格式的问题,要对程序 ...
- sublime安装package control组件
第一步,首先到这个网站https://packagecontrol.io/installation去下载Package Control.sublime-package文件 第二步,将下载的文件放到C: ...
- jquery插件集
自定义滚动条jquery-custom-scrollbar 放大镜 fancybox,lightbox,jquery zoom
- grunt-contrib-uglify压缩插件的常用配置属性
mangle:false(不混淆变量名和方法名,保留原有的名字),如果不配置,默认混淆,就是将所有方法名和变量都用a,b,c等字母替换 preserveComments : 'all'(不删除注释,还 ...
- Debian 8(Jessie) 安装pptp-linux (PPTP客户端), 以及route命令说明
命令, 这里定义这个pptp的连接名称为hcoffice #安装 sudo apt-get install pptp-linux #用户名和口令 sudo vim /etc/ppp/chap-secr ...
- usb驱动开发12之设备生命线
函数usb_control_msg完成一些初始化后调用了usb_internal_control_msg之后就free urb.剩下的活,全部留给usb_internal_control_msg去做了 ...
- Android开篇(转)
转自:http://gityuan.com/android/ 一.简述 Android系统非常庞大.错中复杂,其底层是采用Linux作为基底,上层采用包含虚拟机的Java层以及Native层,通过系统 ...