当前位置:  编程技术>移动开发
本页文章导读:
    ▪ipad课程        ipad教程 http://www.mecil9.com/archives/catalog/40/default.aspx ......
    ▪ 摘引navigationController对象        引用navigationController对象   我以前在一个controller中引用一个naviController总是要通过delegate来取得:   [[[[UIApplication sharedApplication] delegate ] naviController] pushViewController: printView animated:TRUE];     今.........
    ▪ 在OpenSuSE上编译CyanogenMod全过程(备考版)       在OpenSuSE上编译CyanogenMod全过程(备注版) 在OpenSuSE12.1RC2下编译CyanogenMod的全过程,主要是按照官方的文档操作,增加了注意事项和异常处理(绿色粗体部分),欢迎交流。 原文链接:http://wi.........

[1]ipad课程
    来源: 互联网  发布时间: 2014-02-18
ipad教程
http://www.mecil9.com/archives/catalog/40/default.aspx

    
[2] 摘引navigationController对象
    来源: 互联网  发布时间: 2014-02-18
引用navigationController对象

 

我以前在一个controller中引用一个naviController总是要通过delegate来取得:

 

[[[[UIApplication sharedApplication] delegate ] naviController] pushViewController: printView animated:TRUE];

 

 

今天在源代码中发现有注释是这样的:

 

@property(nonatomic,readonly,retain) UINavigationController *navigationController; // If this view controller has been pushed onto a navigation controller, return it.
 

发现在控制器中就直接有这个对象属性了:

 

[self.navigationController pushViewController: printView animated:TRUE];

 

[self.navigationController presentModalViewController:self.worldCitiesListNavigationController animated:YES];

 

不知道的东西太多了。


    
[3] 在OpenSuSE上编译CyanogenMod全过程(备考版)
    来源: 互联网  发布时间: 2014-02-18
在OpenSuSE上编译CyanogenMod全过程(备注版)

在OpenSuSE12.1RC2下编译CyanogenMod的全过程,主要是按照官方的文档操作,增加了注意事项和异常处理(绿色粗体部分),欢迎交流。

原文链接:http://wiki.cyanogenmod.com/wiki/Android_SDK_Emulator:_Compile_CyanogenMod_(Linux)

 

Android SDK Emulator: Compile CyanogenMod (Linux)

How to compile CyanogenMod for the Android Emulator.

This how-to was written for Ubuntu 10.04 & Ubuntu 10.10, Android Emulator r08, CyanogenMod 7.x (Gingerbread), on 2 February 2011.

Contents  [hide]
  • 1 Prepare the Build Environment
    • 1.1 Install the ADB
    • 1.2 Install the Build Packages
    • 1.3 Create the Directories
    • 1.4 Install the Repository
  • 2 Download RomManager
  • 3 Building CyanogenMod
    • 3.1 Check for updates
    • 3.2 Configure Build
    • 3.3 Compile
  • 4 Install
Prepare the Build Environment NOTE: You only need to do these steps the first time you build. If you previously prepared your build environment, skip to Download RomManager. NOTE: 在准备开工之前,请务必确保硬盘工作空间不少于20G(最低不能低于15G),且不能是VFAT或NTFS格式。 Install the ADB Install the Android SDK. Install the Build Packages

Install using the package manager of your choice:

For 32-bit & 64-bit systems:

git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtools

NOTE:

FOR OPENSUSE : bison flex gperf schedtool squashfs libesd-devel build libSDL-devel gcc-c++ java-1_6_0-sun java-1_6_0-sun-devel

For 64-bit only systems:

g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib

Note: On Ubuntu 10.10, and variants, you need to enable the parter repository to install sun-java6-jdk:

add-apt-repository "deb http://archive.canonical.com/ maverick partner" Create the Directories

You will need to set up some directories in your build environment.

To create them:

mkdir -p ~/bin mkdir -p ~/android/system Install the Repository

Enter the following to download make executable the "repo" binary:

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo chmod a+x ~/bin/repoNOTE: You may need to reboot for these changes to take effect.

Now enter the following to initialize the repository:

