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-

spinservers春节优惠:$149/月10Gbps圣何塞服务器-2*E5-2630Lv3 CPU,256G内存,2*1.6T SSD硬盘

spinservers是Majestic Hosting Solutions LLC旗下站点,商家提供国外服务器租用和Hybrid Dedicated等产品,数据中心包括美国达拉斯和圣何塞机房,机器默认10Gbps端口带宽,高配置硬件,支持使用PayPal、信用卡、支付宝或者微信等付款方式。农历春节之际,商家推出了几款特别促销配置,最低双路E5-2630Lv3机器每月149美元起,下面列出几款机器...

hostyun评测香港原生IPVPS

hostyun新上了香港cloudie机房的香港原生IP的VPS,写的是默认接入200Mbps带宽(共享),基于KVM虚拟,纯SSD RAID10,三网直连,混合超售的CN2网络,商家对VPS的I/O有大致100MB/S的限制。由于是原生香港IP,所以这个VPS还是有一定的看头的,这里给大家弄个测评,数据仅供参考!9折优惠码:hostyun,循环优惠内存CPUSSD流量带宽价格购买1G1核10G3...

Hostodo美国独立日优惠套餐年付13.99美元起,拉斯维加斯/迈阿密机房

Hostodo又发布了几款针对7月4日美国独立日的优惠套餐(Independence Day Super Sale),均为年付,基于KVM架构,采用NVMe硬盘,最低13.99美元起,可选拉斯维加斯或者迈阿密机房。这是一家成立于2014年的国外VPS主机商,主打低价VPS套餐且年付为主,基于OpenVZ和KVM架构,产品性能一般,支持使用PayPal或者支付宝等付款方式。商家客服响应也比较一般,推...

http://www.xiaomi.com/为你推荐
futureshop在加拿大买电脑的注意事项是什么?安徽汽车网安徽省各地车牌号简称是按照什么顺序排的嘉兴商标注册怎么查商标注册日期刘祚天你们知道21世纪的DJ分为几种类型吗?(答对者重赏)psbc.comwww.psbc.com怎样注册rawtools相机中的RAW是什么意思?mole.61.com摩尔庄园的米米号和密码我都忘了 只记得注册的邮箱 怎么办-_-m.2828dy.comwww.dy6868.com这个电影网怎么样?www.vtigu.com如图,已知四边形ABCD是平行四边形,下列条件:①AC=BD,②AB=AD,③∠1=∠2④AB⊥BC中,能说明平行四边形www.javmoo.comjavimdb是什么网站为什么打不开
域名申请 网页空间租用 国外免费vps 香港vps主机 免费申请域名 photonvps bandwagonhost pccw 国外空间服务商 论坛空间 主机合租 193邮箱 新天域互联 天翼云盘 微软服务器操作系统 万网空间购买 银盘服务是什么 空间首页登陆 www789 日本代理ip 更多