1. 导入HealthKit框架

#import <HealthKit/HealthKit.h>

2. 判断设备是否支持HealthKit

  1. HealthKit是iOS8加入的API
  2. HealthKit在iPad上不可用
通过HKHealthStore类方法 + (BOOL)isHealthDataAvailable;判断设备是否支持HealthKit
BOOL isSupport = [HKHealthStore isHealthDataAvailable];

3. HKHealthStore初始化,请求用户授权

HealthKit框架核心是HkHealthStore类,主要对数据进行操作

通过requestAuthorizationToShareTypes:readTypes:completion:方法来请求HealthKit数据的权限。对每种类型的数据,都必须请求许可来共享和读取。
HKHealthStore *healthStore = [[HKHealthStore alloc] init];
NSSet *shareType = [NSSet setWithObject:[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount]];
NSSet *readType = [NSSet setWithObject:[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount]];
[healthStore requestAuthorizationToShareTypes:shareType readTypes:readType completion:^(BOOL success, NSError * _Nullable error) {
}];
  • 1.第一个参数传入一个NSSet类型数据,告知用户,我的App可能会修改你健康数据库中的这些选项数据。
  • 2.第二个参数也是传入NSSet类型数据,告知用户,我的App可能会从你的数据库中读取以下几项数据。
  • 3.第三个是授权许可回调BOOL值success用于区分是否授权成功(仅用于判断系统是否支持HealthKit),而不是判断用户是允许OR不允许

4. HKSampleType样本类型

样本可以细分为五个样本类型,样本的获取调用HKObjectType类中的方法

1. 数量样本(HKQuantityType)

这种样本代表一些可以存储为数值的数据。

