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 更多精彩请直接 ...
随机推荐
- java设计模式之装饰模式
发现设计模式的学习越来越让自己学习的东西太少了,应该多接触一些东西,多出去走一走. 装饰模式概念: 动态地给一个对象添加一些额外的职责,就增加功能来说,装饰模式比生成子类更为灵活(大话设计模式) 在不 ...
- TopCoder SRM 639 Div.2 500 AliceGameEasy --乱搞
题意: 一个游戏有n轮,有A和B比赛,谁在第 i 轮得胜,就获得 i 分,给出x,y,问A得x分,B得y分有没有可能,如果有,输出A最少赢的盘数. 解法: 这题是我傻逼了,处理上各种不优越,要使n*( ...
- sql执行效率,explain 查询执行效率
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索 ...
- [No00003C]操作系统Operating Systems进程同步与信号量Processes Synchronization and Semaphore
操作系统Operating Systems进程同步与信号量Processes Synchronization and Semaphore 进程合作:多进程共同完成一个任务 从纸上到实际:生产者− − ...
- luogu[2093]零件分组
题目描述 某工厂生产一批棍状零件,每个零件都有一定的长度(Li)和重量(Wi).现在为了加工需要,要将它们分成若干组,使每一组的零件都能排成一个长度和重量都不下降(若i<j,则Li<=Lj ...
- poj 2186 Popular Cows
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 29908 Accepted: 12131 De ...
- java代码封装与编译
代码封装: 在这个java程序内调用另一个类 在arrayTool中把这两个函数封装起来. 编译顺序:(由下文可知应该是先进行语法检查再进行编译) 先编译ArrayTool再编译ArrayOperat ...
- 作业——FoodTracker程序
作业及学习地址:https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSw ...
- 一种Docker image镜像的取代方案
在http://openvz.org/Download/templates/precreated中有很多压缩的镜像文件,可以将这些文件下载后采用import方式使用镜像,也可以采用我原来的博文:doc ...
- Integer.parseInt(String s) 和 Integer.valueOf(String s) 的区别
通过查看java.lang.Integer的源码可以发现, 它们最终调用的都是 /** * Parses the string argument as a signed integer in the ...