- 博客(33)
- 收藏
- 关注
原创 Android动态定位权限
判断是否开启了定位权限if(ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED){//未开启定位权限 //开启定位权限,200是标...
2019-09-17 16:30:11
3083
原创 Android简单集成友盟统计
在清单文件添加所需<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myapplication"> <!--友盟统计所需权限--> ...
2019-04-27 20:40:06
319
原创 Android简单集成信鸽推送
添加项目的buid.gradlendk { //选择要添加的对应cpu类型的.so库 abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a' // 还可以添加 'x86', 'x86_64', 'mips', 'mips64' } manifestPl...
2019-04-20 10:20:15
396
原创 Android中fresco常用的失败图,占位图,重试图
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http:/...
2019-04-09 14:00:41
1691
原创 Android简单实现Fragment
fragment切换页面<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmln...
2019-04-07 08:17:23
338
原创 Android简单实现ViewPager
切换Xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="...
2019-04-07 08:13:56
207
原创 Android ViewpPager简单实现懒加载
base类的fragmentpublic abstract class BaseFragment extends Fragment { //是否可见 protected boolean isVisible; // 标志位,标志Fragment已经初始化完成。 public boolean isPrepared = false; /** * 实现F...
2019-04-07 08:11:50
154
原创 Android相机相册上传
展示Dialog,并且调用相机相册 protected void showQQDialog() { //加载对话框布局 View view = getLayoutInflater().inflate(R.layout.dialog_qq_item, null); dialog = new Dialog(this); dialo...
2019-04-06 21:01:43
166
原创 Android recyclerview横向抢购
big_recyclerview.setLayoutManager(new GridLayoutManager(getActivity(),GridLayoutManager.HORIZONTAL,2,true));
2019-04-06 20:03:28
156
原创 android简单一级购物车
Activitymain。xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_hei...
2019-04-02 19:25:31
341
1
原创 Android简单集成MultiImageSelector图片多选
依赖compile 'com.github.lovetuzitong:MultiImageSelector:1.2'项目中加入maven { url "https://jitpack.io" }xml<?xml version="1.0" encoding="utf-8"?><android.support.constraint.ConstraintLayout ...
2019-04-01 20:52:43
394
原创 android动态请求权限
加在定义常量中String[] permiss={Manifest.permission.CAMERA,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_EXTERNAL_STORAGE};加在需要用在点击事件上//动态权限 Cameraperssion(); private void C...
2019-03-26 20:32:18
1543
原创 android简单toolbar
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_widt...
2019-03-23 12:04:46
129
转载 andorid全局捕获异常
添加到ApplicationCrashHandler.getInstance().init(this);//初始化全局异常管理Appmasterpublic class AppManager { // Activity栈 private static Stack<Activity> activityStack; // 单例模式 private s...
2019-03-13 14:08:41
136
原创 android集成百度地图简单
public class MainActivity extends AppCompatActivity implements View.OnClickListener { private MapView mMapView; private BaiduMap mBaiduMap; public LocationClient mLocationClient; publi...
2019-03-07 11:28:45
510
原创 android简单极光推送
android { compileSdkVersion 28 defaultConfig { applicationId "com.example.lenovo.myapplication" minSdkVersion 15 targetSdkVersion 28 versionCode 1 versi...
2019-03-07 09:24:07
362
原创 android购物车简单不使用自定义View
project的maven仓库maven { url 'https://jitpack.io' }左滑删除的依赖implementation 'com.github.mcxtzhang:SwipeDelMenuLayout:V1.2.1'购物车的fragmnetpublic class frag_03 extends BaseFrament implements XRecyclerV...
2019-03-03 19:53:18
150
转载 android判断网络工具类简单
public class NetUtil { /* 网络状态 */ public static boolean isNet = true; public static enum netType { wifi, CMNET, CMWAP, noneNet } /** * @方法说明:判断WIFI网络是否可用 * @...
2019-02-27 18:59:37
374
原创 popwindow以及alertdialog简单使用
View view=View.inflate(this,R.layout.item_pop,null); popupWindow=new PopupWindow(view,ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT,true); popupWindow.setFocu...
2019-02-26 18:55:58
214
原创 android简单实现判断WiFi网络,或者移动数据是否连接
//判断WiFi是否连接isWifi(MainActivity.this);//判断Wifi是否连接 private static boolean isWifi(Context mContext) { ConnectivityManager connectivityManager = (ConnectivityManager) mContext ...
2019-02-26 17:06:26
2877
转载 android简单加载网络视频并播放
依赖implementation 'com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.5'必须要申请的权限<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.RE...
2019-01-20 10:42:37
4591
3
原创 android简单购物车,自定义view加减按钮
依赖 implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.github.bumptech.glide:glide:4.8.0' implementation 'com.android.support:recyclerview-v7:28.0.0' implementation('...
2019-01-18 14:40:34
1773
原创 android腾讯bugly简单集成
先实现依赖implementation 'com.tencent.bugly:crashreport:latest.release'这个写到全局工具类中,也就是继承ApplicationCrashReport.initCrashReport(getApplicationContext(), "注册时申请的APPID", false); 建议在测试阶段建议设置成true,发布时设置为fal...
2019-01-18 11:58:30
228
原创 android超简单友盟分渠道打包
项目 的清单文件中中配置<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round...
2019-01-18 11:55:19
217
原创 Android集成greendao框架
依赖 implementation 'org.greenrobot:greendao:3.2.2' implementation 'org.greenrobot:greendao-generator:3.2.2'工具类@Entitypublic class UserInfo { @Id(autoincrement = true) private long i...
2018-12-29 15:40:35
569
原创 android集成高德定位
权限&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.demo1_scott"
2018-12-19 20:50:19
219
原创 android线性加载recyclerview列表
依赖implementation 'com.android.support:recyclerview-v7:25.3.1' implementation('com.jcodecraeer:xrecyclerview:1.5.9') { exclude group: 'com.android.support' } implementation 'com.g...
2018-12-17 19:59:08
267
原创 Android集成友盟第三方登录
button点击事件if (v.getId()==R.id.login_QQ) { if(Build.VERSION.SDK_INT>=23){//QQ需要申请写入权限 String[] mPermissionList = new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,...
2018-12-08 10:12:16
214
原创 Android简单生成二维码
依赖implementation 'cn.bingoogolapple:bga-qrcode-zxing:1.2.5'xml代码<ImageView android:id="@+id/zxing_image" android:layout_width="match_parent" android:layout_height="match...
2018-12-07 15:27:26
301
原创 Android集成Zxing扫码
<uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.VIBRATE"/>代码<cn.bingoogolapple.qrcode.zxing.ZXingView androi...
2018-12-03 20:59:54
671
原创 Android简单各大传感器
第一项xml&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;TextView android:layout_width="match_parent" android:layout_height="wrap_content" a
2018-11-02 15:23:48
207
原创 Android简单侧边栏
main xml主界面&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;android.support.v4.widget.DrawerLayout xmlns:android=“http://schemas.android.com/apk/res/android”xmlns:app=“http://schemas.android
2018-10-20 11:07:02
1091
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人