调用 + quantityTypeForIdentifier: 方法,样本类型获取
[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount];
  • 身体测量
    1. HKQuantityTypeIdentifierBodyMassIndex  身高体重指数
    2. HKQuantityTypeIdentifierBodyFatPercentage 体脂率
    3. HKQuantityTypeIdentifierHeight 身高
    4. HKQuantityTypeIdentifierBodyMass 体重
    5. HKQuantityTypeIdentifierLeanBodyMass 去脂体重
  • 健身数据
    1. HKQuantityTypeIdentifierStepCount  步数
    2. HKQuantityTypeIdentifierDistanceWalkingRunning 步行+跑步距离
    3. HKQuantityTypeIdentifierDistanceCycling 骑车距离
    4. HKQuantityTypeIdentifierBasalEnergyBurned 静息能量
    5. HKQuantityTypeIdentifierActiveEnergyBurned 活动能量
    6. HKQuantityTypeIdentifierFlightsClimbed 已爬楼层 //不允许share
    7. HKQuantityTypeIdentifierNikeFuel NikeFuel
    8. HKQuantityTypeIdentifierAppleExerciseTime 锻炼分钟数健身数据
  • 主要特征
    1. HKQuantityTypeIdentifierHeartRate 心率
    2. HKQuantityTypeIdentifierBodyTemperature 体温
    3. HKQuantityTypeIdentifierBasalBodyTemperature 基础体温
    4. HKQuantityTypeIdentifierBloodPressureSystolic 收缩压
    5. HKQuantityTypeIdentifierBloodPressureDiastolic 舒张压
    6. HKQuantityTypeIdentifierRespiratoryRate 呼吸速率
  • 数据结果
    1. HKQuantityTypeIdentifierOxygenSaturation  血氧饱和度
    2. HKQuantityTypeIdentifierPeripheralPerfusionIndex 末梢灌注指数
    3. HKQuantityTypeIdentifierBloodGlucose 血糖
    4. HKQuantityTypeIdentifierNumberOfTimesFallen 摔倒次数
    5. HKQuantityTypeIdentifierElectrodermalActivity 皮电活动
    6. HKQuantityTypeIdentifierInhalerUsage 吸入剂用量
    7. HKQuantityTypeIdentifierBloodAlcoholContent 血液酒精浓度
    8. HKQuantityTypeIdentifierForcedVitalCapacity 最大肺活量|用力肺活量
    9. HKQuantityTypeIdentifierForcedExpiratoryVolume1 第一秒用力呼气量
    10.HKQuantityTypeIdentifierPeakExpiratoryFlowRate 呼气流量峰值
  • 营养摄入
    1. HKQuantityTypeIdentifierDietaryFatTotal 总脂肪
    2. HKQuantityTypeIdentifierDietaryFatPolyunsaturated 多元不饱和脂肪
    3. HKQuantityTypeIdentifierDietaryFatMonounsaturated 单元不饱和脂肪
    4. HKQuantityTypeIdentifierDietaryFatSaturated 饱和脂肪
    5. HKQuantityTypeIdentifierDietaryCholesterol 膳食胆固醇
    6. HKQuantityTypeIdentifierDietarySodium 钠
    7. HKQuantityTypeIdentifierDietaryCarbohydrates 碳水化合物
    8. HKQuantityTypeIdentifierDietaryFiber 纤维
    9. HKQuantityTypeIdentifierDietarySugar 膳食糖
    10.HKQuantityTypeIdentifierDietaryEnergyConsumed 膳食能量
    11.HKQuantityTypeIdentifierDietaryProtein 蛋白质
    12.HKQuantityTypeIdentifierDietaryVitaminA 维生素 A
    13.HKQuantityTypeIdentifierDietaryVitaminB6 维生素 B6
    14.HKQuantityTypeIdentifierDietaryVitaminB12 维生素 B12
    15.HKQuantityTypeIdentifierDietaryVitaminC 维生素 C
    16.HKQuantityTypeIdentifierDietaryVitaminD 维生素 D
    17.HKQuantityTypeIdentifierDietaryVitaminE 维生素 E
    18.HKQuantityTypeIdentifierDietaryVitaminK 维生素 K
    19.HKQuantityTypeIdentifierDietaryCalcium 钙
    20.HKQuantityTypeIdentifierDietaryIron 铁
    21.HKQuantityTypeIdentifierDietaryThiamin 硫铵
    22.HKQuantityTypeIdentifierDietaryRiboflavin 核黄素
    23.HKQuantityTypeIdentifierDietaryNiacin 烟酸
    24.HKQuantityTypeIdentifierDietaryFolate 叶酸
    25.HKQuantityTypeIdentifierDietaryBiotin 生物素
    26.HKQuantityTypeIdentifierDietaryPantothenicAcid 泛酸
    27.HKQuantityTypeIdentifierDietaryPhosphorus 磷
    28.HKQuantityTypeIdentifierDietaryIodine 碘
    29.HKQuantityTypeIdentifierDietaryMagnesium 镁
    30.HKQuantityTypeIdentifierDietaryZinc 锌
    31.HKQuantityTypeIdentifierDietarySelenium 硒
    32.HKQuantityTypeIdentifierDietaryCopper 铜
    33.HKQuantityTypeIdentifierDietaryManganese 锰
    34.HKQuantityTypeIdentifierDietaryChromium 铬
    35.HKQuantityTypeIdentifierDietaryMolybdenum 钼
    36.HKQuantityTypeIdentifierDietaryChloride 氯化物
    37.HKQuantityTypeIdentifierDietaryPotassium 钾
    38.HKQuantityTypeIdentifierDietaryCaffeine 咖啡因
    39.HKQuantityTypeIdentifierDietaryWater 水
    40.HKQuantityTypeIdentifierUVExposure 紫外线指数
2. 类别样本(HKCategoryType)

这种样本代表一些可以被分为有限种类的数据。

调用 + categoryTypeForIdentifier: 方法,样本类型获取
[HKObjectType categoryTypeForIdentifier:HKCategoryTypeIdentifierSleepAnalysis];
  • 生殖健康
    1. HKCategoryTypeIdentifierSleepAnalysis 睡眠分析
    2. HKCategoryTypeIdentifierCervicalMucusQuality 宫颈粘液质量
    3. HKCategoryTypeIdentifierOvulationTestResult 排卵测试结果
    4. HKCategoryTypeIdentifierMenstrualFlow 月经
    5. HKCategoryTypeIdentifierIntermenstrualBleeding 点滴出血
    6. HKCategoryTypeIdentifierSexualActivity 性行为 //不允许share
    7. HKCategoryTypeIdentifierAppleStandHour 站立小时
3. 特征样本(HKCharacteristicType)

这种样本代表一些基本不变的数据

调用 + characteristicTypeForIdentifier: 方法,样本类型获取
[HKObjectType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBiologicalSex];
  • 本人信息
    //不允许share
    1. HKCharacteristicTypeIdentifierBiologicalSex 性别
    2. HKCharacteristicTypeIdentifierBloodType 血型
    3. HKCharacteristicTypeIdentifierDateOfBirth 出生日期
    4. HKCharacteristicTypeIdentifierFitzpatrickSkinType 日光反应型皮肤类型
