當前位置:首頁 » 操作系統 » device源碼

device源碼

發布時間: 2022-09-07 16:58:36

『壹』 如何把應用程序app編譯進android系統

把常用的應用程序編譯到img文件中,就成了系統的一部分,用戶不必自己安裝,當然也卸載不了;
同時也可以刪減系統自帶的應用程序,精簡系統;

1.\build\target\proct 目錄下generic.mk文件:
java代碼 收藏代碼
PRODUCT_PACKAGES := \
AccountAndSyncSettings \
DeskClock \
AlarmProvider \
Bluetooth \
Calculator \
Calendar \
Camera \
testMid \
CertInstaller \
DrmProvider \
Email \
Gallery3D \
LatinIME \
Launcher2 \
Mms \
Music \

我們添加一個testMid \ 應用名稱。
2.把testMid包放入
\packages\apps 目錄下,修改android.mk文件。

Java代碼 收藏代碼
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := testMid
LOCAL_CERTIFICATE := platform

include $(BUILD_PACKAGE)

註:LOCAL_PACKAGE_NAME := testMid (包名必須和generic.mk中添加的相同)
編譯源碼,可以看到在
\out\target\proct\smdkv210\system\app
目錄下生存了testMid.apk了。這時system.img也包含了此應用。
-------------------------------------------------------------------
特殊情況:有時,應用需要包含jar包,這時的app導入源碼時會出現問題:
MODULE.TARGET.JAVA_LIBRARIES.libarity already defined by ... stop

由於 LOCAL_STATIC_JAVA_LIBRARIES := libarity 會引發錯誤信息。
目前解決方法是:
\build\core 目錄下修改base_rules.mk
注釋掉錯誤信息:

ifdef $(mole_id)
#$(error $(LOCAL_PATH): $(mole_id) already defined by $($(mole_id)))
endif
$(mole_id) := $(LOCAL_PATH)

--重新編譯,這時可以通過了。

(2)、刪除原廠(Telchips)帶源碼的應用程序,如DTV_DVBT
在/device/telechips/m801/device.mk
注釋掉相應語句:
# PRODUCT_PACKAGES += \
# SampleDVBTPlayer \
同時,在/out/target/proct/m801/system/app 找到相應的.APK包,並刪除

『貳』 參數傳遞文件和DTS文件一樣嗎

摘要 親^3^,您好,不好意思,DTS即Device Tree Source 設備樹源碼, Device Tree是一種描述硬體的數據結構,它起源於 OpenFirmware (OF)。

『叄』 怎樣從源碼編譯rom

本帖最後由 pigjohn 於 2014-2-10 20:24 編輯

一、你需要:
1.linux系統環境
教程使用ubuntu 12.04(LTS)
硬碟安裝或虛擬機安裝應該都ok。
2.電腦配置不要太差
二、搭建編譯環境:
1.java安裝配置
1) 刪除舊版本java
ctrl+alt+t 打開終端。
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*

sudo apt-get purge sun-java
復制代碼
2) 安裝java 1.6
添加軟體源,打開終端輸入
sudo add-apt-repository ppa:webupd8team/java
復制代碼
下載安裝,打開終端輸入
sudo apt-get update && sudo apt-get install oracle-java6-installer
復制代碼
跟隨屏幕提示,你需要接受使用條款。
安裝完成後,終端輸入java -version,你會看到java版本信息。類似
java version 「1.6.0_37″

Java(TM) SE Runtime Environment (build 1.6.0_37-b06)

Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
復制代碼
2.安裝依賴軟體
sudo apt-get install git-core gnupg flex bison gperf build-essential \

zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev \

ia32-libs x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 \

lib32z-dev libgl1-mesa-dev g++-multilib mingw32 \

tofrodos python-markdown libxml2-utils xsltproc readline-common \

libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev \

lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 \

libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev \

libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.6-dev
復制代碼
等待安裝配置完成
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
復制代碼
三、源碼下載
1.repo腳本下載
$ mkdir ~/bin

$ PATH=~/bin:$PATH

$ curl [url]https://dl-ssl.google.com/dl/googlesource/git-repo/repo[/url] > ~/bin/repo

$ chmod a+x ~/bin/repo
復制代碼
2.初始化repo同步
mkdir ~/cm11

cd ~/cm11

repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0

復制代碼
你需要按提示輸入用戶名和郵箱。
3.9003device源碼
cd ~/cm11/.repo

mkdir local_manifests && cd local_manifests

