iis服务器助手广告广告
返回顶部
首页 > 资讯 > 移动开发 >IOS Ble蓝牙开发实现方法
  • 589
分享到

IOS Ble蓝牙开发实现方法

IOSBle蓝牙 2022-05-30 04:05:55 589人浏览 薄情痞子
摘要

本篇博文阐述如何开发Ble蓝牙。在蓝牙中的一些常见服务,扫描,以及链接; 主蓝牙类文件.h 主蓝牙类文件.m UUID文件 蓝牙列表展示的文件 一:引入Bl

本篇博文阐述如何开发Ble蓝牙。在蓝牙中的一些常见服务,扫描,以及链接;

  • 主蓝牙类文件.h
  • 主蓝牙类文件.m
  • UUID文件
  • 蓝牙列表展示的文件

一:引入Ble蓝牙的框架<CoreBluetooth/CoreBluetooth.h>

BuleHelp.h


#import <Foundation/Foundation.h>
//导入蓝牙框架
#import <CoreBluetooth/CoreBluetooth.h>
#import "DeviceModel.h"
#import "Constants.h"
#import "CommonUserDefaults.h"
#import "CommonUtil.h"
#import "TempDB.h"

#define COMMAND_PACKET_MIN_SIZE 7

@interface BlueHelp : NSObject

//蓝牙的设备搜索显示在列表中
@property (nonatomic, strong) NSMutableArray <CBPeripheral*>*periperals;

//连接peripheral
@property(nonatomic,strong) CBPeripheral *peripheral;

//连接peripheral
@property(nonatomic,strong) CBPeripheral *selectperipheral;

//中心管理者
@property (nonatomic, strong) CBCentralManager *centerManager;

@property (nonatomic,strong) DeviceModel *deviceModel;

//设备列表
@property (nonatomic,strong) NSMutableArray *deviceList;

@property (nonatomic,strong) NSMutableArray *commandArray;
//是否进行ota升级
@property (nonatomic) BOOL isOta;

@property (nonatomic) BOOL isWritePacketDataSuccess;

@property (strong,nonatomic) NSString * checkSumType;


@property (nonatomic) BOOL isApplicationValid;

@property (assign) uint8_t checkSum;


@property (nonatomic) int startRowNumber;


@property (nonatomic) int endRowNumber;


@property (strong,nonatomic) NSString *siliconIDString;

@property (strong,nonatomic) NSString *siliconRevString;


//是否发送数据
@property (nonatomic) BOOL isSendData;

@property (strong,nonatomic) CommonUtil *commonUtil;

@property (strong,nonatomic) TempDB *tempDB;

@property (strong,nonatomic) NSDate *currentDate;

//时间格式化
@property(strong,nonatomic) NSDateFORMatter *dateformatter;

@property(strong,nonatomic) NSString *deviceName;

//@property (nonatomic,strong) NSUserDefaults *userDefaults;

@property (nonatomic,strong) CommonUserDefaults *userDefaults;
//发送温度数据
@property (nonatomic,strong) CBCharacteristic *sendtempcharateristic;
//发送OTA数据
@property (nonatomic,strong) CBCharacteristic *sendotacharateristic;
//高/低温度数据
//@property (nonatomic,strong) CBCharacteristic *sendhighalarmcharateristic;
//
//@property (nonatomic,strong) CBCharacteristic *sendlowalarmcharateristic;
//ota
@property (nonatomic,strong) CBCharacteristic *senddfucharateristic;
//发送字符串'CR'清除机子上的最大值(3个字节)
@property (nonatomic,strong) CBCharacteristic *senddcrstrateristic;
//发送字符串'PD'机子关机(3个字节)
@property (nonatomic,strong) CBCharacteristic *senddoutstrateristic;
//静音
@property (strong,nonatomic) CBCharacteristic *sendmutealarmcharateristic;
//calset
@property(strong,nonatomic) CBCharacteristic *sendcalsetcharateristic;
//intervaltime
@property(strong,nonatomic) CBCharacteristic *sendintervaltimecharateristic;
//alarmswitch
@property(strong,nonatomic) CBCharacteristic *sendalarmswitchcharateristic;
//tempunit
@property(strong,nonatomic) CBCharacteristic *sendtempunitcharateristic;