4. Correlation(HKCorrelationType)

这种样本代表复合数据,包含一个或多个样本

  • 样本类型不允许share和read(枚举)
    //不允许share And read
    1.HKCorrelationTypeIdentifierBloodPressure 血压
    2.HKCorrelationTypeIdentifierFood 食物
5. Workout(HKWorkoutType)

Workout代表某些物理活动,像跑步、游泳,甚至游戏。

调用 + workoutType 方法,样本类型获取
[HKObjectType workoutType];
枚举
1.HKWorkoutTypeIdentifier  体能训练
6. activitySummaryType(健身记录)获取

包含(活动,锻炼,站立)

调用 + activitySummaryType 方法,样本类型获取
[HKObjectType activitySummaryType];

转自:https://www.jianshu.com/p/10accd63cae7

不同的健康应用需求大致可以分为三种

1.统计分析 (Statistical Analysis)
2.允许用户输入设备(Enter Information)
3.允许来自第三方的设备数据(Application From Health Providers)
为此,apple开发了Healthkit来处理这些需求

1. Data in HealthKit

在不同的国家,对同一个概念有着不同的度量单位。所以在HealthKit中,提出了HKUnit的概念。他就是为了帮助开发者做单位转换的。HKUnit代表了一个在度量标准或单位系统中的特定单位

1.1 HKUnit
HKUnit *g = [HKUnit gramUnit]; //克
HKUnit *dL = [HkUnit literUnitWithMetricPrefix:HKMetricPrefixDeci];//分升
HKUnit *gPerdL = [g unitDivideByUnit:dL]; // 克/分升 g/dL
//对于复杂的组合单位,也可以使用这种方式创建
HKUnit *gPerdL = [HKUnit unitFromString:@"g/dL"];
1.2 HKQuantity

他可以用于进行单位转换

HKUnit *gramUnit = [HKUnit gramUnit];
HKQuantity *grams = [HKQuantity quantityWithUnit:gramUnit doubleValue:20]; //20克
double kg = [grams doubleValueForUnit:[HKUnit unitFormString:@"kg"]];//转换为了0.02kg

但是不是所有的单位都是可以这样进行转换的,如果转化为一个不兼容的单位时,就会报错。所以我们可以使用下面的方法进行预判断。

BOOL kgCompatible = [grams isCompatibleWithUnit:[HKUnit unitFromString:@"kg"]]; // YES
BOOL kgCalComtible = [grams isCompatibleWithUnit:[HKUnit kilocalorieUnit]]; // NO

也就是说HKQuantity就是带有单位的数量值

1.3 HKObjectType

Object types代表了HealthKit中的所有数据类型。在HealthKit中有超过60种类型,大多数的类型都会整合到他自己类中。所有的这些类,都是继承于HKObjectType。所有的类分为两个基本大类。(1)HKCharacteristicType:他代表一种不会改变的一些类型,比如生日、性别等。(2)HKSampleType:代表会随时间改变的类型,它们能在一定特定的时间点里获取的到类型的样本。在这个类型下面又分为两种类型
1>HKQuantityType ,比如血压
2>HKCategoryType,代表可以分类的类型,比如睡眠分析。具体结构如图1

 
图1.png

KHObjectType的创建:每一种类型都有的他自己的identifier。当然你不能创建自己的objectType和对应的identifier。但是我们可以理解下他的构造规则。

HKQuantityTypeIdentifierHeartRate
HKQuantityTypeIdentifier:代表他属于那种类型的数据
HeartRate :代表他的名字

只要你有了某个类型的identifier,你就可以使用构造方法进行创建

+(HKQuantityType *)quantityTypeForIdentifier:(NSString   *)identifier;
+(HKCategoryType *)categoryTypeForIdentifier:(NSString *)identifier;
+(HKCharacteristicType *)characteristicTypeForIdentifier:(NSString *)identifier;
//显然三种构造方法,对应了三种不同的类型
1.4 HKObject

在HealthKit中的所有存储数据都是HKObject的子类,具体结构如下图2

 
图2

HKQuantitySample有quantityType和quantity两个属性。qantityType代表了这个对象数据属于那种类型,quantity代表了具体的数值和单位。quantity的单位和quantityType需要匹配。每一个quantity type都对应了一种特定的单位。如果没有对应,则会抛出异常。如图3

 
图3.png

