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-

极光KVM(限时16元),洛杉矶三网CN2,cera机房,香港cn2

极光KVM创立于2018年,主要经营美国洛杉矶CN2机房、CeRaNetworks机房、中国香港CeraNetworks机房、香港CMI机房等产品。其中,洛杉矶提供CN2 GIA、CN2 GT以及常规BGP直连线路接入。从名字也可以看到,VPS产品全部是基于KVM架构的。极光KVM也有明确的更换IP政策,下单时选择“IP保险计划”多支付10块钱,可以在服务周期内免费更换一次IP,当然也可以不选择,...

美国Cera 2核4G 20元/45天 香港CN2 E5 20M物理机服务器 150元 日本CN2 E5 20M物理机服务器 150元 提速啦

提速啦 成立于2012年,作为互联网老兵我们一直为用户提供 稳定 高速 高质量的产品。成立至今一直深受用户的喜爱 荣获 “2021年赣州安全大赛第三名” “2020创新企业入围奖” 等殊荣。目前我司在美国拥有4.6万G总内存云服务器资源,香港拥有2.2万G总内存云服务器资源,阿里云香港机房拥有8000G总内存云服务器资源,国内多地区拥有1.6万G总内存云服务器资源,绝非1 2台宿主机的小商家可比。...

hostkvm:7折优惠-香港VPS韩国VPS,8折优惠-日本软银、美国CN2 GIA、新加坡直连VPS

hostkvm本月对香港国际线路的VPS、韩国CN2+bgp线路的VPS正在做7折终身优惠,对日本软银线路、美国CN2 GIA线路、新加坡直连线路的VPS进行8折终身优惠促销。所有VPS从4G内存开始支持Windows系统,当然主流Linux发行版是绝对不会缺席的!官方网站:https://hostkvm.com香港国际线路、韩国,7折优惠码:2021summer日本、美国、新加坡,8折优惠码:2...

http://www.xiaomi.com/为你推荐
今日油条油条晚上炸好定型明天可再复炸吗?同ip网站查询我的两个网站在同一个IP下,没被百度收录,用同IP站点查询工具查询时也找不到我的网站,是何原因?psbc.com95580是什么诈骗信息不点网址就安全吧!javlibrary.comImage Library Sell Photos Digital Photos Photo Sharing Photo Restoration Digital Photos Photo Albums关键词分析如何进行关键词指数分析dpscycle痛苦术士PVE输出宏官人放题戴望舒的《狱中题壁》恶魔兜兜梦幻诛仙的恶魔兜兜怎么得的?国风商讯《国风周南》www.niuniu.com哪里有免费牛牛游戏可以玩啊
cn域名注册 太原域名注册 budgetvm liquidweb cve-2014-6271 香港新世界电讯 韩国网名大全 qq数据库下载 电子邮件服务器 100m空间 phpmyadmin配置 100m独享 广州服务器 中国网通测速 电信虚拟主机 国外ip加速器 789电视剧 移动服务器托管 独享主机 网通服务器 更多