自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

joke张林的博客

让代码疯狂起来

  • 博客(30)
  • 收藏
  • 关注

原创 Android intent跳转另一个应用

1、//跳转至另一个应用的主入口Activity(根据包名自动识别主入口)Intent intent = context.getPackageManager().getLaunchIntentForPackage("程序包名");context.startActivity(intent);2、指定主Activity跳转Intent intent=new Intent(Intent.ACTION_MAIN);intent.addCategory(Intent.CATEGORY_LAUNCHER.

2021-06-28 18:07:29 1177 2

翻译 Android 多线程管理,handler机制

转发:https://blog.csdn.net/qq_41648631/article/details/103045252

2021-05-12 17:37:21 95

原创 android 获取当前应用的路径下的指定文件

例:我当前xml文件内容:123456//this.getFilesDir() + File.separator得到当前目录,+指定文件名,支持xml、ini、txt等File file = new File(this.getFilesDir() + File.separator + "aaa.xml"); if (!file.exists() || file.length()== 0) { Log.d("zl","文件空"); .

2020-08-18 15:12:43 1285

转载 介绍主密钥,传输秘钥,工作秘钥

近期在从事Pos应用的开发,由于之前未接触过相关开发,所以很多概念性的东西不是很明白,因此做下总结记录供以后查阅,参考了其他人的博客。链接在博客底部。目前来说主要接触密钥的分别时:工作密钥 主密钥 传输密钥1.工作密钥工作秘钥也称为数据密钥,包含PIN秘钥,MAC秘钥以及磁道秘钥(TDK)。在POS每次做签到交易时,由POS中心下发给POS。需要经常性地定期更换,通常每天更换一次。在联机更新的报文中对工作密钥必须用TMK(主密钥)加密,形成密文后进行传输。2.主密钥主秘钥,即(Terminal

2020-07-13 09:30:26 7478

原创 TimePickerView时间选择器,选择近两个月的日期

private void initTimePicker1() {//选择出生年月日 //控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释) //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 Date curDate = new Date...

2019-10-29 10:51:20 696

翻译 CheckBoxPreference组件 自动存储到sharedpreferences

CheckBoxPreference 选中为true 取消选中为false 它的值会以boolean的形式以key值储存在SharedPreferences中。<?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/...

2018-09-12 14:28:01 532

原创 升Android Studio3.0让人懵逼的错误:Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2...

解决方式一:只需在工程的gradle.properties文件中添加以下命令:android.enableAapt2=false 然后再:sync Now 就解决了

2018-05-08 16:02:09 170

转载 Indexblelistview中文版,实现汉字首字母索引

http://blog.csdn.net/ithouse/article/details/49665265

2018-03-13 10:06:59 266

原创 Error: Activity class MainActivity does not exist

Error: Activity class MainActivity  does not exist解决方法:1、studio中选择build-CleanProject,                  2、重启机器/模拟器;                  3、运行程序

2018-02-28 09:44:11 1900

原创 studio签名

一:在有生成过的Key文件情况下:第一步我们打开我们下载安装好的Android Studio2然后我们选择好了我们的要发布的项目选择Build3然后选择Generate Signed APK4然后可以选择创建或者选择一个已有的key,我这里选择以前

2018-01-04 14:33:26 203

原创 android 异步 post请求 与 同步post请求

本文是将 通过AES加密后的数据   上传至后台      请求下来的数据经过 AES解密    :  AES解密内容   详见  http://blog.csdn.net/zl406707/article/details/77369310使用过AsyncTask 的同学都知道一个异步加载数据最少要重写以下这两个方法:doInBackground(Params…) 后台执行

2017-08-22 17:42:28 1825

原创 报错 :Android Studio 出现 Gradle's dependency cache may be corrupt 错误分析

这是因为gradle版本的问题     有的时候studio会提示去修改     但有时就悲催了;解决办法:1、更改gradle版本为 自己不报错项目的gradle版本 2、更改项目最外层  build.gradle:3、更改内层 build.gradle然后编译一下      完美解决;

2017-08-21 15:27:07 253

原创 android 使用Aes加密数据

使用AES加密   本文使用  "AES/CBC/PKCS5Padding"      CBC模式需用到两个公钥 加解密 工具类:public class AES128utils { // public static final String AES128_KEY="kabuke1yc1881cn1"; /** * 加密

2017-08-18 14:32:24 318

转载 android 获取系统日期 时间

//获取日期 年 月 日SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");String datedate = sdf.format(new Date());//获取时间 时 分 秒SimpleDateFormat sdfsdf=new SimpleDateFormat("HH:mm:ss"

2017-08-18 14:12:40 380

原创 android ComponentName的使用 之app交互

若有用请点个赞 经博主验证过

2017-08-18 10:19:13 402

原创 ListView适配器

//继承baseadapterpublic class Myadapter extends BaseAdapter {//上下文及传过来的值 private Context context; private List list;//set get方法 public Myadapter(Context context, List list) { this.

2017-02-14 21:19:08 165

转载 xml解析 pull

//xml解析                         XmlPullParserFactory factory;                                                    try {                                factory = XmlPullParserFactory.newInstance

2016-09-27 12:47:52 190

原创 图片无限轮播

//地址String [] paths={"http://img1.3lian.com/2015/w7/98/d/22.jpg",        "http://img1.3lian.com/2015/w7/98/d/1.jpg",        "http://img1.3lian.com/2015/w7/98/d/2.jpg",        "http://img1.3l

2016-08-26 11:08:45 224

转载 xlistview配置文件 xml中内容 名:xlistview_header

http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="wrap_content"    android:gravity="bottom" >            android:id="@+id/xlis

2016-08-14 21:04:19 220

转载 XListView配置文件 xml中内容 名:xlistview_footer

http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="wrap_content" >            android:id="@+id/xlistview_footer_content"       

2016-08-14 21:01:33 255

转载 XListView 配置文件 需导入项目 类名:XListViewHeader

package org.com.cctest.view;/** * @file XListViewHeader.java * @create Apr 18, 2012 5:22:27 PM * @author Maxwin * @description XListView's header */import com.example.xlistviewtest

2016-08-14 20:54:41 538

转载 XListView 配置文件 需导入项目 类名:XListViewFooter

/** * @file XFooterView.java * @create Mar 31, 2012 9:33:43 PM * @author Maxwin * @description XListView's footer */package org.com.cctest.view;import com.example.xlistviewtest.R

2016-08-14 20:53:44 222

转载 XListView 配置文件 需导入项目 类名:XListView

/** * @file XListView.java * @package me.maxwin.view * @create Mar 18, 2012 6:28:41 PM * @author Maxwin * @description An ListView support (a) Pull down to refresh, (b) Pull up to load m

2016-08-14 20:52:33 517

转载 侧拉SlidingMenu

  Fragnent2Activity fragment2 = new Fragnent2Activity();  getSupportFragmentManager().beginTransaction()    .add(R.id.FragMent, fragment2).commit();  // 创建左侧SlidingMenu菜单  SlidingMenu le

2016-08-14 20:15:47 258

转载 XListView

public class MainActivity extends Activity { private List list; int j; private ArrayAdapter arrayAdapter; @Override protected void onCreate(Bundle savedInstanceState) {  super.onCreate

2016-08-14 20:09:55 232

转载 弹出框

 //  普通弹出框    AlertDialog.Builder dialog=new Builder(MainActivity.this);                dialog.setMessage(“  ”);    dialog.setPositiveButton("确定", new DialogInterface.OnClickListener()

2016-08-08 15:58:04 144

转载 注解

//json串中a就是1  b就是2......@SerializedName("1") public A a; @SerializedName("2") public B b; @SerializedName("3") public C c; @SerializedName("4") public D d; @SerializedName("5")

2016-08-07 20:19:10 127

翻译 viewpager导航图片

ViewPager vp = (ViewPager) findViewById(R.id.vp);  findView();  vp.setAdapter(new MyAdapter(MainActivity.this, list)); } private void findView() {  View view1 = View.inflate(this, R.layo

2016-08-07 20:18:05 173

翻译 httpURLConnection获得网络数据解析json串

new Thread() {   public void run() {    getData();   };  }.start(); } /**  * 获取网络数据  */ private void getData() {  // 要访问的服务器地址  String path = "http://172.20.81.59:8080/bwie/j

2016-08-07 20:16:58 586 3

转载 Get网络请求解析json串

// /得到HttpClient对象  HttpClient httpClient = new DefaultHttpClient();  // 得到连接方式对象,设置请求路径  HttpGet httpGet = new HttpGet(path);  try {   // GET方式请求接口,得到响应内容   HttpResponse httpResponse

2016-08-07 20:14:51 576 6

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除