@property(strong,nonatomic) CBCharacteristic *sendlowalarmswitchcharateristic;

///<===============方法区块=======================>
+ (id)sharedManager;

-(NSMutableArray *)getDeviceList;

-(NSMutableArray *)getPeriperalList;

-(void)startScan;
//连接蓝牙
-(void)contentBlue:(int) row;
//断开蓝牙
-(void)disContentBle;

//断开ota的蓝牙连接
-(void)disContentOtaBle;

//温度符号
-(void)writeTempUnit:(NSString *)value;

//写入报警开关
-(void)writeAlarmSwitch:(NSString *)value;


//写入mute alarm
-(void)writeMuteAlarm:(NSString *)value;

//写入CR CLERVULE
-(void)writeClearCR:(NSString *)value;


//写入interval time
-(void)writeIntervalTime:(NSString *)value;

//写入cal set
-(void)writeCalSet:(NSString *)value;

//写入设备的开关按钮
-(void)writeBluePD:(NSString *)value;

//写入低温报警
//-(void)writeLowAlarm:(NSString *)value;
//
////写入高温报警
//-(void)writeHighAlarm:(NSString *)value;

//OTA固件升级 又称为DFU
-(void)writeUpdateOTA:(NSString*)value;

-(void)writeBlueOTA:(NSString *)value;

-(void)wirteBlueOTAData:(NSData *)value;

-(void)writeLowAlarmSwitch:(NSString *)value;

-(void) discoverCharacteristicsWithCompletionHandler:(void (^) (BOOL success, NSError *error)) handler;

-(void)updateValueForCharacteristicWithCompletionHandler:(void (^) (BOOL success,id command,NSError *error)) handler;

-(void) stopUpdate;

-(void) setCheckSumType:(NSString *) type;

-(NSData *) createCommandPacketWithCommand:(uint8_t)commandCode dataLength:(unsigned short)dataLength data:(NSDictionary *)packetDataDictionary;

-(void) writeValueToCharacteristicWithData:(NSData *)data bootLoaderCommandCode:(unsigned short)commandCode;


-(void)stopScan;

//是否是第一次连接设备
@property(assign,nonatomic) BOOL isconnected;

//当前的时间
@property(nonatomic,assign) long currentTime;

@property(nonatomic,strong) NSString *MacAddre;

@property(nonatomic,strong) NSString *macName;

-(void)disMainOtaBle;

@end

BuleHelp.m


//程序运行后,会自动调用的检查蓝牙的方法 并扫描蓝牙的方法
- (void)centralManagerDidUpdateState:(CBCentralManager *)central{
 if ([central state] == CBCentralManagerStatePoweredOff) {
  NSLog(@"CoreBluetooth BLE hardware is powered off");
 }
 else if ([central state] == CBCentralManagerStatePoweredOn) {
  NSLog(@"CoreBluetooth BLE hardware is powered on and ready");
  [self startScan];
 }
 else if ([central state] == CBCentralManagerStateUnauthorized) {
  NSLog(@"CoreBluetooth BLE state is unauthorized");
 }
 else if ([central state] == CBCentralManagerStateUnknown) {
  NSLog(@"CoreBluetooth BLE state is unknown");
 }
 else if ([central state] == CBCentralManagerStateUnsupported) {
  NSLog(@"CoreBluetooth BLE hardware is unsupported on this platform");
 }
}


-(void)startScan{
 _periperals = [[NSMutableArray alloc] init];
 _deviceList = [[NSMutableArray alloc] init];
 //2.利用中心设备扫描外部设备
 [_centerManager scanForPeripheralsWithServices:nil options:nil];
}


