随笔分类 -  Android

摘要:Androidx 迁移方法: 首先把 gradle 版本改为3.2.0以上,以及 compileSdkVersion 为28以上 然后 Android Studio 菜单栏 Refactor -> Migrate to AndroidX 如果是新项目,使用AndroidX相关依赖,可以在gradle 阅读全文
posted @ 2019-06-01 15:40 crane13 阅读(3753) 评论(0) 推荐(0)
摘要:af 公用荷兰语 af-ZA 公用荷兰语 - 南非 sq 阿尔巴尼亚 sq-AL 阿尔巴尼亚 -阿尔巴尼亚 ar 阿拉伯语 ar-DZ 阿拉伯语 -阿尔及利亚 ar-BH 阿拉伯语 -巴林 ar-EG 阿拉伯语 -埃及 ar-IQ 阿拉伯语 -伊拉克 ar-JO 阿拉伯语 -约旦 ar-KW 阿拉伯 阅读全文
posted @ 2019-05-22 17:46 crane13 阅读(17110) 评论(0) 推荐(0)
摘要:const AspectRatio({ Key key, @required this.aspectRatio, Widget child,}) void main() { runApp( new MaterialApp( title: 'Demo', home: new Scaffold( appBar: new AppBar( ... 阅读全文
posted @ 2019-05-21 20:14 crane13 阅读(1692) 评论(0) 推荐(0)
摘要:如果target到API 21,有一些注意的事项,以下是目前我发现的两个问题1. Service must be explitict,从Lollipop开始,service必须显性声明,解决方案:http://blog.android-develop.com/2014/10/android-l-ap... 阅读全文
posted @ 2015-01-16 10:22 crane13 阅读(412) 评论(0) 推荐(0)
摘要:Eclipse:Ctrl + 1Android Studio: Alt + Enter1. 首先当然是打开设置窗口啦,然后在IDE Settings 下找到Keymap2. 在Keymap的搜索框中搜索【intent】,就会出现 【show intention actions】项目3. 对项目... 阅读全文
posted @ 2015-01-16 10:20 crane13 阅读(1556) 评论(0) 推荐(0)
摘要:针对一位博友提的问题,我这边写出来,估计还是很多人会碰到这个问题,但是不知道如何解决的。就是在设置了代码自动提示功能后,发现不生效的,如何设置代码自动提示请戳这:Android Studio如何设置代码自动提示。不生效的原因是因为你AS设置成了省电模式,设置成省电模式了的话,AS会禁掉一些辅助功能,... 阅读全文
posted @ 2015-01-16 10:17 crane13 阅读(396) 评论(0) 推荐(0)
摘要:关键点:利用Gradle发布本地maven库支持android library 打包文件(*.aar) 的本地引用开发环境:windows7 64位操作系统android studio0.5.8(1) 安装maven1.在安装maven之前,先确保已经安装JDK1.6及以上版本,并且配置好环境变量。... 阅读全文
posted @ 2015-01-05 13:49 crane13 阅读(3616) 评论(0) 推荐(0)
摘要:需要权限:调用方法:ShortCut.create(this);ShortCut代码如下:public class ShortCut { /** * 是否存在快捷方式 * @param context * @return */ private static... 阅读全文
posted @ 2014-11-09 17:37 crane13 阅读(177) 评论(0) 推荐(0)
摘要:1.引入facebook 工程lib,在Manifest中声明com.facebook.LoginActivity,facebook_app_id2.调用方式:1).初始化facebookLogin,设置回调private FacebookLogin facebookLogin;facebookLo... 阅读全文
posted @ 2014-11-06 16:58 crane13 阅读(679) 评论(0) 推荐(0)
摘要:获取应用列表: List packages = getPackageManager().getInstalledPackages(0); for (PackageInfo i : packages) { if ((i.applicationInfo.... 阅读全文
posted @ 2014-11-04 18:08 crane13 阅读(219) 评论(0) 推荐(0)
摘要:/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this fil... 阅读全文
posted @ 2014-10-29 15:29 crane13 阅读(2998) 评论(0) 推荐(0)
摘要:自定义TextView:public class FirstBoldTextView extends TextView{ private boolean firstWordBold = false; private String str; public FirstBoldTextV... 阅读全文
posted @ 2014-10-29 15:16 crane13 阅读(796) 评论(0) 推荐(0)
摘要:1、Layout文件添加Facebook的LoginBurtton1 2、 创建MainFragment 类,并且继承Fragment 类,重写onCreateView()方法 ;通过LoginButton设置权限setReadPermissions() 更多权限访问http://develope... 阅读全文
posted @ 2014-10-29 14:40 crane13 阅读(1090) 评论(0) 推荐(0)
摘要:/** * 转换图片成圆形 * * @param bitmap * 传入Bitmap对象 * @return */ public static Bitmap toRoundBitmap(Bitmap bitmap)... 阅读全文
posted @ 2014-05-09 22:58 crane13 阅读(900) 评论(0) 推荐(1)
摘要:Intent intent = new Intent();ComponentName cmp = new ComponentName("com.sina.weibo","com.sina.weibo.EditActivity");intent.setAction(Intent.ACTION_MAIN... 阅读全文
posted @ 2014-05-07 23:44 crane13 阅读(574) 评论(0) 推荐(0)
摘要:一、获取API Key1、先获取SHA-1 fingerprint数字证书是有两种,一种是debug,还有release。前者只能用于测试;后者才可以用于实际产品。debug:在命令行中输入命令:keytool -list -v -keystore "C:\Users\your_user_name\... 阅读全文
posted @ 2014-05-07 17:30 crane13 阅读(637) 评论(0) 推荐(0)
摘要:public static String getMD5(String str) { MessageDigest md5 = null; try { md5 = MessageDigest.getInstance("MD5"); } ca... 阅读全文
posted @ 2014-05-02 21:18 crane13 阅读(141) 评论(0) 推荐(0)
摘要:import java.io.ByteArrayOutputStream;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.i... 阅读全文
posted @ 2014-05-02 21:16 crane13 阅读(250) 评论(0) 推荐(0)
摘要:import android.app.AlertDialog;import android.content.Context;import android.content.DialogInterface;import android.text.TextUtils;import android.widg... 阅读全文
posted @ 2014-05-02 21:07 crane13 阅读(554) 评论(0) 推荐(0)
摘要:Base64.javaimport java.io.ByteArrayOutputStream;import java.io.IOException;import java.io.OutputStream;public class Base64 { private static final c... 阅读全文
posted @ 2014-05-02 21:06 crane13 阅读(242) 评论(0) 推荐(0)