HKCategorySample和HKQuantitySample类似,他也有categoryType代表他属于那种类型的数据,同时他有value值。这里要记住categoryType是一种可以的数值都是可以被枚举出来的。所以,每种类型都有一套对应的枚举值,value值必须对应其中的一个数值,如果一种出现了异常的数值,就会报错。见图4

 
图4.png

这些类型都是继承自HKSample,因为sample一种可以在特定时间进行取样的的数据,所以,他有startDate和endDate。对于有些数据,比如果你想获取体重这种及时性非常高的值(总不能获取一段时间的体重吧),所以他的startDate和endDate是相同的,而对于那种读取一定时间内的数值的数据类型,他们的startDate和endDate会不一样。每种sample也都有sampleType属性,他的实际类型和子类的type类型相同。如图5

 
图5.png

以上者这些都是继承于HKObject类型,每个Objec类型都有一个UUID类型的属性,他是这个sample的唯一标识。他也有source属性,他记录了数据的来源。metadata对象是NSDictionary类型的属性,所以可以在里面存放任何你想存放的数据,这个属性主要是为了扩展准备的。苹果也开发者准备了一些metadatakey。如图6

 
图6.png

Create an HKObject

NSString * identifier = HKQuantityTypeIdentifierBodyTemperature;
HKquantityType * tempType = [HKObjectType quantityTypeForIdentifier:identifier];
HKQuantity * myTemp = [HKQuantity quantityWithUnit: [HKUnit degreeFahrenheiUnit] doubleValue:98.6];
NSDictionary *meta = @{HKMetadataKeyBodyTemperatureSensorLocation : @(HKBodyTemperatureSensorLocationEar)};
HKQuantitySample *temperatureSample = [HKQuantitySample quantitySampleWithType:tempType
quantity:myTemp
startDate:[NSDate date]
endDate:[NSDate date]
metadate:meta];

</br>

2. Save Data

self.store = [[HKHealthStore alloc] init];
...
HKQuantitySample *mySample = [self newSample];
[self.store saveObject:mySample withCompletion:^(BOOL success,NSError *error){
if (success) {
NSLog(@"object saved!");
}
}];

</br>

3 Ask For Data

3.1 Characteristics

前面讲到,HKCharacteristicType是一种基本不变的数据类型,所以我们可以直接去获取对应的数据,比如,生日、血型等

NSError *error;
NSDate *dateOfBirth = [self.store dateOfBirthWithError:&error];
3.2 Queries

所有的Query都继承自HKQuery

@interface HKQuery
//注定要检索的数据类型
@property (readonly) HKSampleType *sampleType
//过滤返回的数据
@Property (readonly) NSPredicate *predicate
@end
创建Predicate的几种方式
//1.直接是使用构造方法
[NSPredicate predicateWithFormat:@"%K > %@", HKPredicateKeyPathQuantity,weight]; //2.更加简便的方式
NSPredicateOperatorType greaterThan = NSGreaterThanPredicateOperatorType;
[HKQuery perdicateForQuantitySampleWithOperatorType:greaterThan
quantity:weight];
3.2.1 HKSampleQuery

Limit:每个query都有个limit值,他指定了请求返回值的数量,如果你不想限制检索的结果,你可以设置limit值为HKObjectQueryNoLimit。
Sort Order:决定返回的数据的排列顺序的数组。

//Code demo
HKQuantityType *bloodSugar = ...
NSString *endKey = HKSampleSortIdentifierEndDate;
NSSortDescriptor *endDate = [NSSortDescriptor sortDescriptorWithKey:endKey ascending:NO];
HKSampleQuery *query = [[HKSampleQuery alloc] initWithSampleType:bloodSugar
perdicate:nil
sortDescriptor:@[endDate]
resultsHandle:^(HKSampleQuery * query,
NSArray *results,
NSError *error)
{
HKQuantitySample *sample = [results lastObject];
NSLog(@"Sample: %@",sample);
}]
3.2.2 HKObserverQuery

他会监听数据库中的数据改变。所以当一个新的数据被添加或移除的时候都会被调用。

HKQuantityType *bloodSugar = ...
HKObserverQuery *query;
query = [HKObserveQuery alloc] initWithSampleType:bloodSugar
perdicate:nil
updateHandler:^(HKObserverQuery *query,
HKObserverCompletionHandler handler,
NSError *error)
{
NSLog(@"Updated");
}
3.2.3 HKAnchoredObectQuery

Anchor是你见的最后一条数据,当anchor为0时,表示还没有设置anchor,当每一次回调的时候会返回给你一个新的anchor

