- 博客(109)
- 资源 (1)
- 收藏
- 关注
原创 Android build.gradle获取java文件的数据
def serverEnv() { def dir = getProjectDir(); def path = dir.path + "/src/main/java/com/example" File fileAppConfig = new File(path + "/AppConfig.java") if(fileAppConfig!=null&&fileAppConfig.exists()){ def debugIndex=fileApp.
2021-05-11 10:37:04 878
原创 Java 给出5个随机字符,排列组合不能重复
先想两个情况,两个就是 "北京" 和"京北",然后再写3个情况。5个情况。 /** * 给出任意的5个字符,随机给出他们组合,不重复 */ @org.junit.Test public void test() {// char arr[] = {'北', '京', '欢', '迎', '您'}; char arr[] = {'北', '京', '欢', '迎', '您'};// char arr[] = {'.
2021-03-15 10:47:15 1255
原创 Android发送邮件,163邮箱发出。
implementation 'com.sun.mail:android-mail:1.6.2'implementation 'com.sun.mail:android-activation:1.6.2'import java.util.*import javax.mail.*import javax.mail.internet.InternetAddressimport javax.mail.internet.MimeMessage private val TA.
2021-03-02 17:32:15 792
原创 Android WorkManager初体验
https://developer.android.google.cn/topic/libraries/architecture/workmanagerhttps://developer.android.google.cn/topic/libraries/architecture/workmanager/basics示例:https://github.com/android/architecture-components-samples/tree/main/WorkManagerSample1. A
2021-02-23 13:45:05 181
原创 macOs 10.15.6 svn 错误解决方法 The subversion command line tools are no longer provided by Xcode
http://subversion.apache.org/packages.html找到Mac OS XHomebrew$ brew options subversion$ brew install (OPTIONS) subversionbrew 卡主解决办法https://www.jianshu.com/p/7cb05a2b39a5
2020-08-05 11:02:37 846
原创 C++笔记
C++数组遍历 int array2[5] = {30,20}; for(int i=0;i< sizeof(array2)/sizeof(array2[0]);i++){ cout << "array2("<<i<<") := "<<array2[i] << endl; }
2020-06-19 21:23:21 156
原创 Android跟随手指运动的TextView
package com.xxxximport android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.text.Layout;import android.text.StaticLa...
2020-04-25 17:40:58 308
原创 Android随着手指上下运动的图片按钮
package com.xxxximport android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.text.Layout;import android.text.StaticLa...
2020-04-25 17:39:08 203
原创 Android高德地图marker 设置本地加网络图片,已经切换处理
Amap_2DMap_V2.9.0_20160525Amap_Location_V2.6.0_20160628Amap_Search_V3.3.0_20160616这里的customerList是用户基本信息for (int i = 0; i < customerList.size(); i++) { MarkerView markerViewSelected = new...
2019-08-15 09:57:41 888
原创 Androd DataBinding入门级使用
Android Studio version 3.3.2app->build.gradleandroid { dataBinding{ enabled = true }}第二步 gradle.propertiesorg.gradle.jvmargs=-Xmx1536mandroid.useAndroidX=trueandroid.e...
2019-07-08 09:21:08 171
原创 Java rxjava(2.2.3) interval 停止。
rxjava版本 2.2.3Disposable disposable;final byte SECOND = 59;//返回Disposable 对象-倒计时disposable = Observable.interval(1, TimeUnit.SECONDS, AndroidSchedulers.mainThread()) .take(SECOND + 1...
2019-04-28 17:34:08 4384
原创 Android微信支付开发 ,回退键 界面闪动问题处理。
@Override public void onResp(BaseResp resp) { Log.d("+++++++++++++++++++","微信支付回调"); if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) { EventBusCustom eventBus...
2018-06-13 15:06:41 1995
翻译 Retrofit 多文件上传进度监听.
package com.github.monotonewang;import android.os.Handler;import android.os.Looper;import java.io.File;import java.io.FileInputStream;import java.io.IOException;import okhttp3.MediaType;impo...
2018-06-13 15:04:20 1280
原创 Android Studio All version
This page provides an archive of all Android Studio releases.https://developer.android.com/studio/archive
2018-05-19 19:25:52 256
原创 LinearLayout中间撑开
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white" a...
2018-04-05 08:10:36 951
原创 Android gradle error com.android.build.api.transform.transformexception java.lang.runtimeexception
com.android.build.api.transform.transformexception java.lang.runtimeexceptionslove:add:dexOptions { incremental true javaMaxHeapSize "4g"}under android
2018-03-29 17:33:23 3518
原创 Android Notification
// Intent intent = new Intent();// intent.putExtra(EventBusCustom.key_cancelAppointBean, EventBusJpush.s_cancel_appoint);// EventBus.getDefault().post(new EventBusJpush(EventBus...
2018-03-09 17:31:31 176
原创 Amap注意细节
aMap.moveCamera(CameraUpdateFactory.zoomTo(mZoomDefault + 1));Marker marker = aMap.addMarker(options);高德以上api都是异步处理的。要拿实时结果的小伙伴,注意了。
2018-02-05 15:44:14 280
原创 RxJava,无限发射
Observable.interval(0, 1, TimeUnit.SECONDS).filter(new Predicate() { @Override public boolean test(Long aLong) throws Exception { return true; }}).takeUntil(new Predicate() {
2018-01-04 19:58:13 778
转载 HttpClient 上传当个文件
@Test public void uploadFileImpl() throws Exception {// File file = new File("FengChao_v1.0_2017-12-26_11-23-41_wandoujia.apk"); File file = new File("1514267205448.png");
2017-12-26 16:16:13 144
原创 Retrofit上传文件
compile 'com.squareup.retrofit2:retrofit:2.3.0'compile 'com.squareup.retrofit2:converter-gson:2.3.0'compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'版本单文件上传@Multipart@POST("/
2017-12-16 15:25:39 224
转载 MySQL 相关操作
1.update passwordset password for root@localhost=password('123456');
2017-10-16 15:43:49 177
转载 android图片写到系统Picture
try { MediaStore.Images.Media.insertImage(context.getContentResolver(), file.getAbsolutePath(), fileName, null);} catch (FileNotFoundException e) { e.printStackTrace();}// 最后通知图
2017-08-23 16:12:57 582
原创 activity跳转回退
Intent intent = new Intent(getContext(), OtherAccountActivity.class);intent.putExtra("userId",ownId);intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);getContext().sta
2017-08-15 17:03:51 862
原创 git相关操作
1.git alter usernamegit config user.namegit config user.emailgit config --global user.name "username"git config --global user.email "email"2.git del remote filesgit statusgit rm .idea
2017-05-31 15:55:26 426
原创 Ubuntu常用软件安装
google-chromehttp://jingyan.baidu.com/article/335530da98061b19cb41c31d.htmlshadowsockshttps://github.com/shadowsocks/shadowsocks-qt5/wiki/Installationjava oracle官网:https://www.oracle
2017-05-31 15:37:36 357
原创 Android键盘处理
1.// topBarView.getViewTreeObserver().addOnGlobalLayoutListener(this);2.// topBarView.getViewTreeObserver().removeOnGlobalLayoutListener(this);3. //注册监听视图树的观察者/
2017-04-27 14:03:19 302
原创 SSH-key 在Windows下如何生成公钥和私钥
1.ssh-key -t rsa然后直接点击 enter enter enter2.查看id_rsa.pub上传公钥到服务器输入 cat id_rsa.pub
2017-04-25 18:47:16 63380 2
原创 SercureCrt默认windows -->config位置
C:\Users\username\AppData\Roaming\VanDyke\Config
2017-04-25 08:30:13 895
原创 Android Activity或者Fragment 向Adapter实时传递参数
1.activityadapter.setIsSelect(isSelectAll);2.adapter 2.1 定义成员变量private boolean isSelectAll = false;2.2 自定义一个方法public void setIsSelect(boolean isSelect) { Log.e(TAG, "setIsSelect: " + isSel
2017-04-22 10:02:57 1996
原创 Android 全屏PopWindow,盖住StatusBar
1 不起作用的代码PopupWindow popWindow = popWindow.getPopWindow();popWindow.setWindowLayoutType(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);popWindow.setWindowLayoutType(WindowManager.LayoutParams
2017-04-20 12:07:57 5530 1
原创 android 禁止手机截屏
onCreate();this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
2017-04-18 16:28:47 2333
原创 Android打开相机
首先获取相机权限private Camera openCamera(boolean front_camera, int width, int height, int framerate, SurfaceTexture st) { Camera camera = null; Camera.CameraInfo info = new Camera.CameraInfo();
2017-04-11 16:10:11 842
原创 android截屏保存相机图片
需要获取权限:第一步if (mCamera != null) { mCamera.takePicture(null, null, mPicture);}第二步/** * 保存相机图片 */private Camera.PictureCallback mPicture = new Camera.PictureCallback() { @Override pu
2017-04-11 16:09:45 386
原创 Android 隐藏StatusBar
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
2017-04-11 14:51:50 417
原创 android多权限请求
1.List permissions = new ArrayListif (!PermissionUtil.checkCameraAccess(ShotActivity.this)) { permissions.add(Manifest.permission.CAMERA);}if (!PermissionUtil.checkAudioAccess(ShotActivity.
2017-04-07 18:05:56 298
原创 Android,PullToRefreshListView,addHeaderView错误!
先获取PullToRefreshListView对象,然后获取在addHeaderView之前,需要先显示ListView的数据!
2016-10-28 16:22:12 219
android的新闻listView显示
2016-01-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人