cd ~/android/system/ repo init -u http://github.com/CyanogenMod/android.git -b gingerbread repo sync -j16
NOTE: 1、完整下载约5G多,下载过程不能断网; 2、实际表明,使用http连接方式获取代码更佳; 3、如果下载过程断链出错退出,或者手动kill过python进程,在执行sync之前需要删除临时文件: find .repo/ -name tmp* -exec rm {} \; 4、如果下载完成,长时间等待下面提示时;  Fetching projects: 98% (208/211)   则需要kill掉python进程,去掉 -j16 参数再次同步 repo sync 5、如果下载过程中报某个目录一直出错,则需删除该目录再同步 6、如果想少下载一些文件,则可以不下载针对具体设备的代码(可以减少下载2G左右的内容),方法如下: a. repo init 执行完毕后,编辑 .repo/manifest.xml 文件,注释掉device相关的projiect,如下
  <project path="dalvik" name="CyanogenMod/android_dalvik" />
  <project path="development" name="CyanogenMod/android_development" />
  <project path="device/common" name="CyanogenMod/android_device_common" />
  <project path="device/sample" name="CyanogenMod/android_device_sample" />
 <!--
  <project path="device/advent/vega" name="CyanogenMod/android_device_advent_vega" />
  <project path="device/common" name="CyanogenMod/android_device_common" />
  <project path="device/zte/blade" name="CyanogenMod/android_device_zte_blade" />
……
  <project path="device/zte/v9" name="CyanogenMod/android_device_zte_v9" />
  
  -->
  <project path="external/alsa-lib" name="CyanogenMod/android_external_alsa-lib" />

b. repo sync 完成后,编辑 vendor/cyanogen/products/AndroidProducts.mk  文件,只保留下面内容 PRODUCT_MAKEFILES := \     $(LOCAL_DIR)/cyanogen_generic.mk 

7、如果在需认证的proxy(如公司网络)下同步,则请务必更新python版本到2.7,否则可能出错。 Download RomManager NOTE: This only needs to be done when an update to RomManager is released. If you are-up-to date, you may skip toBuilding CyanogenMod.

Download ROM Manager which is needed by the build:

cd ~/android/system/vendor/cyanogen/ ./get-rommanager Building CyanogenMod Check for updates

First, check for updates in the source:

cd ~/android/system/ repo sync Configure Build

Now, your environment must be configured to build specifically for the Android Emulator. To set up your build environment:

. build/envsetup.sh lunch cyanogen_generic-eng
NOTE: 1、新建shell进入工作目录之后都需要执行上述命令 2、如果想彻底重新编译,需执行 make clean 3、FOR OPENSUSE:    去掉OpenSuSE普通用户下执行envsetup.sh的提示:修改 schedtool 为 /usr/sbin/schedtool 即可。 function mka() {     case `uname -s` in         Darwin)             make -j `sysctl hw.ncpu|cut -d" " -f2` "$@"             ;;         *)             /usr/sbin/schedtool -B -n 1 -e ionice -n 1 make -j `cat /proc/cpuinfo | grep "^processor" | wc -l` "$@"             ;;     esac }

Compile

Next, we will build the actual ROM.

mka
NOTE: 1、参考编译时间:90min(ThinkPad T61 ,3GB RAM ) 2、编译出错处理(自己摸索的,非官方) 错误1:编译约1个小时后出现的: target Strip: libutils (out/target/product/generic/obj/lib/libutils.so) target Dex: QuickSearchBox frameworks/base/core/java/android/widget/VideoView.java:46: package com.ti.omap.omap_mm_library does not exist import com.ti.omap.omap_mm_library.OmapMMLibrary;                                   ^ frameworks/base/core/java/android/widget/VideoView.java:62: cannot find symbol symbol  : class OmapMMLibrary location: class android.widget.VideoView     private OmapMMLibrary mOmapMMHandle = null;             ^ frameworks/base/core/java/android/widget/VideoView.java:196: cannot find symbol symbol  : class OmapMMLibrary location: class android.widget.VideoView             mOmapMMHandle = new OmapMMLibrary();                                 ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 errors make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar] Error 41 make: *** Waiting for unfinished jobs.... 错误分析和处理: 看起来是OmapMMLibrary的找不到,后来发现此代码在framework/base/omapmmlib中,修改 build/core/pathmap.mk的FRAMEWORKS_BASE_SUBDIRS,如下
FRAMEWORKS_BASE_SUBDIRS := \ $(addsuffix /java, \    core \    graphics \    location \    media \    opengl \    sax \    telephony \    wifi \    vpn \    keystore \    voip \    omapmmlib\ )

