intendhttp

http://www.xiaomi.com/  时间:2021-04-09  阅读:()
InsideAndroidlabnotesWhatelsecanyoudowithAndroidEmbeddedLinuxConferenceEurope2010Date:Tuesday26thOctoberLocation:DeVereUniversityofArmsHotel,CambridgeRoom:ChurchillSuitePresenter:ChrisSimmonds,chis@2net.
co.
ukCopyright2010,2netLimited1.
MakinguseofAndroidNOTE:ItestedtheseinstructionsusingUbuntu10.
04Desktopi386.
TheyshouldworkonotherLinuxconfigurationstoo,withmaybealittletweaking.
InthissectionyouwillinstalltheAndroidSDK,createadefinitionofavirtualdeviceandruntheemulatorInstallJDKYouwillneedaversionoftheSunJavaDevelopmentKit.
OtherversionsofJavawillnotwork.
Thereisachoicehere:ifyouonlywanttoinstallandusetheSDKforwritingAndroidappsthenJava6isthebestchoice.
But,ifyouwanttobuildthefullAndroidrun-time,asyouwillifyouareportingtocustomhardware,thenyouwillneedJava5.
ToinstallJava6onUbuntujusttypesudoapt-getinstallsun-java6-jdkNote:requiresthatyougotoSynaptic->Settings->RepositoriesandontheOthersoftwaretab,enablehttp://archive.
canonical.
com/ubuntuandthenreloadtherepositories.
ToinstallJava5.
.
.
DownloadasuitableJDKfromjava.
sun.
com,e.
g.
jdk-5u25-linux-i586.
bin,then:cd~shDownloads/jdk-5u25-linux-i586.
bin-1-InsideAndroidlabnotesSettheseshellvariablesexportJAVA_HOME=$HOME/jdk1.
5.
0_22PATH=$JAVA_HOME/bin:$PATHHint:addthelinesabovetoyour.
profilesotheyaresetcorrectlyeachtimeyoulogin.
InstalltheAndroidSDKDownloadtheSDK"starterpack"fromhttp://developer.
android.
com/sdk/index.
html.
Atthetimeofwritingthecurrentversionwasr06.
Then:cd~tarxzfDownloads/android-sdk_r06-linux_86.
tgzcdandroid-sdk-linux_86PATH=$HOME/android-sdk-linux_86/tools:$PATHThestarterpackcontainslittlebesidesthetoolsdirectory;youneedtoinstallatleastoneSDKplatform.
ThereisoneplatformforeachAndroidrelease.
Inthiscaseyouaregoingtoinstallthe2.
2"Froyo"platform.
Run"android"withnoparameterssoitstartsinGUImode.
Fromthe"AvailablePackages"list,select"SDKPlatformAndroid2.
2,API8,revision2"&install.
CreateanAVDSinceyouintendtousetheemulator,youneedtocreateadefinitionofthetargetdeviceyouaregoingtoemulate.
ThisiscalledanAVD:AndroidVirtualDevice.
Youcandoitusingthegraphicaluserinterfacetheandroidtoolprovides:select"VirtualDevices"andclickthe"New.
.
.
"button.
Oryoucandoitfromthecommandlinewithandroidcreateavd-nAVDtest-t1where-ngivestheAVDanameand-tselectsthetargetplatform.
Run"androidlist"togetalistoftargetplatformids.
Use"androidlistavd"foralistofthemIfyouarecurious,theAVDiscreatedin$HOME/.
android/avdandconsistsofaconfigurationfileandaplacefortheemulatortokeepuserdata.
-2-InsideAndroidlabnotesRuntheemulatoremulator-avdAVDtestNote:thesecondtimeyoubootthedevicethescreenwillbelocked.
Youunlockitbypressingthemenukey.
OtherthingsyoucandoExperimentwithAVDsettingsWhenyoucreateanAVDyoucanspecifyaskin.
ThedefaultisHVGAwhichis320x480.
OtheroptionsincludeQVGA(240x320,lowdensity,smallscreen)HVGA(320x480,mediumdensity,normalscreen)WVGA800(480x800,highdensity,normalscreen)WVGA854(480x854highdensity,normalscreen)Youcanspecifyotherskinsbyname,e.
g.
WVGA(800x480)orbyresolution.
YoucanspecifyanSDcardsizeandimagefile.
.
.
Starttheemulatorwith-shelltogetarootshell.
Starttheemulatorwith-show-kerneltoseethekernelmessagesastheemulatorboots.
InstallEclipseandtheADTIfindthattheeasiestwaytodeployEclipseistoextractthearchivetoyourhomedirectoryandlaunchitwiththe-vmoptionpointingtotheJavabinary:cd~tarxzfDownloads/eclipse-java-helios-linux-gtk.
tar.
gzeclipse/eclipse-vmjdk1.
5.
0_22/bin/javaInEclipse,gotoHelp->Installnewsoftware.
SettheURLto"Workwith"tohttps://dl-ssl.
google.
com/android/eclipse/Select"DeveloperTools"andclickInstall.
Installastatically-linkedcopyofBusyboxBusyboxcontainsalotofusefulUnixcommandsthataremissingfromAndroid,plusithasadecentshellwithpropercommandlineediting.
tarxjfbusybox-1.
16.
1.
tar.
bz2cdbusybox-1.
16.
1/makemenuconfigInBusyboxSettings->BuildOptionsselectBuildBusyBoxasastaticbinaryandexecprefersapplets,then-3-InsideAndroidlabnotesmakeCopyittoAndroidadbshellmkdir/data/binexitThencopybusybox:adbpushbusybox/data/binNowyoucanrunbusyboxfromtheAndroidshellandgetittorunaniceashshellforyou:/data/bin/busyboxash-4-InsideAndroidlabnotes2.
MakingUseofAndroidHelloWorldIfyoudon'thaveitalready,installant:sudoapt-getinstallantGetalistofAndroidSDKversionsinstalledonyourlaptop:$androidlisttargetsAvailableAndroidtargets:id:1or"android-8"Name:Android2.
2Type:PlatformAPIlevel:8Revision:2Skins:WQVGA432,QVGA,WVGA854,WQVGA400,WVGA800,HVGA(default)Inthiscasethereisonlyone,andithasanidof1.
Createaprojectusingthistarget:androidcreateproject--target1--nameHello\--path.
/helloworld--activityHelloWorld\--packagecom.
example.
HelloWorldNotethatthedirectoryhelloworld/hasbeecreatedandcontainsaskeletonproject.
Edithelloworld/src/com/example/HelloWorld/HelloWorld.
javaandaddaTextViewasshownintheslides.
BuilditbytypingantdebugNotethathelloworld/bin/Hello-debug.
apkhasbeencreated.
Starttheemulatorandinstallyourpackageadbinstall-rbin/Hello-debug.
apkIntheemulator,clicktheapplicationlaunchericon:Youshouldseeyourapplicationthere,soclickit!
NativecodeDownloadacopyofthendkfromhttp://developer.
android.
com/sdk/ndk/index.
html.
Extractittoyourhomedirectorycd~unzipDownloads/android-ndk-r4b-linux-x86.
zipNextyouaregoingtobuildoneofthesampleapplications,HelloJni.
CreateanewAndroidproject-5-InsideAndroidlabnotescd~mkdirappscdappsandroidcreateproject--target1--nameHelloJni--path.
/hello-jni--activityHelloJni--packagecom.
example.
hellojniCopythendksamplecodeoverthetopcp~/android-ndk-r4b/samples/hello-jni/*hello-jniBuildthenativecode.
.
.
cd~/apps/hello-jni~/android-ndk-r4b/ndk-buildBuildtheprojectantdebugRuntheemulatorandtheninstalltheprojectadbinstall-rbin/Hellojni-debug.
apkTestthatitworks.
Youshouldseethestring"HellofromJNI!
"onthescreenandifyourunlogcatyoushouldseesomethinglikethis:I/ActivityManager(58):Startproccom.
example.
hellojniforactivitycom.
example.
hellojni/.
HelloJni:pid=453uid=10013gids={1015}D/dalvikvm(453):Tryingtoloadlib/data/data/com.
example.
hellojni/lib/libhello-jni.
so0x43e372e8D/dalvikvm(453):Addedsharedlib/data/data/com.
example.
hellojni/lib/libhello-jni.
so0x43e372e8D/dalvikvm(453):NoJNI_OnLoadfoundin/data/data/com.
example.
hellojni/lib/libhello-jni.
so0x43e372e8,skippinginitI/ActivityManager(58):Displayedactivitycom.
example.
hellojni/.
HelloJni:1049ms(total1049ms)-6-InsideAndroidlabnotes3.
PortingtocustomhardwareMergingtheAndroidkernelThisisaquestionofjugglingwiththreeorfourkerneltrees.
Theyare1.
kernelforyourboard2.
themainlinekernelitwasbasedon3.
theandroidkernel4.
themainlinekernelitwasbasedonItmakeslifesimplerifthemainlinekernelisthesameinbothcases:/-->boardkernelmainlinekernel\-->AndroidkernelInthiscase,you"just"needtocreateapatchofdifferencesbetweenAndroidandmainlineandapplyittothekernelforyourboard,andthenclearupanyconflicts.
SimpleNo,buttomakelifeabiteasierherearesomehints.
Installgitifyoudon'thaveitalreadysudoapt-getinstallgitClonetheAndroidkerneltree(thiswilltakeawhile):gitclonegit://android.
git.
kernel.
org/kernel/common.
gitandroid-kernelListthebranches:cdandroid-kernelgitbranch-a*android-2.
6.
27remotes/origin/HEAD->origin/android-2.
6.
27remotes/origin/android-2.
6.
25remotes/origin/android-2.
6.
27remotes/origin/android-2.
6.
29remotes/origin/android-2.
6.
32remotes/origin/android-2.
6.
35remotes/origin/android-goldfish-2.
6.
27remotes/origin/android-goldfish-2.
6.
29Thissaysthatthecurrentbranchisandroid-2.
6.
27.
Supposeyouwanttouseandroid-2.
6.
32asabase,createanewlocalbranch,namedandroid-2.
6.
32inthiscase,whichisbasedonremotebranchorigin/android-2.
6.
32:gitcheckout--track-bandroid-2.
6.
32origin/android-2.
6.
32Nowgitbranch-awillconfirmthatyouareonandroid-2.
6.
32.
-7-InsideAndroidlabnotesThenextstageistofindthedifferencesbetweenthemainlineandAndroidkernels.
Firstyouneedtosynchronisethetagswiththemainlinekernel(ifyoulistthetagswith"gittag-l"youwillseethatmorerecentonesaremissing):gitfetch--tagsgit://git.
kernel.
org/pub/scm/linux/kernel/git/stable/linux-2.
6.
32.
y.
gitNow,sayyouwanttogeneratealistofpatchesuptomainline2.
6.
32.
9:gitformat-patchv2.
6.
32.
9.
.
HEADThenapplythesepatchestothekernelforyourboard:cdyour-kernelforfinandroid-kernel/*.
patch;dopatch-p1http://android.
git.
kernel.
org/repo>~/bin/repochmoda+x~/bin/repomkdirworking-directory-namecdworking-directory-namerepoinit-ugit://android.
git.
kernel.
org/platform/manifest.
gitThen,synchronisewithreposync(NotethiswilltakequitealongtimethefirsttimebecauseitwilldownloadseveralGiBofcode)RepoManifestsRepoisawayofmanagingmultiplegitrepositories.
Thelistofrepositoriesisheldinamanifest,whichisatextfileinxmlformat.
Whenyoucreatearepositoryusing"repoinit"youneedtogiveamanifest,defaultis"default.
xml".
Adda-mtospecifyadifferentmanifest,e.
g.
repoinit-ugit://android.
git.
kernel.
org/platform/manifest.
git-mdalkvik-plus.
xmlTospecifyarevision,thatis,aparticularmanifest-branch,usethe-boption.
Forexample:-8-InsideAndroidlabnotesrepoinit-ugit://android.
git.
kernel.
org/platform/manifest.
git-brelease-1.
0Youcanviewthemanifestusedwhentherepowasinitialisedbylookingin.
repo/manifest.
xmlBuildingthedefault(generic)productTypecdmyandroidexportJAVA_HOME=$HOME/jdk1.
5.
0_22PATH=$JAVA_HOME/bin:$PATH.
build/envsetup.
shmCompilestherun-timetoolsandfilesystem:myandroid/out/host/linux-x86-tools,e.
g.
adbmyandroid/out/target-targetrun-timeimages:target/product/generic/system.
img,userdata.
img,ramdisk.
imgmyandroid/target/product/generic/root/-rootfsTocreatethesdk,typemakesdkresultisinout/host/linux-x86/android-sdk_eng.
chris_linux-x86/andarezippedupintoPackageSDK:out/host/linux-x86/sdk/android-sdk_eng.
chris_linux-x86.
zip-9-

月费$389,RackNerd美国大硬盘独立服务器

这次RackNerd商家提供的美国大硬盘独立服务器,数据中心位于洛杉矶multacom,可选Windows、Linux镜像系统,默认内存是64GB,也可升级至128GB内存,而且硬盘采用的是256G SSD系统盘+10个16TSAS数据盘,端口提供的是1Gbps带宽,每月提供200TB,且包含5个IPv4,如果有需要更多IP,也可以升级增加。CPU核心内存硬盘流量带宽价格选择2XE5-2640V2...

傲游主机38.4元起,韩国CN2/荷兰VPS全场8折vps香港高防

傲游主机怎么样?傲游主机是一家成立于2010年的老牌国外VPS服务商,在澳大利亚及美国均注册公司,是由在澳洲留学的害羞哥、主机论坛知名版主组长等大佬创建,拥有多家海外直连线路机房资源,提供基于VPS主机和独立服务器租用等,其中VPS基于KVM或者XEN架构,可选机房包括中国香港、美国洛杉矶、韩国、日本、德国、荷兰等,均为CN2或者国内直连优秀线路。傲游主机提供8折优惠码:haixiuge,适用于全...

10gbiz首月半价月付2.36美元,香港/洛杉矶VPS、硅谷独立服务器/站群服务器

收到10gbiz发来的7月份优惠方案,中国香港、美国洛杉矶机房VPS主机4折优惠码,优惠后洛杉矶VPS月付2.36美元起,香港VPS月付2.75美元起。这是一家2020年成立的主机商,提供的产品包括独立服务器租用和VPS主机等,数据中心在美国洛杉矶、圣何塞和中国香港。商家VPS主机基于KVM架构,支持使用PayPal或者支付宝付款。洛杉矶VPS架构CPU内存硬盘带宽系统价格单核512MB10GB1...

http://www.xiaomi.com/为你推荐
microcenter美国哪里可以买插头转换器编程小学生惊库克儿童编程 scratch动物下楼怎么编?funnymudpee京东的显卡什么时候能降回正常价格啊,想买个1060蓝色骨头手机蓝色骨头为什么还没上映冯媛甑尸城女主角叫什么名字www.zjs.com.cn中国快递公司排名广告法请问违反了广告法,罚款的标准是什么555sss.com拜求:http://www.jjj555.com/这个网站是用的什么程序222cc.com有什么电影网站啊铂金血痕“斑斑的血痕”是什么意思?
php网站空间 免费cn域名注册 免费域名申请 狗爹 国外idc mediafire下载 谷歌香港 sockscap godaddy域名转出 seovip 元旦促销 qingyun 静态空间 广州服务器 重庆双线服务器托管 购买国外空间 中国电信宽带测速器 彩虹云 秒杀品 永久免费空间 更多