self.lastAnchor = 0
...
HKQuantityType *bloodSugar = ...
HKAnchoredObjectQuery *query;
query = [[HKAnchoredObjectQuery alloc] initWithType:bloodSugar
perdicate:nil
anchor:self.lastAnchor
limit:HKObjectQueryLimit
completionHandler:^(HKAnchoredObjectQuery *query,
NSArray *results,
NSUInter newAnchor,
NSError *error)
{
self.lastAnchor = newAnchor;
}];

</br>

4. executeQuery

@interface HKHealthStore: NSObject
- (void)executeQuery:(HKQuery *)query;
- (void)stopQuery:(HKQuery *)query;
@end

stopQuery方法可以在任何时候调用,他回取消当前的检索操作,并阻止其回调。你可以调用任意次数的stopQuery,但是只能在上一个query结束前,调用一次query。通常情况下,检索执行一次就会停止。但是像ObserverQuery这样的long runing query(这里还是原文比较有味道)需要手动去停止。
</br>

5.Asking for Statistics

HKStatistics
一个HKStatistics对象是各种统计数据的集合,比如sum、min、max 和 average。
你可以统计所有的数据,或者只统计特定来源的数据
⚠️注意,Statstics只对quantity类型的数据有效。
这里将数据分为离散数据(discrete)和聚合数据(cumulative)
离散数据:比如身高、体重、血压等
聚合数据:比如步数、燃烧的脂肪量

区别:前者是单次取样获取的有效数据,后者是持续取样的到一段时间的累加的数据

HKStatisticsQuery

HKQuantityType *stepCount = ...
NSPredicate *today = ...
HKStatisticsOptions sumOptions = HKStaticsOptionCumulativeSum;
HKStatisticsQuery *query;
query = [HKStatisticsQuery alloc] initWithQuantityType:stepCount
quantitySamplePerdicate:today
options:sumOptions
completionHandler:^(HKStaticsQuery *query,
HKStatics *result,
NSError *error)
{
HKQuantity *sum = [result sumQuantity];
}

HKStaticsCollectiion

@interface HKStatisticsCollection:NSObject
- (NSArray *)statistics
- (HKStatistics *)statisticsForDate:(NSDate *)date;
- (void)enumberateStatisticsFromDate:(NSDate *)startDate
toDate:(NSDate *)endDate
block:(void(^)(HKStatistics *stats,BOOL *stop))block;
@end

</br>

6.Privacy and Permissions

//请求授权
- (void)requestAuthorizationToShareTypes:(NSSet *)typesToShare
readTypes:(NSSet *)typesToRead
completion:(void(^)(BOOL success, NSError *error))completion;
//监测授权情况
typedef NS_ENUM(NSInteger, HKAuthorizationStatus) {
HKAuthorizationStatusNotDetermined = 0,
HKAuthorizationStatusSharingDenied,
HKAuthorizationStatusSharingAuthorized,
} - (HKAuthrizationStatus)authorizationStatusForType: (HKObjectType *)type

</br>

7.Localization

NSFormatter 能帮助开发者进行本地化处理

NSnumberFormatter
NSDateFormatter
NSByteCountFormatter NSMassFormatter
NSLengthFormatter
NSEnergyFormatter
//Code demo
NSMassFormatter *formatter = [[NSMassFormatter alloc] init]
formatter.forPersonMassUse = YES; HKQuantity * weight = ...
double weightKg = [weight doubleValueForUnit:[HKUnit unitFromString:@"kg"]];
NSString *localizedString = [formatter stringFromKilograms:weightInKg];

转自:https://www.jianshu.com/p/349d599c1833

