HbuilderX+微信开发者工具配置

https://blog.csdn.net/weixin_42970423/article/details/100984418?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.compare&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.compare...

android开发webview使用h5播放视频时横竖屏切换的解决方法

1.xml代码<activityandroid:hardwareAccelerated="true"android:name=".WebViewActivity"android:configChanges="orientation|keyboardHidden|screenSize"android:screenOrientation="portrait"/>2.kotlin代码webView.webChromeClient=object:WebChromeClient(){overridefunonShowCustomView(view:View,callback:WebChromeClient.CustomViewCallback){super.onShowCustomView(view,callback)showCustomView(view,callback)}overridefunonHideCustomView(){super.onHideCustomView()hideCustomView()}}privatefunsetStatusBarVisibility(...

android开发cmake编译引入第三方库的常用写法

1.子模块1:gmath静态库CMakeLists.txt#要求的cmake最小版本cmake_minimum_required(VERSION3.4.1)#打开cmake输出日志set(CMAKE_VERBOSE_MAKEFILEon)#添加静态库,库名称gmathadd_library(gmathSTATICsrc/gmath.c)#定义变量distribution_DIR,${CMAKE_CURRENT_SOURCE_DIR}表示当前文件所在的目录set(distribution_DIR${CMAKE_CURRENT_SOURCE_DIR}/../../../../../distribution)#设置静态库gmath的输出目录set_target_properties(gmathPROPERTIESARCHIVE_OUTPUT_DIRECTORY#静态库输出目录"${distribution_DIR}/gmath/lib/${ANDROID_ABI}")#添加自定义命令,拷贝头文件"${CMAKE_CURRENT_SOURCE_DIR}/src/gmath.h"到"${dist...

android开发使用clipPath快速实现ImageView圆角

classRoundImageView@JvmOverloadsconstructor(context:Context,attrs:AttributeSet?=null,defStyleAttr:Int=0):AppCompatImageView(context,attrs,defStyleAttr){privatevalmRadius=10fprivatevalmRoundedRectPath=Path()privatevarwidth=0fprivatevarheight=0fprivatevarisClip=falseoverridefunonMeasure(widthMeasureSpec:Int,heightMeasureSpec:Int){super.onMeasure(widthMeasureSpec,heightMeasureSpec)width=measuredWidth*1.0fheight=measuredHeight*1.0f}overridefunonDraw(canvas:Canvas){if(!isClip){isClip=truemRoundedRect...

android开发文字转bitmap的实现

publicstaticBitmapgenerateBitmap(Stringtext,inttextSizePx,inttextColor){TextPainttextPaint=newTextPaint();textPaint.setTextSize(textSizePx);textPaint.setColor(textColor);intwidth=(int)Math.ceil(textPaint.measureText(text));Paint.FontMetricsfontMetrics=textPaint.getFontMetrics();intheight=(int)Math.ceil(Math.abs(fontMetrics.bottom)+Math.abs(fontMetrics.top));Bitmapbitmap=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);Canvascanvas=newCanvas(bitmap);canvas.drawText(text,0,Math.abs(fontMe...

android开发使用Glide加载图片模糊不清的解决方法

funloadPreviewImage(context:Context,url:String,target:ImageView){valrequestOptions=RequestOptions().diskCacheStrategy(DiskCacheStrategy.ALL).override(Target.SIZE_ORIGINAL,Target.SIZE_ORIGINAL)  //关键代码,加载原始大小.format(DecodeFormat.PREFER_RGB_565)  //设置为这种格式去掉透明度通道,可以减少内存占有.placeholder(R.drawable.img_error).error(R.drawable.img_error)Glide.with(context).setDefaultRequestOptions(requestOptions).load(url).into(target)}针对于大图,有个很好用的图片显示框架,使用的是Bitmap的分块加载技术:https://github.com/davemorrissey/subsampling-sc...

android开发文件存储常见到api以及路径

android文件存储路径分为三小块:1.app私有,用户不可见的/data/user/0开头的:  context.filesDir-->/data/user/0/包名/files  context.cacheDir-->/data/user/0/包名/cache  context.getDir("TestDir")-->/data/user/0/包名/app_TestDir  2.app私有,用户可见的/storage/emulated/0/Android/data/包名/开头的:  context.externalFilesDir(null)-->/storage/emulated/0/Android/data/包名/files  context.externalCacheDir()-->/storage/emulated/0/Android/data/包名/cache  context.externalFilesDir("TestPicture")-->/storage/emulated/0/Android/data/包名/files/Tes...

android开发EditText禁止输入中文密码的解决方法

funisChinese(str:String):Boolean{if(str.isEmpty()){returnfalse}for(cinstr.toCharArray()){if(c>=0x4E00.toChar()&&c<=0x9FA5.toChar())returntrue//有一个中文字符就返回}returnfalse}valfilters=binding.etNewPwd.filtersvalnewFilters=Array(filters.size+1){if(it<filters.size){filters[it]}else{InputFilter{source,_,_,_,_,_->if(EmptyUtils.isEmpty(source?.toString())||isChinese(source.toString()))""elsesource}}}binding.etNewPwd.filters=newFilters ...

android开发使用Jenkins进行android项目打包配置截图

      curl'https://oapi.dingtalk.com/robot/send?access_token=0a53d2e13946f6b85458bec9204e091c786b06c7daa0cac5434113124432'-H'Content-Type:application/json'-d'{"msgtype":"text","text":{"content":"打包完毕.地址:http://xx.xx.xx.xx:8080/job/XX-Android/lastSuccessfulBuild/artifact/app/build/outputs/apk/"}}'//需要安装钉钉机器人插件 ...

Flutter开发flutter sdk安装配置以及flutter sdk版本管理和版本切换

需要使用git方式下载安装fluttersdk,因为版本切换是使用gitreset指定到切换到版本的。1.gitclonehttps://github.com/flutter/flutter.git下载最新的fluttersdk2.添加flutter路径到.bash_profile,然后命令行执行source.bash_profile让它生效  exportPUB_HOSTED_URL=https://pub.flutter-io.cn  //配置pub仓库服务器路径  exportFLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn  exportFLUTTER_HOME=/Users/yfsu/Flutter/flutter  //配置flutterhome目录  exportPATH=${PATH}:${FLUTTER_HOME}/bin3.cd到flutter目录下,命令行执行flutterdoctor,就会自动下载需要到依赖包括对应版本engine、dart等等。执行完后所有选项都是对勾说明环境安装成功。  对应版本的依...

android开发使用Glide加载Bitmap的方法

方法一:不推荐,会出现闪烁funloadBitmapImage(target:ImageView,bitmap:Bitmap){valbaos=ByteArrayOutputStream()bitmap.compress(Bitmap.CompressFormat.PNG,100,baos)valbytes:ByteArray=baos.toByteArray()valrequestOptions=RequestOptions().centerCrop()Glide.with(target.context).setDefaultRequestOptions(requestOptions).load(bytes).into(target)baos.closeQuietly()}方法二:推荐funloadBitmapImage(target:ImageView,bitmap:Bitmap){valdrawable=BitmapDrawable(target.resources,bitmap)valrequestOptions=RequestOptions().centerCrop().di...

android开发DialogFragment禁止按back键消失的解决方法

overridefunonCreateDialog(savedInstanceState:Bundle?):Dialog{valctx=context?:returnsuper.onCreateDialog(savedInstanceState)varbuilder:AlertDialog.Builder=AlertDialog.Builder(ctx,R.style.CenterDialogStyle)builder.setView(view)valdialog=builder.create()dialog.setCanceledOnTouchOutside(false)dialog.setCancelable(false)//无效isCancelable=false  //有效,设置这个才有效,上面的那个无效,坑死了,网上一堆无用的监听key事件,我去。。。returndialog} ...

android jni开发添加log头文件android_debug.h

#include<android/log.h>#defineMODULE_NAME"LOG-NAME"#defineLOGV(...)__android_log_print(ANDROID_LOG_VERBOSE,MODULE_NAME,__VA_ARGS__)#defineLOGD(...)__android_log_print(ANDROID_LOG_DEBUG,MODULE_NAME,__VA_ARGS__)#defineLOGI(...)__android_log_print(ANDROID_LOG_INFO,MODULE_NAME,__VA_ARGS__)#defineLOGW(...)__android_log_print(ANDROID_LOG_WARN,MODULE_NAME,__VA_ARGS__)#defineLOGE(...)__android_log_print(ANDROID_LOG_ERROR,MODULE_NAME,__VA_ARGS__)#defineLOGF(...)__android_log_print(ANDROID_LOG_FATAL...

android开发Activity启动流程简单记录方便搜索以及回顾

1.点击launcher图标LauncherApp.onClick->onClickAppShortcut()->startAppShortcutOrInfoActivity()->launcher.startActivitySafely()Activity.startActivity->startActivityForResult2.页面启动逻辑Instrumentation.exeStartActivity->ams.getService.startActivity(ActivityTaskManager.getService().startActivity)->startActivityAsUser()ActivityStarter.startActivity->ActivityStarter.startActivityUnchecked()->mRootActivityContainer.resumeFocusedStacksTopActivities();ActivityStack.resumeTopActivityUnchec...
首页上一页...678910...下一页尾页