美文网首页
Android备忘录

Android备忘录

作者: 想入飞飞___ | 来源:发表于2016-10-20 18:33 被阅读114次

常用库Gradle依赖:

 // retrofit2 的gson转换器依赖
compile 'com.squareup.retrofit2:converter-gson:2.0.1'  
  //retrofit2
compile 'com.squareup.retrofit2:retrofit:2.0.1'
//  retrofit2 为RxJava准备的CallAdapter 
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.1'  

//  RxAndroid 
compile 'io.reactivex:rxandroid:1.1.0'  
//RxJava
compile 'io.reactivex:rxjava:1.1.0'  

//Luban 图片压缩框架
compile 'top.zibin:Luban:1.0.5'


仿美团等选择城市列表demo
https://github.com/zaaach/CityPicker

获取照片(拍照或从相册、文件中选择)、裁剪图片、压缩图片的开源工具库
https://github.com/crazycodeboy/TakePhoto


如何在Android Studio安装so文件?

  1. 在app>>src>>main 目录下建立 jniLibs文件夹,jniLibs文件夹下放so文件;
  2. 在app的buid.gradle文件中添加SO库目录配置
 android {
     sourceSets {
         main.jniLibs.srcDirs = ['libs']
    }
 }

如何在android 6.0 添加HttpClient库?

在app的build.gradle文件添加配置信息useLibrary 'org.apache.http.legacy'声明编译时依赖

android {
 compileSdkVersion 23
 buildToolsVersion "23.0.2"
 useLibrary 'org.apache.http.legacy'
}

注:如果在build.gradle文件中useLibrary 'org.apache.http.legacy'这句话报错,可将该jar直接放到libs目录下即可。

常用代码

android 6.0 通知

NotificationManager notificationManager = (NotificationManager) mContext
        .getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent pi = PendingIntent.getActivity(mContext, 0,
        new Intent(MainActivity.this, MainActivity.class), 0);
NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext)
        .setTicker("更新啦")
        .setContentTitle("标题")
        .setContentText("内容")
        .setSmallIcon(R.drawable.ic_launcher);
Notification notification = builder.build();
notificationManager.notify(0, notification);

打开Android 相册

Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
       intent.setType("image/*");

打开Android相机

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, PathToUri(imgPath));

相关文章

  • 设计模式-备忘录模式(Memento)的详解

    设计模式-备忘录模式(Memento)的详解 Android开发-备忘录模式在Android的应用和模拟实验 【备...

  • Ly 2017年Android 学习路线

    凌宇的android备忘录 Android原有技术的深入 Android Ar Vr 的学习 这个东西要从今天...

  • Android 备忘录模式

    Android 设计模式系列文章 Android 23种设计模式 前言 备忘录模式顾名思义,就是保存当前某个状态,...

  • 求大佬帮忙,期末作业

    请在Android系统中开发一个备忘录的应用,使用SQLite数据库实现对数据的存储。进入备忘录应用能用ListV...

  • 备忘录设计模式

    1.定义: 2.简单描述: 3.UML建模图 4.简单示例: 5.Android中的备忘录设计模式: 6.备忘录优...

  • 一款轻量级android备忘录,支持闹钟提醒

    一款轻量级的Android备忘录,简洁实用,适合Android入门新手当做学习的材料 项目地址:点击打开链接 喜欢...

  • Android备忘录

    常用库Gradle依赖: 如何在Android Studio安装so文件? 在app>>src>>main 目录下...

  • Android Studio插件备忘录

    Android studio插件备忘录 Exynap内含大量代码模板,快捷键ctrl+alt+D .Ignore更...

  • Android开发坑爹列表

    Android开发备忘录 积累一些Android开发时遇到的坑点。虽然有些问题比较基础,但是开发调试的时候也会难以...

  • Android并发备忘录

    前言 随着Java的发展,并发这个概念不再是服务端独有的了。Android等移动端在App越做越大的趋势下,合理地...

网友评论

      本文标题:Android备忘录

      本文链接:https://www.haomeiwen.com/subject/uezfuttx.html