HealthKit详解的更多相关文章

  1. 《招一个靠谱的移动开发》iOS面试题及详解(下篇)

    iOS面试知识点 现在进入本篇的正题.本篇的面试题是我认为比较好的iOS开发基础知识点,希望大家看过这后在理解的基础上掌握而不是死记硬背.死记硬背很快也会忘记的. 1 iOS基础 1.1 父类实现深拷 ...

  2. Linq之旅:Linq入门详解(Linq to Objects)

    示例代码下载:Linq之旅:Linq入门详解(Linq to Objects) 本博文详细介绍 .NET 3.5 中引入的重要功能:Language Integrated Query(LINQ,语言集 ...

  3. 架构设计:远程调用服务架构设计及zookeeper技术详解(下篇)

    一.下篇开头的废话 终于开写下篇了,这也是我写远程调用框架的第三篇文章,前两篇都被博客园作为[编辑推荐]的文章,很兴奋哦,嘿嘿~~~~,本人是个很臭美的人,一定得要截图为证: 今天是2014年的第一天 ...

  4. EntityFramework Core 1.1 Add、Attach、Update、Remove方法如何高效使用详解

    前言 我比较喜欢安静,大概和我喜欢研究和琢磨技术原因相关吧,刚好到了元旦节,这几天可以好好学习下EF Core,同时在项目当中用到EF Core,借此机会给予比较深入的理解,这里我们只讲解和EF 6. ...

  5. Java 字符串格式化详解

    Java 字符串格式化详解 版权声明:本文为博主原创文章,未经博主允许不得转载. 微博:厉圣杰 文中如有纰漏,欢迎大家留言指出. 在 Java 的 String 类中,可以使用 format() 方法 ...

  6. Android Notification 详解(一)——基本操作

    Android Notification 详解(一)--基本操作 版权声明:本文为博主原创文章,未经博主允许不得转载. 微博:厉圣杰 源码:AndroidDemo/Notification 文中如有纰 ...

  7. Android Notification 详解——基本操作

    Android Notification 详解 版权声明:本文为博主原创文章,未经博主允许不得转载. 前几天项目中有用到 Android 通知相关的内容,索性把 Android Notificatio ...

  8. Git初探--笔记整理和Git命令详解

    几个重要的概念 首先先明确几个概念: WorkPlace : 工作区 Index: 暂存区 Repository: 本地仓库/版本库 Remote: 远程仓库 当在Remote(如Github)上面c ...

  9. Drawable实战解析:Android XML shape 标签使用详解(apk瘦身,减少内存好帮手)

    Android XML shape 标签使用详解   一个android开发者肯定懂得使用 xml 定义一个 Drawable,比如定义一个 rect 或者 circle 作为一个 View 的背景. ...

随机推荐

  1. yarn Fairscheduler与Capacityscheduler

    Capacityscheduler Capacityscheduler允许多个组织共享整个集群,每个组织可以获得集群的一部分计算能力.通过为每个组织分配专门的队列,然后再为每个队列分配一定的集群资源, ...

  2. 什么是ICE (Internet Communications Engine)

    http://user.qzone.qq.com/77811970 直接在google上搜索ICE,出来的结果并不多,所以很多人就认为ICE是个神秘的东西,其实,国内已经有很多大型应用在使用ICE了. ...

  3. java中数组的复制

    数组复制使我们在编程过程中经常要使用到的,在java中数组复制我们大概能够分为两种,一种是引用复制,还有一种就是深度复制(复制后两个数组互不相干). 以下我们就通过測试的方法来具体看看什么是引用复制和 ...

  4. RxJava操作符总结之过滤

    RxJava操作符总结之过滤 jsut() just(T t1, T t2, T t3 ....) ,just能够传入多个同样类型的參数,并将当前參数一个接着一个的发送. Observable.jus ...

  5. SQLite使用事务

    关键代码 SQLiteDatabase db = myDataHelper.getWritableDatabase(); // 开启事务 db.beginTransaction(); try{ db. ...

  6. mui 本地打包

    第一步:下载HBuilder离线打包Android版SDK 网址:http://ask.dcloud.net.cn/article/38 第二步:导入项目 启动带ADT的eclipse程序,菜单中选择 ...

  7. 打造Android万能上拉下拉刷新框架--XRefreshView(三)

    转载请注明出处:http://blog.csdn.net/footballclub/ 打造Android万能上拉下拉刷新框架–XRefreshView(一) 打造Android万能上拉下拉刷新框架–X ...

  8. .NET CORE 2.0小白笔记(四):asp.net core输出中文乱码的问题

    问题描述:在学习asp.net core的时候,尝试在控制台,或者页面上输出中文,会出现乱码的问题. 分析解决:控制台乱码的原因是因为中文windows命令行默认编码页是gb2312,想输出中文只要把 ...

  9. 用Android Studio 执行ndk 程序

    近期准备研究一下android双进程守护,因为此前用eclipse 写jni习惯了.如今主要用as 工具.在此也试着写个demo 然后在对双进程守护进行研究 1.所需工具 android studio ...

  10. DuiVision开发教程(18)-弹出窗

    DuiVision的弹出窗体类CDlgPopup,是菜单.下拉列表等控件的父类,也能够单独使用,用于创建弹出窗体.弹出窗体默认是非激活状态下自己主动关闭,比如鼠标点击到弹出窗体外面的区域,弹出窗体就会 ...