gedit roomservice.xml
復制代碼
粘貼以下內容
<?xml version="1.0" encoding="UTF-8"?>

<manifest>

<project name="dhiru1602/android_device_samsung_galaxysl" path="device/samsung/galaxysl" remote="github" revision="cm-11.0" />

<project name="dhiru1602/android_vendor_samsung_galaxysl" path="vendor/samsung/galaxysl" remote="github" revision="cm-11.0" />

<project name="dhiru1602/android_kernel_samsung_latona" path="kernel/samsung/latona" remote="github" revision="cm-11.0" />

<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="cm-11.0"/>

</manifest>
復制代碼
保存。
4.同步源碼
cd ~/cm11

repo sync -j8
復制代碼
源碼有好幾個G,同步時間長短取決於你的網路速度。
四、編譯
1.編譯之前同步最新源碼
repo sync
復制代碼
2.初始化環境
. build/envsetup.sh
復制代碼
3.編譯
brunch galaxysl
復制代碼
接著喝杯茶,編譯時間長短取決於你的電腦配置。
不出意外,你會最終得到~/cm11/out/target/proct/galaxysl/cm-11-XXXXX-UNOFFICIAL-galaxysl.zip
五、刷機測試

以上就是編譯cm11的過程。

對於其他rom,類似。
mokee:
mkdir ~/mokee && cd ~/mokee

repo init -u https://github.com/MoKee/android.git -b kk_mkt

『肆』 android_studio手機藍牙串口通信源代碼

初涉android的藍牙操作,按照固定MAC地址連接獲取Device時,程序始終是異常終止,查了好多天代碼都沒查出原因。今天改了一下API版本,突然就成功連接了。總結之後發現果然是個坑爹之極的錯誤。

為了這種錯誤拚命查原因浪費大把時間是非常不值得的,但是問題不解決更是揪心。可惜我網路了那麼多,都沒有給出確切原因。今天特此mark,希望後來者遇到這個問題的時候能輕松解決。

下面是我的連接過程,中間崩潰原因及解決辦法。

1:用AT指令獲得藍牙串口的MAC地址,地址是簡寫的,按照常理猜測可得標准格式。

2:開一個String adress= "************" //MAC地址, String MY_UUID= "************"//UUID根據通信而定,網上都有。

3:取得本地Adapter用getDefaultAdapter(); 遠程的則用getRemoteDevice(adress); 之後便可用UUID開socket進行通信。

如果中途各種在getRemoteDevice處崩潰,大家可以查看一下當前的API版本,如果是2.1或以下版本的話,便能確定是API版本問題,只要換成2.2或者以上就都可以正常運行了~ 這么坑爹的錯誤的確很為難初學者。 唉·········· 為這種小trick浪費很多時間真是難過。