错误2:编译即将完成时出现的,此时system.img还未生成 Checking API: checkapi-last Checking API: checkapi-current (unknown): error 13: Class android.app.Profile changed final qualifier (unknown): error 13: Class android.app.ProfileGroup changed final qualifier (unknown): error 24: Method android.app.ProfileManager.getProfile has changed deprecation state (unknown): error 24: Method android.app.ProfileManager.setActiveProfile has changed deprecation state (unknown): error 3: Added class MultiSelectListPreference to package android.preference (unknown): error 4: Added public method android.app.Profile.getProfileGroup (unknown): error 4: Added public method android.app.Profile.getStatusBarIndicator (unknown): error 4: Added public method android.app.Profile.getUuid (unknown): error 4: Added public method android.app.Profile.setStatusBarIndicator (unknown): error 4: Added public method android.app.ProfileGroup.getUuid (unknown): error 4: Added public method android.app.ProfileManager.getProfile (unknown): error 4: Added public method android.app.ProfileManager.profileExists (unknown): error 4: Added public method android.app.ProfileManager.setActiveProfile (unknown): error 4: Added public method android.telephony.TelephonyManager.isDormancyRejected (unknown): error 4: Added public method android.telephony.TelephonyManager.setDormancyRejected (unknown): error 5: Added public field android.Manifest.permission.RAW_AUDIO (unknown): error 9: Removed public method android.app.Profile.getProfileGroup (unknown): error 9: Removed public method android.app.ProfileGroup.getName
****************************** You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:    1) You can add "@hide" javadoc comments to the methods, etc. listed in the       errors above.
   2) You can update current.xml by executing the following command:          make update-api
      To submit the revised current.xml to the main Android repository,       you will need approval. ******************************


make: *** [out/target/common/obj/PACKAGING/checkapi-current-timestamp] Error 38 make: *** Waiting for unfinished jobs.... htmlDir not a directory: out/target/common/docs/gen DroidDoc took 252 sec. to write docs to out/target/common/docs/doc-comment-check
错误处理:执行一次 make update-api 后编译可以顺利完成。
Install
  • Create a folder called android-9-cyanogen on Your/Android-SDK/platforms/
  • Copy the contents of Your/Android-SDK/platforms/android-9 into Your/Android-SDK/platforms/android-9-cyanogen
  • Copy the ramdisk.img system.img and userdata.img file from ~/android/system/out/target/product/generic toYour/Android-SDK/platforms/android-9-cyanogen/images/
  • Run the Android AVD Manager and select the second Android 2.3 target.
  •  

    1 楼 youthie 2012-02-14  
    多谢您,尤其是
    “如果下载过程中报某个目录一直出错,则需删除该目录再同步”这句~

        
    最新技术文章:
    ▪Android开发之登录验证实例教程
    ▪Android开发之注册登录方法示例
    ▪Android获取手机SIM卡运营商信息的方法
    ▪Android实现将已发送的短信写入短信数据库的...
    ▪Android发送短信功能代码
    ▪Android根据电话号码获得联系人头像实例代码
    ▪Android中GPS定位的用法实例
    ▪Android实现退出时关闭所有Activity的方法
    ▪Android实现文件的分割和组装
    ▪Android录音应用实例教程
    ▪Android双击返回键退出程序的实现方法
    ▪Android实现侦听电池状态显示、电量及充电动...
    ▪Android获取当前已连接的wifi信号强度的方法
    ▪Android实现动态显示或隐藏密码输入框的内容
    ▪根据USER-AGENT判断手机类型并跳转到相应的app...
    ▪Android Touch事件分发过程详解
    ▪Android中实现为TextView添加多个可点击的文本
    软件工程/软件设计 iis7站长之家
    ▪Android显式启动与隐式启动Activity的区别介绍
    ▪Android按钮单击事件的四种常用写法总结
    ▪Android消息处理机制Looper和Handler详解
    ▪Android实现Back功能代码片段总结
    ▪Android实用的代码片段 常用代码总结
    ▪Android实现弹出键盘的方法
    ▪Android中通过view方式获取当前Activity的屏幕截...
    ▪Android提高之自定义Menu(TabMenu)实现方法
    ▪Android提高之多方向抽屉实现方法
    ▪Android提高之MediaPlayer播放网络音频的实现方法...
    ▪Android提高之MediaPlayer播放网络视频的实现方法...
    ▪Android提高之手游转电视游戏的模拟操控
     


    站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3