-(void)stopScan{
 [_centerManager stopScan];
}



- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary<NSString *,id> *)advertisementData RSSI:(NSNumber *)RSS{
 //判断如果数组中不包含当前扫描到的外部设备才保存
 if (![_periperals containsObject:peripheral]){
  //包扣3种设备 都需要去搜索
  if([peripheral.name containsString:@"TMW012BT"]||[peripheral.name containsString:@"OTA"]){
   NSLog(@"DATA: %@", advertisementData);
   NSArray *keys = [advertisementData allKeys];
   for (int i = 0; i < [keys count]; ++i) {
    id key = [keys objectAtIndex: i];
    NSString *keyName = (NSString *) key;
    NSData *value = [advertisementData objectForKey: key];
    
    if([keyName isEqualToString:@"kCBAdvDataManufacturerData"]){
     NSLog(@"value is %@",value);
     NSString *result = [self convertDataToHexStr:value];
     NSLog(@"reslut is %@",result);
     if(result!=nil&&result.length>4){
      NSString *d = [result substringFromIndex:4];
      NSLog(@"D IS %@",d);
      // 小写
      //NSString *lower = [test lowercaseString];
      // 大写
      NSString *upper = [d uppercaseString];
      _macAddre = [NSString stringWithFormat:@"S/N:%@",upper];
     }
    }
    
    if([keyName isEqualToString:@"kCBAdvDataLocalName"]){
     NSString *aStr= (NSString*)value;
     NSLog(@"astr is %@",aStr);
     _macName = aStr;
    }
   }
   
   _deviceModel = [DeviceModel new];
   _deviceModel.deviceName = _macName;
   //蓝牙地址
   _deviceModel.deviceAddre = _macAddre;
   
   int rssi = [RSS intValue];
   NSString *range = [NSString stringWithFormat:@"%d",rssi];
   NSString *rs = [NSString stringWithFormat:@"RSSI %@dBm",range];
   //添加到里面
   [self.periperals addObject:peripheral];
   _deviceModel.deviceRssi = rs;
   [_deviceList addObject:_deviceModel];
  }
 }
}

//解析广播里面的数据
-(void)getAdvertisementData:(NSDictionary<NSString *,id> *) advertisementData{
 NSArray *keys = [advertisementData allKeys];
 for (int i = 0; i < [keys count]; ++i) {
  id key = [keys objectAtIndex: i];
  NSString *keyName = (NSString *) key;
  NSObject *value = [advertisementData objectForKey: key];
  
  if([keyName isEqualToString:@"kCBAdvDataManufacturerData"]){
   printf(" key: %s\n", [keyName cStringUsingEncoding: NSUTF8StringEncoding]);
   NSString *values = (NSString *) value;
   NSLog(@"values is %@",values);
  }
 }
}


-(void)contentBlue:(int) row{
 [_centerManager connectPeripheral:_periperals[row] options:nil];
}


-(void)disContentBle{
 //关键的断开蓝牙 通知也要停止掉
 if((_peripheral!=nil && _sendtempcharateristic!=nil)){
  [_peripheral setNotifyValue:NO forCharacteristic:_sendtempcharateristic];
  [self disconnectPeripheral:_peripheral];
 }
}



-(void)disContentOtaBle{
 if(_peripheral!=nil && _sendotacharateristic!=nil){
  [_peripheral setNotifyValue:NO forCharacteristic:_sendotacharateristic];
  [self disconnectPeripheral:_peripheral];
 }
}

-(void)disMainOtaBle{
 if(_peripheral!=nil){
  [self disconnectPeripheral:_peripheral];
 }
}

- (void) disconnectPeripheral:(CBPeripheral*)peripheral
{
 [_centerManager cancelPeripheralConnection:peripheral];
}