(另外有個重要地方,別忘了給manifest裡面加以下兩個藍牙操作許可權哦~)

  • <uses-permissionandroid:name="android.permission.BLUETOOTH"></uses-permission>

  • <uses-permissionandroid:name="android.permission.BLUETOOTH_ADMIN"></uses-permission>

  • 下面附上Android藍牙操作中用固定MAC地址傳輸信息的模板,通用搜索模式日後再補刪模板:

  • =null;

  • =null;

  • privateOutputStreamoutStream=null;

  • privateInputStreaminStream=null;

  • privatestaticfinalUUIDMY_UUID=UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");//這條是藍牙串口通用的UUID,不要更改

  • privatestaticStringaddress="00:12:02:22:06:61";//<==要連接的藍牙設備MAC地址

  • /*獲得通信線路過程*/

  • /*1:獲取本地BlueToothAdapter*/

  • mBluetoothAdapter=BluetoothAdapter.getDefaultAdapter();

  • if(mBluetoothAdapter==null)

  • {

  • Toast.makeText(this,"Bluetoothisnotavailable.",Toast.LENGTH_LONG).show();

  • finish();

  • return;

  • }

  • if(!mBluetoothAdapter.isEnabled())

  • {

  • Toast.makeText(this,"-runthisprogram.",Toast.LENGTH_LONG).show();

  • finish();

  • return;

  • }

  • /*2:獲取遠程BlueToothDevice*/

  • BluetoothDevicedevice=mBluetoothAdapter.getRemoteDevice(address);

  • if(mBluetoothAdapter==null)

  • {

  • Toast.makeText(this,"Can'tgetremotedevice.",Toast.LENGTH_LONG).show();

  • finish();

  • return;

  • }

  • /*3:獲得Socket*/

  • try{

  • btSocket=device.(MY_UUID);

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:Socketcreationfailed.",e);

  • }

  • /*4:取消discovered節省資源*/

  • mBluetoothAdapter.cancelDiscovery();

  • /*5:連接*/

  • try{

  • btSocket.connect();

  • Log.e(TAG,"ONRESUME:BTconnectionestablished,datatransferlinkopen.");

  • }catch(IOExceptione){

  • try{

  • btSocket.close();

  • }catch(IOExceptione2){

  • Log.e(TAG,"ONRESUME:",e2);

  • }

  • }

  • /*此時可以通信了,放在任意函數中*/

  • /*try{

  • outStream=btSocket.getOutputStream();

  • inStream=btSocket.getInputStream();//可在TextView里顯示

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:Outputstreamcreationfailed.",e);

  • }

  • Stringmessage="1";

  • byte[]msgBuffer=message.getBytes();

  • try{

  • outStream.write(msgBuffer);

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:Exceptionringwrite.",e);

  • }

  • */

  • 通用搜索模式代碼模板:

    簡潔簡潔方式1 demo


    作用: 用VerticalSeekBar控制一個 LED屏幕的亮暗。

    直接上碼咯~

  • packagecom.example.seed2;

  • importandroid.app.Activity;

  • importandroid.app.AlertDialog;

  • importandroid.app.Dialog;

  • importandroid.os.Bundle;

  • importjava.io.IOException;

  • importjava.io.InputStream;

  • importjava.io.OutputStream;

  • importjava.util.UUID;

  • importandroid.bluetooth.BluetoothAdapter;

  • importandroid.bluetooth.BluetoothDevice;

  • importandroid.bluetooth.BluetoothSocket;

  • importandroid.content.DialogInterface;

  • importandroid.util.Log;

  • importandroid.view.KeyEvent;

  • importandroid.widget.Toast;

  • {

  • privatestaticfinalStringTAG="BluetoothTest";

  • =null;

  • =null;

  • privateOutputStreamoutStream=null;

  • privateInputStreaminStream=null;

  • privateVerticalSeekBarvskb=null;

  • privatestaticfinalUUIDMY_UUID=UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");//這條是藍牙串口通用的UUID,不要更改

  • privatestaticStringaddress="00:12:02:22:06:61";//<==要連接的藍牙設備MAC地址

  • /**.*/

  • @Override

  • publicvoidonCreate(BundlesavedInstanceState){

  • super.onCreate(savedInstanceState);

  • setContentView(R.layout.main);

  • this.vskb=(VerticalSeekBar)super.findViewById(R.id.mskb);

  • this.vskb.setOnSeekBarChangeListener(newOnSeekBarChangeListenerX());

  • mBluetoothAdapter=BluetoothAdapter.getDefaultAdapter();

  • if(mBluetoothAdapter==null)

  • {

  • Toast.makeText(this,"Bluetoothisnotavailable.",Toast.LENGTH_LONG).show();

  • finish();

  • return;

  • }

  • if(!mBluetoothAdapter.isEnabled())

  • {

  • Toast.makeText(this,"-runthisprogram.",Toast.LENGTH_LONG).show();

  • finish();

  • return;

  • }

  • }

  • .OnSeekBarChangeListener{

  • publicvoidonProgressChanged(VerticalSeekBarseekBar,intprogress,booleanfromUser){

  • //Main.this.clue.setText(seekBar.getProgress());

  • /*Stringmessage;

  • byte[]msgBuffer;

  • try{

  • outStream=btSocket.getOutputStream();

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:OutputStreamcreationfailed.",e);

  • }

  • message=Integer.toString(seekBar.getProgress());

  • msgBuffer=message.getBytes();

  • try{

  • outStream.write(msgBuffer);

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:Exceptionringwrite.",e);

  • }*/

  • }

  • (VerticalSeekBarseekBar){

  • Stringmessage;

  • byte[]msgBuffer;

  • try{

  • outStream=btSocket.getOutputStream();

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:OutputStreamcreationfailed.",e);

  • }

  • message=Integer.toString(seekBar.getProgress());

  • msgBuffer=message.getBytes();

  • try{

  • outStream.write(msgBuffer);

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:Exceptionringwrite.",e);

  • }

  • }

  • publicvoidonStopTrackingTouch(VerticalSeekBarseekBar){

  • Stringmessage;

  • byte[]msgBuffer;

  • try{

  • outStream=btSocket.getOutputStream();

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:OutputStreamcreationfailed.",e);

  • }

  • message=Integer.toString(seekBar.getProgress());

  • msgBuffer=message.getBytes();

  • try{

  • outStream.write(msgBuffer);

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:Exceptionringwrite.",e);

  • }

  • }

  • }

  • @Override

  • publicvoidonStart()

  • {

  • super.onStart();

  • }

  • @Override

  • publicvoidonResume()

  • {

  • super.onResume();

  • BluetoothDevicedevice=mBluetoothAdapter.getRemoteDevice(address);

  • try{

  • btSocket=device.(MY_UUID);

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:Socketcreationfailed.",e);

  • }

  • mBluetoothAdapter.cancelDiscovery();

  • try{

  • btSocket.connect();

  • Log.e(TAG,"ONRESUME:BTconnectionestablished,datatransferlinkopen.");

  • }catch(IOExceptione){

  • try{

  • btSocket.close();

  • }catch(IOExceptione2){

  • Log.e(TAG,"ONRESUME:",e2);

  • }

  • }

  • //.

  • /*try{

  • outStream=btSocket.getOutputStream();

  • inStream=btSocket.getInputStream();

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:Outputstreamcreationfailed.",e);

  • }

  • Stringmessage="read";

  • byte[]msgBuffer=message.getBytes();

  • try{

  • outStream.write(msgBuffer);

  • }catch(IOExceptione){

  • Log.e(TAG,"ONRESUME:Exceptionringwrite.",e);

  • }

  • intret=-1;

  • while(ret!=-1)

  • {

  • try{

  • ret=inStream.read();

  • }catch(IOExceptione)

  • {

  • e.printStackTrace();

  • }

  • }

  • */

  • }

  • @Override

『伍』 android 源碼 怎麼只編譯 systemui

Google提供的Android包含了原始Android的目標機代碼,主機編譯工具、模擬環境,下載的代碼包經過解壓後(這里是Android2.2的源碼包),源代碼的第一層目錄結構如下: -- Makefile -- bionic (bionic C庫) -- bootable (啟動引導相關代碼) -- build (存放系統編譯規則及generic等基礎開發包配置) -- cts (Android兼容性測試套件標准) -- dalvik (dalvik JAVA虛擬機) -- development (應用程序開發相關) -- external (android使用的一些開源的模組) -- frameworks (核心框架——java及C++語言) -- hardware (主要保護硬解適配層HAL代碼) -- libcore -- ndk -- device -- out (編譯完成後的代碼輸出與此目錄) -- packages (應用程序包) -- prebuilt (x86和arm架構下預編譯的一些資源) -- sdk (sdk及模擬器) -- system (文件系統庫、應用及組件——c語言) `-- vendor (廠商定製代碼) bionic 目錄 -- libc (C庫) -- arch-arm (ARM架構,包含系統調用匯編實現) -- arch-x86 (x86架構,包含系統調用匯編實現) -- bionic (由C實現的功能,架構無關) -- docs (文檔) -- include (頭文件) -- inet -- kernel (Linux內核中的一些頭文件) -- netbsd (?netbsd系統相關,具體作用不明) -- private (?一些私有的頭文件) -- stdio (stdio實現) -- stdlib (stdlib實現) -- string (string函數實現) -- tools (幾個工具) -- tzcode (時區相關代碼) -- unistd (unistd實現) `-- zoneinfo (時區信息) -- libdl (libdl實現,dl是動態鏈接,提供訪問動態鏈接庫的功能) -- libm (libm數學庫的實現,) -- alpha (apaha架構) -- amd64 (amd64架構) -- arm (arm架構) -- bsdsrc (?bsd的源碼) -- i386 (i386架構) -- i387 (i387架構?) -- ia64 (ia64架構) -- include (頭文件) -- man (數學函數,後綴名為.3,一些為freeBSD的庫文件) -- powerpc (powerpc架構) -- sparc64 (sparc64架構) `-- src (源代碼) -- libstdc++ (libstdc++ C++實現庫) -- include (頭文件) `-- src (源碼) -- libthread_db (多線程程序的調試器庫) `-- include (頭文件) `-- linker (動態鏈接器) `-- arch (支持arm和x86兩種架構) bootable 目錄 -- bootloader (適合各種bootloader的通用代碼) `-- legacy (估計不能直接使用,可以參考) -- arch_armv6 (V6架構,幾個簡單的匯編文件) -- arch_msm7k (高通7k處理器架構的幾個基本驅動) -- include (通用頭文件和高通7k架構頭文件) -- libboot (啟動庫,都寫得很簡單) -- libc (一些常用的c函數) -- nandwrite (nandwirte函數實現) `-- usbloader (usbloader實現) -- diskinstaller (android鏡像打包器,x86可生產iso) `-- recovery (系統恢復相關) -- edify (升級腳本使用的edify腳本語言) -- etc (init.rc恢復腳本) -- minui (一個簡單的UI) -- minzip (一個簡單的壓縮工具) -- mttils (mtd工具) -- res (資源) `-- images (一些圖片) -- tools (工具) `-- ota (OTA Over The Air Updates升級工具) `-- updater (升級器) build目錄 -- core (核心編譯規則) -- history (歷史記錄) -- libs `-- host (主機端庫,有android 「cp」功能替換) -- target (目標機編譯對象) -- board (開發平台) -- emulator (模擬器) -- generic (通用) -- idea6410 (自己添加的) `-- sim (最簡單) `-- proct (開發平台對應的編譯規則) `-- security (密鑰相關) `-- tools (編譯中主機使用的工具及腳本) -- acp (Android "acp" Command) -- apicheck (api檢查工具) -- applypatch (補丁工具) -- apriori (預鏈接工具) -- atree (tree工具) -- bin2asm (bin轉換為asm工具) -- check_prereq (檢查編譯時間戳工具) -- dexpreopt (模擬器相關工具,具體功能不明) -- droiddoc (?作用不明,java語言,網上有人說和JDK5有關) -- fs_config (This program takes a list of files and directories) -- fs_get_stats (獲取文件系統狀態) -- iself (判斷是否ELF格式) -- isprelinked (判斷是否prelinked) -- kcm (按鍵相關) -- lsd (List symbol dependencies) -- releasetools (生成鏡像的工具及腳本) -- rgb2565 (rgb轉換為565) -- signapk (apk簽名工具) -- soslim (strip工具) `-- zipalign (zip archive alignment tool) dalvik目錄 dalvik虛擬機 . -- dalvikvm (main.c的目錄) -- dexmp (dex反匯編) -- dexlist (List all methods in all concrete classes in a DEX file.) -- dexopt (預驗證與優化) -- docs (文檔) -- dvz (和zygote相關的一個命令) -- dx (dx工具,將多個java轉換為dex) -- hit (?java語言寫成) -- libcore (核心庫) -- libcore-disabled (?禁用的庫) -- libdex (dex的庫) -- libnativehelper (Support functions for Android's class libraries) -- tests (測試代碼) -- tools (工具) `-- vm (虛擬機實現) development 目錄 (開發者需要的一些常式及工具) -- apps (一些核心應用程序) -- BluetoothDebug (藍牙調試程序) -- CustomLocale (自定義區域設置) -- Development (開發) -- Fallback (和語言相關的一個程序) -- FontLab (字型檔) -- GestureBuilder (手勢動作) -- NinePatchLab (?) -- OBJViewer (OBJ查看器) -- SdkSetup (SDK安裝器) -- SpareParts (高級設置) -- Term (遠程登錄) `-- launchperf (?) -- build (編譯腳本模板) -- cmds (有個monkey工具) -- data (配置數據) -- docs (文檔) -- host (主機端USB驅動等) -- ide (集成開發環境) -- ndk (本地開發套件——c語言開發套件) -- pdk (Plug Development Kit) -- samples (演示程序) -- AliasActivity () -- ApiDemos (API演示程序) -- BluetoothChat (藍牙聊天) -- BrowserPlugin (瀏覽器插件) -- BusinessCard (商業卡) -- Compass (指南針) -- ContactManager (聯系人管理器) -- CubeLiveWall** (動態壁紙的一個簡單常式) -- FixedGridLayout (像是布局) -- GlobalTime (全球時間) -- HelloActivity (Hello) -- Home (Home) -- JetBoy (jetBoy游戲) -- LunarLander (貌似又是一個游戲) -- MailSync (郵件同步) -- MultiResolution (多解析度) -- MySampleRss (RSS) -- NotePad (記事本) -- RSSReader (RSS閱讀器) -- SearchableDictionary (目錄搜索) -- **JNI (JNI常式) -- SkeletonApp (空殼APP) -- Snake (snake程序) -- SoftKeyboard (軟鍵盤) -- Wiktionary (?維基) `-- Wiktionary**(?維基常式) -- scripts (腳本) -- sdk (sdk配置) -- simulator (?模擬器) -- testrunner (?測試用) `-- tools (一些工具)

『陸』 引用android 源碼device目錄下的類為什麼會顯示不存在

Eclipse只能查看API的注釋及說明,而且是必須與jar包關聯以後才能查看 jar包與docs關聯方式: 1. 打開Eclipse,隨便新建一個Android項目,在此項目目錄下面有個Android 4.4,點擊遍出現了android.jar。 2. 右鍵此包---->Properties,在彈出的窗口中,選擇 Java Source Attachment------>External Location------>External File, 然後選擇下載下來的source-19_r02.zip,便成功在Eclipse中綁定Android源代碼。 3. ctl+滑鼠左鍵 跳轉到源代碼 在想要查看源代碼的地方,ctl+滑鼠左鍵就可以跳轉到源代碼的地方。 Android Studio源代碼關聯方式: 1.打開菜單File ->Project Structure (或者按F4)。 2.在左邊列表中選擇Moles。 3.選擇工程,然後在第三個標簽頁頁找到Dependencies。 4.按「+」按鈕,在彈出窗口中選擇android-support-v4.jar所在文件夾(在SDK目錄下),然後確認即可

『柒』 ccs怎麼添加其他device

安裝時選擇安裝這個包就行了,沒有字裝就修復然後選要增加的包,不能把包直接拿來用,因為你沒選TMS 編譯器都沒有安裝。我看到 你的圖片了,這人顯示是安裝的源碼和數據手冊而已,
你要TMS的源碼要再安裝另一個軟體controlSUITE,這個裡面才會提供你要的源碼包和數據手冊。
你完全安裝後就不用再安裝什麼處理器的Packages了啊,直接就可以編譯了啊;你要更新的編譯器工具,可以用軟體自帶的更新到官網下載。

『捌』 vb6 無驅攝像頭編程 求源碼

發下是我幾年前寫的(參照)一個VB驅動攝像頭的代碼,不知道現在還能不能用,因為文件總的很長,這只是其中的一小部分,希望對你有所用.(要不就和我聯系,給你源碼)
Private Sub Form_Load()
On Error Resume Next
Dim retVal As Boolean
Dim numDevs As Long
bCaramaPlaying = True
'load trivial settings first
Me.BackColor = Val(GetSetting(App.Title, "preferences", "backcolor", "&H404040")) 'default to dk gray

numDevs = VBEnumCapDrivers(Me)
If 0 = numDevs Then
MsgBox "沒有找到視頻捕捉設備!", vbCritical, App.Title
' frmPlayer.Visible = True
' If bIsVisible = True And vbPlayFormIsVisible = True And vbFrmPlayFrameHided = False Then
' frmPlayFrame.Visible = True
' End If
Unload Me
Exit Sub
End If
nDriverIndex = Val(GetSetting(App.Title, "driver", "index", "0"))
'if invalid entry is in registry use default (0)
If mnuDriver.UBound < nDriverIndex Then
nDriverIndex = 0
End If
mnuDriver(nDriverIndex).Checked = True
'//Create Capture Window
'Call capGetDriverDescription( nDriverIndex, lpszName, 100, lpszVer, 100 '// Retrieves driver info
hCapWnd = capCreateCaptureWindow("VB CAP WINDOW", WS_CHILD Or WS_VISIBLE, 0, 0, 160, 120, Me.hWnd, 0)
If 0 = hCapWnd Then
MsgBox "不能創建捕捉窗口!", vbCritical, App.Title
Exit Sub
End If
retVal = ConnectCapDriver(hCapWnd, nDriverIndex)
If False = retVal Then
MsgBox "不能連接到視頻設備!", vbInformation, App.Title
Else
#If USECALLBACKS = 1 Then
' if we have a valid capwnd we can enable our status callback function
Call capSetCallbackOnStatus(hCapWnd, AddressOf StatusProc)
Debug.Print "---Callback set on capture status---"
#End If
End If
'// Set the video stream callback function
' capSetCallbackOnVideoStream lwndC, AddressOf MyVideoStreamCallback
' capSetCallbackOnFrame lwndC, AddressOf MyFrameCallback

Dim bPlayFrameTop As Boolean
bPlayFrameTop = GetSetting(MyName, "setting" & "-" & Trim(Str(App.Major)) & "-" & Trim(Str(App.Minor)), "bPlayFrameTop", "False")
If bPlayFrameTop = True Then
Me.mnuOptionTop.Checked = True
'放在最前
SetWindowPos Me.hWnd, HWND_TOPMOST, Me.Left / Screen.TwipsPerPixelX, Me.Top / Screen.TwipsPerPixelY, Me.Width / Screen.TwipsPerPixelX, Me.Height / Screen.TwipsPerPixelY, &H20
Else
Me.mnuOptionTop.Checked = False
'不放在最前
SetWindowPos Me.hWnd, HWND_NOTOPMOST, Me.Left / Screen.TwipsPerPixelX, Me.Top / Screen.TwipsPerPixelY, Me.Width / Screen.TwipsPerPixelX, Me.Height / Screen.TwipsPerPixelY, &H20
End If
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
Me.picShowMenu.ZOrder 0

End Sub

'以下是一個模塊文件
Option Explicit

'application specific routines are here

Public Const ONE_MEGABYTE As Long = 1048576
'Public Const MMSYSERR_NOERROR As Long = 0
Public Const INDEX_15_MINUTES As Long = 27000 '(30fps * 60sec * 15min)
Public Const INDEX_3_HOURS As Long = 324000 ' (30fps * 60sec * 60min * 3hr)

Public Function GetFreeSpace() As Long
'this function gets the amount of free disk space and adds the size
'of the current capture file
Dim freedisk As Long
Dim path As String

'get Cap File length
path = capFileGetCaptureFile(frmCaramaMain.capwnd)
If path <> "" Then
On Error Resume Next
freedisk = FileLen(path)
freedisk = freedisk / ONE_MEGABYTE
End If

'now get free disk space from that drive
path = Left$(path, 3)
GetFreeSpace = freedisk + vbGetAvailableMBytes(path)

End Function

Sub ResizeCaptureWindow(ByVal hCapWnd As Long)
Dim retVal As Boolean
Dim capStat As CAPSTATUS

'Get the capture window attributes
retVal = capGetStatus(hCapWnd, capStat)

If retVal Then
'Resize the main form to fit
Call SetWindowPos(frmCaramaMain.hWnd, _
0&, _
0&, _
0&, _
capStat.uiImageWidth + (frmCaramaMain.XBorder * 2), _
capStat.uiImageHeight + (frmCaramaMain.YBorder * 4) _
+ frmCaramaMain.CaptionHeight + frmCaramaMain.MenuHeight, _
Swp_nomove Or SWP_NOZORDER Or SWP_NOSENDCHANGING)
'Resize the capture window to format size
Call SetWindowPos(hCapWnd, _
0&, _
0&, _
0&, _
capStat.uiImageWidth, _
capStat.uiImageHeight, _
Swp_nomove Or SWP_NOZORDER Or SWP_NOSENDCHANGING)
End If
Call frmCaramaMain.Form_Resize
End Sub

Public Function VBEnumCapDrivers(ByRef frm As frmCaramaMain) As Long
'/*
' * Enumerate the potential capture drivers and add the list to the Options
' * menu. This function is only called once at startup.
' * Returns 0 if no drivers are available.
' */
Const MAXVIDDRIVERS As Long = 9
Const CAP_STRING_MAX As Long = 128
Dim numDrivers As Long
Dim driverStrings(0 To MAXVIDDRIVERS - 1) As String
Dim Index As Long
Dim Device As String
Dim Version As String
Dim menu As VB.menu

Device = String$(CAP_STRING_MAX, 0)
Version = String$(CAP_STRING_MAX, 0)
numDrivers = 0
For Index = 0 To (MAXVIDDRIVERS - 1) Step 1
If 0 <> capGetDriverDescription(Index, _
Device, _
CAP_STRING_MAX, _
Version, _
CAP_STRING_MAX) _
Then
'extend the menu
If Index > 0 Then
Load frm.mnuDriver(Index)
End If
Set menu = frm.mnuDriver(Index) 'get an object pointer to the new menu
'Concatenate the device name and version strings to the new menu item
menu.Caption = Left$(Device, InStr(Device, vbNullChar) - 1)
menu.Caption = menu.Caption & " "
menu.Caption = menu.Caption & Left$(Version, InStr(Version, vbNullChar) - 1)
menu.Enabled = True
numDrivers = numDrivers + 1
End If

Next
VBEnumCapDrivers = numDrivers
End Function

Public Function ConnectCapDriver(ByVal hCapWnd As Long, ByVal nDriverIndex As Long) As Boolean
Dim retVal As Boolean
Dim Caps As CAPDRIVERCAPS
Dim i As Long

Debug.Assert (nDriverIndex < 10) And (nDriverIndex >= 0)
'// Connect the capture window to the driver
retVal = capDriverConnect(hCapWnd, nDriverIndex)
If False = retVal Then
'return False
Exit Function
End If
'// Get the capabilities of the capture driver
retVal = capDriverGetCaps(hCapWnd, Caps)

If False <> retVal Then
'reset menus (very app-specific)
With frmCaramaMain
For i = 0 To .mnuDriver.UBound
.mnuDriver(i).Checked = False 'make sure all drivers are unchecked
Next
.mnuDriver(nDriverIndex).Checked = True 'then check the new driver
'disable all hardware feature menu items
.mnuSource.Enabled = False
.mnuFormat.Enabled = False
.mnuDisplay.Enabled = False
.mnuOverlay.Enabled = False
'Then enable the ones which are supported by the new driver
If Caps.fHasDlgVideoSource <> 0 Then .mnuSource.Enabled = True
If Caps.fHasDlgVideoFormat <> 0 Then .mnuFormat.Enabled = True
If Caps.fHasDlgVideoDisplay <> 0 Then .mnuDisplay.Enabled = True
If Caps.fHasOverlay <> 0 Then .mnuOverlay.Enabled = True

End With
End If
'// Set the preview rate in milliseconds
Call capPreviewRate(hCapWnd, 66) '15 FPS

'// Start previewing the image from the camera
Call capPreview(hCapWnd, True)
'default to showing a preview each time
frmCaramaMain.mnuPreview.Checked = True

'// Resize the capture window to show the whole image
Call ResizeCaptureWindow(hCapWnd)
ConnectCapDriver = True
End Function
Public Function StatusProc(ByVal hCapWnd As Long, ByVal StatusCode As Long, ByVal lpStatusString As Long) As Long
Select Case StatusCode
Case 0 'this is recommended in docs
'when zero is sent, clear old status messages
'frmCaramaMain.Caption = App.Title
Case IDS_CAP_END ' Video Capture has finished
frmCaramaMain.Caption = App.Title
Case IDS_CAP_STAT_VIDEOAUDIO, IDS_CAP_STAT_VIDEOONLY
MsgBox LPSTRtoVBString(lpStatusString), vbInformation, App.Title
Case Else
'use this function if you need a real VB string
'frmCaramaMain.Caption = LPSTRtoVBString(lpStatusString)

'or, just pass the LPCSTR to a WINAPI function
Call SetWindowTextAsLong(frmCaramaMain.hWnd, lpStatusString)
End Select
Debug.Print "Driver returned code " & StatusCode & " to StatusProc"
StatusProc = -(True) '- converts Boolean to C BOOL
End Function

『玖』 怎麼在cm10.1源碼樹添加自己的device編譯

怎麼在cm10.1源碼樹添加自己的device編譯
打開,可以看到
for combo in $(curl -s https://raw.github.com/CyanogenMod/hudson/master/cm-build-targets | sed -e 's/#.*$//' | grep cm-10.1 | awk {'print $1'})
do
add_lunch_combo $combo
done

在這里添加自己需要編譯的設備就可以了,改成如下:
for combo in $(curl -s https://raw.github.com/CyanogenMod/hudson/master/cm-build-targets | sed -e 's/#.*$//' | grep cm-10.1 | awk {'print $1'})
do
add_lunch_combo $combo
add_lunch_combo cm_u8833
done

改好之後執行. build/envsetup.sh
再執行 lunch

熱點內容
暴風影音緩存在哪裡 發布:2025-05-12 12:42:03 瀏覽:532
access資料庫exe 發布:2025-05-12 12:39:04 瀏覽:622
五開的配置是什麼 發布:2025-05-12 12:36:37 瀏覽:358
加密ovpn 發布:2025-05-12 12:01:55 瀏覽:44
python練手項目 發布:2025-05-12 11:14:07 瀏覽:122
壓縮聽算音頻 發布:2025-05-12 10:58:12 瀏覽:801
資料庫系統報告 發布:2025-05-12 10:43:17 瀏覽:603
日產高配有哪些配置 發布:2025-05-12 10:32:16 瀏覽:475
大眾朗逸哪個配置值得入手 發布:2025-05-12 10:31:20 瀏覽:505
壓縮包的後綴 發布:2025-05-12 10:20:35 瀏覽:944