UIImagePickerController 限制选择视频文件

#import <MobileCoreServices/MobileCoreServices.h>

    UIImagePickerController *videoCapture = [[UIImagePickerController alloc] init];
    NSArray *availableTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
    if ([availableTypes containsObject:(__bridge NSString *)kUTTypeMovie]) {
        [videoCapture setMediaTypes:@[(__bridge NSString *)kUTTypeMovie)]];
    }

NIB 文件加载过程

Alt none

ref: 《iOS编程v4》

Xcode6 找回 Empty Application 模版

Alt none

Xcode6取消了 “Empty Application”的模版,但是有时候我们还是有创建”Empty Application”的需求,可以按如下步骤来实现:

  • 删除ViewController.h和ViewController.m文件
  • 删除Main.storyboard
  • 删除LaunchScreen.xib

经过以上步骤后,你会发现编译失败,因为找不到Main.storyboard,我们还需要修改一下

info.plist中的配置:

Alt none

删除Main storyboard file base name 后再次编译,这次可以成功运行,但是屏幕显示的是黑屏。

打开AppDelegate.m修改application:didFinishLaunchingWithOptions:方法:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
 
    return YES;
}

Android 设置 Keyguard 默认 Widget

OS: Android 4.4


``` xml
<string name="widget_default_package_name">net.lnmcc.mywidget</string>
<string name="widget_default_class_name">net.lnmcc.mywidget</string>

Android Makefile 引用第三方库

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-subdir-Iaidl-files)

LOCAL_JAVA_LIBRARIES := services telephony-common

LOCAL_STATIC_JAVA_LIBRARIES := MyLib

LOCAL_PACKAGE_NAME := Keyguard

LOCAL_CERTIFICATE := platform

LOCAL_PRIVILEGED_MODULE := true

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

include $(BUILD_PACKAGE)

include $(CLEAR_VARS)

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := MyLib:libs/mylib-v8.jar

include $(BUILD_MULTI_PREBUILT)