//连接成功
- (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral{
 NSLog(@"连接成功");
 if(peripheral!=nil){
  //停止扫描 这个用于自动连接的时候
  [_centerManager stopScan];
  //设备名称
  _deviceName = peripheral.name;
  
  _selectperipheral = peripheral;
  
  peripheral.delegate = self;
  //再去扫描服务
  [peripheral discoverServices:nil];
  
 }
}

//连接失败
- (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(nullable NSError *)error{
 NSLog(@"连接失败,失败原因:%@",error);
 NSString *disContentBlue = @"discontentblue";
 NSDictionary *blueDiscontent = [NSDictionary dictionaryWithObject:disContentBlue forKey:@"disconnect"];
 //发送广播 连接失败
 [[NSNotificationCenter defaultCenter] postNotificationName:@"disNofiction" object:nil userInfo:blueDiscontent];
}

//断开连接
- (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error{
 NSLog(@"断开连接");
 NSString *disContentBlue = @"discontentblue";
 //_blueiscon = @"Disconnect";
 NSDictionary *blueDiscontent = [NSDictionary dictionaryWithObject:disContentBlue forKey:@"disconnect"];
 //发送广播 连接失败
 [[NSNotificationCenter defaultCenter] postNotificationName:@"disNofiction" object:nil userInfo:blueDiscontent];
}

//只要扫描到服务就会调用,其中的外设就是服务所在的外设
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error{
 if (error){
  NSLog(@"扫描服务出现错误,错误原因:%@",error);
 }else{
  //获取外设中所扫描到的服务
  for (CBService *service in peripheral.services){
   //拿到需要扫描的服务,例如FFF0 比如打印温度数据
   //把所有的service打印出来
   //从需要的服务中查找需要的特征
   //从peripheral的services中扫描特征
   [peripheral discoverCharacteristics:nil forService:service];
  }
 }
}

//只要扫描到特征就会调用,其中的外设和服务就是特征所在的外设和服务
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(nonnull CBService *)service error:(nullable NSError *)error{
 if(error){
  NSLog(@"扫描特征出现错误,错误原因:%@",error);
 }else{
  //遍历特征,拿到需要的特征进行处理
  for (CBCharacteristic *characteristic in service.characteristics){
   NSLog(@"characteristic is %@",characteristic.UUID);
   //如果是温度数据处理
   if([characteristic.UUID isEqual:BOOT_TEMPVALUE_UUID]){
    //将全部的特征信息打印出来
    _isconnected = true;
    _peripheral = peripheral;
    _sendtempcharateristic = characteristic;
    [peripheral setNotifyValue:YES forCharacteristic:characteristic];
   }
   //如果是ota进行ota升级
   else if([characteristic.UUID isEqual:BOOT_OTA_WIRTE_UUID]){
    _peripheral = peripheral;
    _sendotacharateristic = characteristic;
    //设置通知
    [peripheral setNotifyValue:YES forCharacteristic:characteristic];
    _isOta = TRUE;
    [_userDefaults saveOta:_isOta];
    //[_ setBool:_isOta forKey:@"isOTA"];
    NSString *s = @"OTA";
    NSDictionary *tempOta = [NSDictionary dictionaryWithObject:s forKey:@"ota"];
    [[NSNotificationCenter defaultCenter] postNotificationName:@"tempOTA" object:nil userInfo:tempOta];
   }
   //CAL
   else if([characteristic.UUID isEqual:BOOT_CAL_UUID]){
    _sendcalsetcharateristic = characteristic;
    [peripheral setNotifyValue:YES forCharacteristic:characteristic];
   }
   //interval time
   else if([characteristic.UUID isEqual:BOOT_INTERVALTIME_UUID]){
    _sendintervaltimecharateristic = characteristic;
    [peripheral setNotifyValue:YES forCharacteristic:characteristic];
   }
   //Tempunit
   else if([characteristic.UUID isEqual:BOOT_TEMPUNIT_UUID]){
    _sendtempunitcharateristic = characteristic;
    [peripheral setNotifyValue:YES forCharacteristic:characteristic];
   }
   
   //DFU
   else if([characteristic.UUID isEqual:BOOT_DFU_UUID]){
    _senddfucharateristic = characteristic;
    [peripheral setNotifyValue:YES forCharacteristic:characteristic];
   }
   //发送字符串'CR'清除机子上的最大值(3个字节)
   else if([characteristic.UUID isEqual:BOOT_CRSTRING_UUID]){
    _senddcrstrateristic = characteristic;
    [peripheral setNotifyValue:YES forCharacteristic:characteristic];
   }
   //发送字符串'PD'机子关机(3个字节)
   else if([characteristic.UUID isEqual:BOOT_OUTSTRING_UUID]){
    _senddoutstrateristic = characteristic;
    [peripheral setNotifyValue:YES forCharacteristic:characteristic];
   }
   else{
    
   }
  }
 }
}


-(void)notifyCharacteristic:(CBPeripheral *)peripheral
    characteristic:(CBCharacteristic *)characteristic{
 [peripheral setNotifyValue:YES forCharacteristic:characteristic];
 [_centerManager stopScan];
}


-(void)cancelNotifyCharacteristic:(CBPeripheral *)peripheral
     characteristic:(CBCharacteristic *)characteristic{
 [peripheral setNotifyValue:NO forCharacteristic:characteristic];
}


- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error{
 //是否为Ota
 if(!self.isSendOta){
  if(self.readtempcharater == characteristic){
   NSString *tmpData = [self.cmUtil getTempTMWData:characteristic];
   if(tmpData!=nil){
    //开始处理数据
    NSArray *data = [tmpData componentsSeparatedByString:@","];
    TmpModel *tp = [[TmpModel alloc] init];
    tp.tmp = data[0];
    tp.max = data[1];
    tp.unit = data[2];
    //电量
    tp.bat = data[3];
    
    NSDictionary *tempDict = [NSDictionary dictionaryWithObject:tp forKey:@"tempData"];
    [[NSNotificationCenter defaultCenter] postNotificationName:@"tempNofiction" object:nil userInfo:tempDict];
    if([tp.bat isEqual:@"1"]){
     //低电量广播
     NSDictionary *LowDict = [NSDictionary dictionaryWithObject:tp forKey:@"lowData"];
     [[NSNotificationCenter defaultCenter] postNotificationName:@"lowNofiction" object:nil userInfo:LowDict];
    }
   }
  }
 }

//======================写入数据区块========================//


-(void)writeIntervalTime:(NSString *)value periperalData:(CBPeripheral*)periperal{
 if(value!=nil&&periperal!=nil&&self.sendtimecharater!=nil){
  [self writeData:value forCharacteristic:self.sendtimecharater periperalData:periperal];
 }
}


-(void)writeTmpUnit:(NSString*)value periperalData:(CBPeripheral*)periperal{
 if(value!=nil&&periperal!=nil&&self.sendunitcharater!=nil){
  [self writeData:value forCharacteristic:self.sendunitcharater periperalData:periperal];
 }
}


-(void)writeCalValue:(NSString *)value periperalData:(CBPeripheral*)periperal{
 if(value!=nil&&periperal!=nil&&self.sendcalcharater!=nil){
  [self writeData:value forCharacteristic:self.sendcalcharater periperalData:periperal];
 }
}



-(void)writeDfuValue:(NSString *)value periperalData:(CBPeripheral*)periperal{
 if(value!=nil&&periperal!=nil&&self.senddfucharater!=nil){
  [self writeData:value forCharacteristic:self.senddfucharater periperalData:periperal];
 }
}


-(void)writeClearValue:(NSString *)value periperalData:(CBPeripheral*)periperal{
 if(value!=nil&&periperal!=nil&&self.sendclearcharater!=nil){
  [self writeData:value forCharacteristic:self.sendclearcharater periperalData:periperal];
 }
}


-(void)writeCloseValue:(NSString *)value periperalData:(CBPeripheral*)periperal{
 if(value!=nil&&periperal!=nil&&self.sendclosecharater!=nil){
  [self writeData:value forCharacteristic:self.sendclosecharater periperalData:periperal];
 }
}



-(void)writeData:(NSString *)value forCharacteristic:(CBCharacteristic *)characteristic periperalData:(CBPeripheral*)periperal{
 NSData *data = [value dataUsingEncoding:NSUTF8StringEncoding];
 if(characteristic.properties & CBCharacteristicPropertyWriteWithoutResponse)
 {
  [periperal writeValue:data forCharacteristic:characteristic type:CBCharacteristicWriteWithoutResponse];
 }else
 {
  [periperal writeValue:data forCharacteristic:characteristic type:CBCharacteristicWriteWithResponse];
 }
}

此篇文章阐述到这,基本BLE蓝牙开发实现都详细的描述了。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程网。

--结束END--

本文标题: IOS Ble蓝牙开发实现方法

本文链接: https://www.lsjlt.com/news/30419.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • IOS Ble蓝牙开发实现方法
    本篇博文阐述如何开发Ble蓝牙。在蓝牙中的一些常见服务,扫描,以及链接; 主蓝牙类文件.h 主蓝牙类文件.m UUID文件 蓝牙列表展示的文件 一:引入Bl...
    99+
    2022-05-30
    IOS Ble 蓝牙
  • 分享Android 蓝牙4.0(ble)开发的解决方案
    最近,随着智能穿戴式设备、智能医疗以及智能家居的普及,蓝牙开发在移动开中显得非常的重要。由于公司需要,研究了一下,蓝牙4.0在Android中的应用。 以下是我的一些总结。 1...
    99+
    2022-06-06
    ble 解决方案 Android 蓝牙
  • iOS蓝牙开发数据实时传输
    随着iOS项目开发  很多app需要通过蓝牙与设备连接 蓝牙开发注意: 先定义中心设备和外围设备以及遵守蓝牙协议 @interface ViewController()...
    99+
    2022-06-02
    iOS 蓝牙 数据传输
  • android蓝牙简单开发的方法是什么
    本篇内容介绍了“android蓝牙简单开发的方法是什么”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!概述前段时间学习了一些蓝牙开发的知识,记...
    99+
    2023-06-21
  • AndroidBLE蓝牙开发之实现扫码枪基于BLESSED开发
    目录一、蓝牙模式HID与BLE二、BLE协议白话三、第三方库 BLESSED for Android的使用一、蓝牙模式HID与BLE 当扫码枪与手机连接时,通常采用的是蓝牙HID(H...
    99+
    2022-11-13
  • iOS开发中实现显示gif图片的方法
    我们知道Gif是由一阵阵画面组成的,而且每一帧画面播放的时常可能会不相等,观察上面两个例子,发现他们都没有对Gif中每一帧的显示时常做处理,这样的结果就是整个Gif中每一帧画面都是以...
    99+
    2022-05-19
    ios gif
  • 微信小程序开发中如何实现开始搜寻附近的蓝牙外围设备
    这篇文章主要为大家展示了微信小程序开发中如何实现开始搜寻附近的蓝牙外围设备,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带大家一起来研究并学习一下“微信小程序开发中如何实现开始搜寻附近的蓝牙外围设备”这篇文章吧。开始搜寻附近...
    99+
    2023-06-26
  • iOS开发教程之APP内部切换语言的实现方法
    前言 相信大家在iOS开发中都遇到了一个问题,随着APP越来越完善,很多APP都做了国际化,也实现了APP内部切换语言。那么如何实现的呢?下面来一起看看详细的介绍吧 原理 国际...
    99+
    2022-05-16
    ios app 语言
  • iOS开发实战之Label全方位对齐的轻松实现
    前言 本文主要给大家介绍了关于iOS Label全方位对齐的实现方法,分享出来供大家参考学习,下面话不多说了,来一起看看详细的介绍吧 ARUILabelTextAlign 实现 ...
    99+
    2022-05-19
    ios label 对齐
  • Android开发之动画实现方法
    本文实例讲述了Android开发之动画实现方法。分享给大家供大家参考。具体分析如下: 动画分为三种: 逐帧动画、布局动画和控件动画 控件动画实现 通过重写Animation的 ...
    99+
    2022-06-06
    方法 android开发 动画 Android
  • SpringCloud协同开发实现方法浅析
    目录微服务注册问题微服务间调用问题前后端联调问题相比Springboot开发,SpringCloud开发要复杂的多,因为涉及服务的注册发现,多个微服务模块间的调用等。 最简单的解决方...
    99+
    2022-12-27
    SpringCloud协同开发 SpringCloud协同
  • Android开发实现图片圆角的方法
    本文讲述了Android开发实现图片圆角的方法。分享给大家供大家参考,具体如下: Bitmap myCoolBitmap = ... ; // <-- Your bit...
    99+
    2022-06-06
    方法 图片 android开发 Android
  • php二次开发的实现方法是什么
    在PHP二次开发中,有许多不同的实现方法可以使用。以下是一些常见的实现方法:1. 使用框架:使用现有的PHP框架,如Laravel、...
    99+
    2023-08-24
    php
  • Android开发中实现一个弹出框的方法
    本篇文章给大家分享的是有关Android开发中实现一个弹出框的方法,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。截图:动画效果介绍:点击ActionBar上“+”按钮,菜单从上...
    99+
    2023-05-31
    android roi
  • vs2019+cmake实现Linux远程开发的方法步骤
    在上一篇文章中我们介绍了使用vs2019作为远程Linux系统的开发环境,但我们是创建的传统的sln项目,而对于Linux开发者来说以autotools或是cmake进行项目结构的组织更为简单直观,也符合在Linux...
    99+
    2022-06-03
    vs2019 Linux远程开发 vs2019 cmake Linux
  • Android开发悬浮按钮 Floating ActionButton的实现方法
    一、介绍 这个类是继承自ImageView的,所以对于这个控件我们可以使用ImageView的所有属性 android.support.design.widget.Flo...
    99+
    2022-06-06
    方法 android开发 按钮 Android
  • python开发之thread实现布朗运动的方法
    本文实例讲述了python开发之thread实现布朗运动的方法。分享给大家供大家参考,具体如下: 这里我将给大家介绍有关python中thread来实现布朗运动的一个例子 下面是运行效果: 代码部分: ...
    99+
    2022-06-04
    布朗运动 方法 python
  • Android开发简单实现摇动动画的方法
    本文实例讲述了Android开发简单实现摇动动画的方法。分享给大家供大家参考,具体如下:先创建shake.xml<?xml version="1.0" encoding="utf-8"?><translat...
    99+
    2023-05-30
    android 动画 画的
  • Go语言开发实现机器学习算法的方法与实践
    Go语言是一种简洁、快速和高效的编程语言,其在网络开发和服务器编程方面广泛应用。然而,随着人工智能和机器学习的迅猛发展,很多开发者开始关注如何在Go语言中实现机器学习算法。本文将介绍一些在Go语言中开发和实现机器学习算法的方法与实践。首先,...
    99+
    2023-11-20
    机器学习 实践 Go语言
  • Android开发中实现手势识别功能的方法
    Android开发中实现手势识别功能的方法?相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。触摸交互中的概念常用事件首先要了解一些常用的事件: ACTION_DOWN:第一个手指按...
    99+
    2023-05-31
    android roi
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作