Android平台中关于音频播放有以下三种方式: 1.SoundPool ---- 适合短促且对反应速度比较高的情况(游戏音效或按键声等) 2.MediaPlayer ---- 适合比较长且时间要求不高的情况 3.AudioTrack ---- 播放解码后的PCM码流 方法一:SoundPool 1
分类:
移动开发 时间:
2016-02-22 19:16:26
阅读次数:
390
## iOS 处理方法中的可变參数 近期写了一个自己定义的对话框的demo,想模仿系统的UIAlertView的实现方式。对处理可变參数的时候,遇到了小问题,于是谷歌了一下。写下了处理问题的方法。记录下来,以备后需。 代码实现 - (instancetype)initWithTitle:(NSStr
分类:
移动开发 时间:
2016-02-22 19:13:06
阅读次数:
249
本实例通过TimePickerDialog时间选择对话框让用户设置闹钟。并通过AlarmManager全局定时器在指定的时间启动闹钟Activity 。 程序执行效果图: 实例代码: package com.jph.alarm.test; import java.util.Calendar; imp
分类:
移动开发 时间:
2016-02-22 19:12:49
阅读次数:
279
1. 图片放在sdcard中 Bitmap imageBitmap = BitmapFactory.decodeFile(path) (path 是图片的路径,跟目录是/sdcard) 2. 图片在项目的res文件夹下面 //得到application对象 ApplicationInfo appIn
分类:
移动开发 时间:
2016-02-22 19:11:41
阅读次数:
151
#ifdef __OBJC__ #import "UIButton+Block.h" #endif // 加入这两句在中间引入头文件
分类:
移动开发 时间:
2016-02-22 19:07:19
阅读次数:
156
转自:http://www.cnblogs.com/supercheng/archive/2012/12/05/2804166.html- (BOOL)isJailbroken { BOOL jailbroken = NO; NSString *cydiaPath = @"/Applications
分类:
移动开发 时间:
2016-02-22 19:03:26
阅读次数:
168
SimpleUrlHandlerMapping只是参与Handler的注册,请求映射时由AbstractUrlHandlerMapping搞定.
分类:
移动开发 时间:
2016-02-22 19:03:02
阅读次数:
255
参考博文地址:http://my.oschina.net/u/2340880/blog/485095?fromerr=bgjLq4Mw 一、粒子发射器 iOS中的粒子效果有两部分组成,一部分为发射器,设置例子发射的宏观属性,另一部分是粒子单元,用于设置相应的粒子属性。粒子发射器是基于Layer层,他
分类:
移动开发 时间:
2016-02-22 18:56:36
阅读次数:
268
1 import android.app.Activity; 2 import android.content.Context; 3 import android.hardware.Sensor; 4 import android.hardware.SensorEvent; 5 import and
分类:
移动开发 时间:
2016-02-22 17:49:16
阅读次数:
259
在其它站点看到的,Mark一下 1、近期打开的应用不在近期任务列表中显示 android:excludeFromRecents="true" 设置为true,则排除在近期任务列表之外,不在近期任务列表中显示 2、推断一个一个String str 是否为NULL或者是否为空字符串 TextUtils.
分类:
移动开发 时间:
2016-02-22 17:39:41
阅读次数:
184
写在前面 本文翻译自 Android Studio Tips by Philippe Breault,一共收集了62个 Android Studio 使用小技巧和快捷键。 根据这些小技巧的使用场景,本文将这62个小技巧分为常用技巧(1 – 28)、编码技巧(29 – 49)和调试技巧(50 – 62
分类:
移动开发 时间:
2016-02-22 17:40:20
阅读次数:
223
一、简介 二、代码1.java (1)MainActivity.java 1 import android.app.Activity; 2 import android.content.Context; 3 import android.hardware.Sensor; 4 import andro
分类:
移动开发 时间:
2016-02-22 17:35:44
阅读次数:
183
#import <UIKit/UIKit.h> @interface ELCUIApplication : UIApplication { NSTimer *_idleTimer; NSInteger timeCount; } @end #import "ELCUIApplication.h" @i
分类:
移动开发 时间:
2016-02-22 17:35:37
阅读次数:
199
关于iOS中提示框的使用在iOS8的SDK里,已经对提示框进行了更改,现在属于 UIAlertController,其接口如下声明NS_CLASS_AVAILABLE_IOS(8_0) @interface UIAlertController : UIViewController,不再是一个UIVi
分类:
移动开发 时间:
2016-02-22 17:32:26
阅读次数:
128
1、写入(本地) NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *path=[paths objectAtIndex:0]; NSStr
分类:
移动开发 时间:
2016-02-22 17:27:56
阅读次数:
187
关于iOS含有如下宏定义的 UI_APPEARANCE_SELECTOR; 的方法 ,不知道你是否知道其真正的意义。当你给你的navigationBar设置BarTintColor时,你可以使用2种方法(当然只有在iOS7以后在有BarTintColor方法)@property(nonatomic,
分类:
移动开发 时间:
2016-02-22 17:13:25
阅读次数:
184