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-

ThomasHost(月付5美元)美国/法国/英国/加拿大KVM,支持Windows

ThomasHost域名注册自2012年,部落最早分享始于2016年,还算成立了有几年了,商家提供基于KVM架构的VPS,数据中心包括美国、法国、英国、加拿大和爱尔兰等6个地区机房,VPS主机套餐最低2GB内存起步,支持Windows或者Linux操作系统,1Gbps端口不限制流量。最近商家提供了一个5折优惠码,优惠后最低套餐月付5美元起。下面列出部分套餐配置信息。CPU:1core内存:2GB硬...

亚洲云Asiayu,成都云服务器 4核4G 30M 120元一月

点击进入亚云官方网站(www.asiayun.com)公司名:上海玥悠悠云计算有限公司成都铂金宿主机IO测试图亚洲云Asiayun怎么样?亚洲云Asiayun好不好?亚云由亚云团队运营,拥有ICP/ISP/IDC/CDN等资质,亚云团队成立于2018年,经过多次品牌升级。主要销售主VPS服务器,提供云服务器和物理服务器,机房有成都、美国CERA、中国香港安畅和电信,香港提供CN2 GIA线路,CE...

CheapWindowsVPS:7个机房可选全场5折,1Gbps不限流量每月4.5美元

CheapWindowsVPS是一家成立于2007年的老牌国外主机商,顾名思义,一个提供便宜的Windows系统VPS主机(同样也支持安装Linux系列的哈)的商家,可选数据中心包括美国洛杉矶、达拉斯、芝加哥、纽约、英国伦敦、法国、新加坡等等,目前商家针对VPS主机推出5折优惠码,优惠后最低4GB内存套餐月付仅4.5美元。下面列出几款VPS主机配置信息。CPU:2cores内存:4GB硬盘:60G...

http://www.xiaomi.com/为你推荐
小度商城小度智能屏Air哪里可以买?大家都怎么入手的?h连锁酒店全国比较有名的连锁酒店?留学生认证留学生学历认证的意义是什么?lunwenjiance知网论文检测查重系统同ip域名同IP网站具体是什么意思,能换独立的吗seo优化工具想找一个效果好的SEO优化软件使用,在网上找了几款不知道哪款好,想请大家帮忙出主意,用浙江哪款软件效果好www.haole012.com012qq.com真的假的www.765.com下载小说地址斗城网女追男有多易?喜欢你,可我不知道你喜不喜欢我!!平安夜希望有他陪我过sesehu.comwww.hu338.com 怎么看不到啊
河北服务器租用 网站域名备案查询 域名主机基地 edis idc测评网 日本空间 panel1 免费全能空间 ibox官网 天互数据 hostker 腾讯实名认证中心 可外链网盘 国外免费asp空间 wordpress中文主题 万网空间 带宽测试 空间排行榜 websitepanel magento主机 更多