ʻOku mau fakaleleiʻi hoʻomou fakatokangaʻi! ʻOku fakapapauʻi mai ʻa e ngaue lelei mo ONMA Sikauti Android app.
Fetuʻutaki
ʻOku ʻikai ko ha potoʻi ngaue faingofua ke ako ʻa e Android Programmierung. ʻOku ʻi ai ha ngaahi lea fakafonua kehekehe ke fili mei ai, hange ko Java, Kaveinga-C, Swift, mo Kotlin. Ko e meʻa mahuʻinga ke ke kamata pea langaki mamalie hoʻo potoʻi ngaue. ʻOku mahuʻinga ke maʻu ha tokoni mo ha fakamatala mei he niʻihi kehe. ʻOku ʻi ai ha ngaahi maʻuʻanga tokoni lahi ʻoku lava ke maʻu ke tokoni atu ke ke kamata.
ʻOku angamaheni ʻaki hono fakatupulaki ʻo e Android-Apps ke ako ʻa e founga ʻo e kouti ʻi he Java. Te ke lava ʻo ako ki he founga ʻo e komipiuta ʻaki ʻa e Android-Studio. Ki ha fakamatala lahi ange, te ke lava foki ʻo kumi ʻa e Android-Kurse, hange ko ia naʻe foaki ʻe Michael Wilhelm. ʻE tokoniʻi koe ʻe he kalasi ko ʻeni ke ke maheni mo e syntaxes mo e idioms kehekehe ʻo e lea fakafonua, pea pehe ki he founga hono fakaʻaongaʻi ʻo e ngaahi meʻangaue kehekehe ʻi he Android.
ʻOku faʻa fakaʻaongaʻi ʻe he kau developer ʻo e Android app ʻa e Java koeʻuhi he ʻoku faingofua ke ako pea ʻoku lahi hono ngaahi tefitoʻi meʻa ʻoku ne ʻai ia ko ha lea fakafonua lelei ki he fakalakalaka ʻo e Android. ʻOku kau heni ʻa e tauʻataina ʻo e platform, fakataumuʻa ki he meʻa, mo e maluʻí. ʻOku ʻi ai foki mo ha ngaahi laipeli kehekehe ʻi Java mo ha ngaahi meʻa kehe, ʻa ia ʻoku faingofua ange ai hono faʻu mo tauhi ʻo e ngaahi polokalama ʻi he ngaahi lea fakapolokalamaʻi kehe.
ʻOku poupouʻi ʻe he Android ʻa e faʻahinga afo ʻe ua: kouti tuʻufonua mo puleʻi. ʻOku tohi ʻa e kouti tuʻufonua ʻi he Java pe Kotlin pea fakatahatahaʻi ki he bytecode ʻi he founga tatau pe mo e Java. Makehe mei he Java, ʻOku toe poupouʻi foki ʻe he Android ʻa e Kotlin. Ko e Kotlin ko ha lea fakapolokalamaʻi ia ʻoku ne fakaʻaongaʻi ʻa e lea Java pea fakatahatahaʻi ke bytecode ʻi ha founga tatau mo e Java.
Ko e meʻa mahuʻinga ʻe taha ʻi Kotlin ko e fakaʻilonga ʻo e faʻahinga. ʻOku ne fakaʻata ʻa e compiler ke ʻiloʻi he taimi pe ko ia ʻa e faʻahinga ʻo ha variable mei heʻene initializer, fakasiʻisiʻi ʻa e fie maʻu ke vakaiʻi ʻa e tohi nima. ʻOku ʻi ai foki mo ha plugin compiler ʻa Kotlin ʻoku tokoni ke faingofua hoʻo ngaue ki he ngaahi fakamatala.
Ko e Objective-C ko e tefitoʻi lea fakapolokalama ia ki he iOS mo e OS X. Ko ha superset ia ʻo e C pea ʻoku ne ʻomi ʻa e ngaahi meʻa ʻoku malava ke fakataumuʻa ki he ngaahi meʻa mo ha runtime longomoʻui. ʻOku ne maʻu ʻa e ngaahi faʻahinga motuʻa ʻo e lea C ka ʻoku ne tanaki atu foki ha syntax fakaʻuhinga ʻo e kalasi mo e poupou ki hono puleʻi ʻo e kalafi ʻo e ngaahi meʻa. ʻOku ʻi ai foki mo e taipeʻi malohi pea toloi ʻa e ngaahi fatongia lahi ki he runtime.
Naʻe faʻufaʻu ʻa e Objective-C ʻe Stepstone ʻi he 1980 tupu pea kuo hoko ia ko e lea fakapolokalamaʻi moʻoni ki he iOS mo e macOS ʻi ha ngaahi taʻu lahi. Ko e ngaue mulle-objc ko hano toe fakaʻaongaʻi ia ʻo e lea fakafonua ʻoku ne poupouʻi ʻa e GCC mo e Clang/LLVM compilers. ʻOku ne toe poupouʻi foki ʻa e Windows, Linux, mo e FreeBSD.
ʻOku poupouʻi ʻe he lea fakafonua ʻa e taipeʻi malohi, ʻo fakaʻata koe ke ke liliu ʻa e lahi ʻo hoʻo kalasi pea kei tauhi pe ʻa e fenapasi binary. ʻOku ne toe poupouʻi foki ʻa e ngaahi variable ʻo e instance ʻa ia ʻoku synthesized ʻi he runtime pea fakaha ʻi he interface ʻo ha kalasi. ʻIkai ngata ai, ʻoku ʻi ai ʻa e syntax ʻo e enumeration vave ʻa ia ʻoku functionally tatau mo e ngaahi meʻa NSEnumerator.
Neongo ʻoku lahi ʻa e ngaahi lelei ʻo e Objective-C ʻia Swift, ʻOku ʻikai ko e fili lelei taha ia ki he polokalama kotoa pe. ʻOku ʻikai faingofua hono fakaʻaongaʻi ʻo e lea fakafonua, pea ʻoku faingataʻa ke debug kapau ʻoku ʻikai ke ke ʻilo e founga hono fakaʻaongaʻi totonu. Ko e kovi lahi taha he ʻoku ʻikai ke malohi ʻo hange ko e lea ko e Swift, ka ʻoku faingofua mo feliliuaki ange.
ʻE lava ke faingataʻa hono fakapolokalamaʻi ʻo e Android apps kapau ʻoku ʻikai ke ke ʻilo e founga ke fakakouti ʻi he Swift. ʻOku makatuʻunga ʻa e lea foʻou ʻi he lea fakafonua LLVM, ʻa ia ko ha compiler maʻuʻanga tokoni fakaava. ʻOku ne fakatupu ʻa e kouti fakatahaʻanga maʻa e processors ARM pea liliu ia ki he kouti ʻo e misini. ʻOku fakatupu ʻe he NDK tuʻufonua ʻo e Android ʻa e fehokotakiʻanga binary ki he faile ʻo e meʻa ko ia naʻe faʻu, ʻa ia ʻoku toki faʻo ki ha Android app.
Ko e Swift ko ha lea fakapolokalamaʻi kehekehe ia ʻe lava ke fakaʻaongaʻi ke fakatupulaki ʻaki ʻa e Android mo e iOS. ʻOku malu ange ia ʻi he Objective-C pea ʻoku lahi ange hono ngaahi fotunga. ʻOku toe faingofua ange foki ke ako. Ko ʻene poupou ki he ngaahi fokotuʻutuʻu ʻo e Koko, kau ai ʻa e Cocoa Touch, Tokoniʻi ʻa e kau developer ke tomuʻa vakaiʻi ʻenau polokalama fakakomipiuta kimuʻa pea. ʻOku ne toe fakaʻaongaʻi foki ʻa e Objective-C runtime mo e LLVM compiler framework.
ʻOku ʻiloa ʻa e palopalema ʻo e ngaahi laipeli cross-platform, pea ʻoku ʻikai fakahangatonu ia ki he Android. Hangē ko ʻení, Kuo fakaʻaongaʻi ʻe he kautaha vaʻinga vitioo ʻa e ngaahi laipeli cross-platform ʻi ha ngaahi taʻu lahi. Ko e ngaahi laipeli lalahi ko e OpenGL, SDL, mo e OpenAL. ʻOku ʻi ai foki mo e ngaahi laipeli ki he ngaahi mataʻitohi, ongo, mo e ngaue ki he ʻimisi. Ki he kulupu fengaueʻaki, ʻoku fakaʻaongaʻi ʻe he platform ʻa e cURL. Ko e laipeli mahuʻinga ʻe taha ko e Chipmunk, ʻa ia ʻoku ne ʻomi ha misini fisiki ki he PureC.
Ko e XML ko ha lea fakaʻilonga ia ʻe lava ke fakaʻaongaʻi ke fakamatalaʻi ʻaki ha fokotuʻutuʻu mo tanaki atu ʻa e kakano ki he fakamatala. Kuo fakaʻaongaʻi lahi ia ʻi he kautaha pulusi ʻi ha ngaahi taʻu lahi pea ʻe lava foki ke fakaʻaongaʻi ʻi he polokalama Android. Ko ha talateu ʻeni ki he XML ki he polokalama Android. Ko ha konga mahuʻinga ia ʻo hono faʻu ha aʻusia lelei ki hoʻo Android app.
ʻI he Android Studio, te ke maʻu ai ha ngaahi faile XML kehekehe ʻoku nau fakahoko ha ngaahi taumuʻa kehekehe. Hangē ko ʻení, te ke maʻu ha ViewGroup, LinearLayout, mo e RelativeLayout, ʻa ia ʻoku ʻi ai ʻa e View mo e kotoa ʻo hono fanga kiʻi widget ʻo e fanau. Te ke toe fakatokangaʻi foki ʻoku fokotuʻu ʻa e ViewGroup ʻi lalo ʻi ha View, pea ʻoku ʻi he View ha View. ʻE faʻu ʻe he faʻahinga faile ko ʻeni ʻe tolu ha screen ʻi ha Android app.
Ko e XML ko ha lea fakaʻilonga maʻamaʻa ia ʻoku ne tauhi ʻa e fakamatala ʻoku fakaʻaongaʻi ʻi ha tohi kole. Fakakaukau ki ai ʻo hange ha spreadsheet: ʻOku ne tauhi ʻa e fakamatala kotoa pe mo e fokotuʻutuʻu ʻo e ngaahi kolomu mo e ngaahi konga (field). ʻOku ʻi ai foki mo ha faʻahinga fikaʻi pe ʻoku fakahoko. ʻOku toe fakaʻaongaʻi foki ʻa e XML ke fakaʻuhingaʻi ʻa e fokotuʻutuʻu, ngaahi lanu, ngaahi sipinga, mo e fua ʻi he ngaahi polokalama Android. Ko e XML ko ha lea fakafonua faingofua ke ako mo fakaʻaongaʻi fakataha mo ha lea fakapolokalamaʻi.
Kapau ʻoku ke fie ako ki he founga hono fakapolokalamaʻi ʻo ha Android app, Kuo ke haʻu ki he feituʻu totonu. ʻOku fokotuʻutuʻu ʻemau kalasi ʻi he ʻinitaneti ʻi ha seti ʻo e 35 modules ʻoku ne ʻufiʻufi ʻa e ngaahi tafaʻaki kotoa pe ʻo e fakalakalaka ʻo e app. Neongo ʻoku ʻikai fie maʻu ha ʻilo lahi ki he polokalama ke mahino mo fakahoko ʻa e kalasi ko ʻeni, ʻOku totonu ke ke maʻu ha tefitoʻi ʻilo ki he polokalama fakakomipiuta.
Makehe mei he mahino ʻa e ngaahi tefitoʻi moʻoni ʻo e polokalama, Te ke ako foki fekauʻaki mo e operating system mo e faʻunga ʻo ha app. ʻE fakaʻata koe heni ke ke faʻu ha ngaahi polokalama ʻoku fenapasi mo ha ngaahi polokalama ngaue kehekehe. ʻE toe fakamatalaʻi foki ʻe he ako ʻa e founga hono hiki ʻo e kouti ʻoku lava ke lau. ʻOku mahuʻinga ʻeni ki hono faʻu ʻo e ngaahi polokalama ki he ngaahi meʻangaue toʻotoʻo.
Ko e Android ko ha polokalama ngaue toʻotoʻo manakoa ia. Ko hono ola, ʻOku fuʻu fie maʻu lahi ʻa e kau faʻufaʻu polokalama Android pea ʻoku ʻi ai ʻenau faingamalie maʻuʻanga moʻui. Te ke ako ʻa e Android platform, ʻa e ʻatakai fakalakalaka ʻo e Android, mo e lea fakapolokalamaʻi Kotlin.
Ko e Kotlin ko ha lea fakapolokalama ia ki he Android ʻoku fenapasi kakato mo e Java 6. ʻOku ʻuhinga ʻeni ʻe lava ʻe he kau developer Java ʻo faʻu ʻa e ngaahi polokalama Android mo fakaʻaongaʻi ʻa e Kotlin. Neongo ia, koeʻuhi ʻoku ʻikai ko ha platform pe ʻe taha ʻa e Android, mahalo ʻe faingataʻa ki he Java developers ke liliu ki he Kotlin.
Ko e sipinga ʻe taha ʻo ha Android app naʻe hiki ʻi he Kotlin ko e Pinterest app. Ko e Kotlin ko ha founga lelei ia ke faʻu ai ha ngaahi polokalama ki he ngaahi meʻangaue toʻotoʻo. Kapau ʻoku ke fie ʻilo lahi ange fekauʻaki mo e lea fakapolokalamaʻi ko ʻeni, Lau ha niʻihi ʻo e ngaahi fakamatala ko ʻeni. ʻOku tohi ʻa Christina Li fekauʻaki mo e meʻa naʻa ne aʻusia ʻi hono fakaʻaongaʻi ʻo e lea fakafonua. ʻIkai ngata ai, te ke lava ʻo ʻaʻahi ki he uepisaiti ʻa e Kotlin ke sio ki ha lisi fakautuutu ʻo e ngaahi kautaha ʻoku nau fakaʻaongaʻi ia.
Ko e Kotlin ko ha lea fakapolokalamaʻi ia ʻoku fakataipeʻi ʻi he misini fakaʻilekitulonika Java. ʻOku ʻi ai ha maʻuʻanga tokoni fakaava ʻa e lea ko ʻeni pea ʻoku fakamamafaʻi ʻa e malu, mahino, mo e fengaueʻaki. ʻOku ʻi ai ha faingamalie lahi ke fakaleleiʻi ʻa e fakalakalaka ʻo e Android, pea kuo ne maʻu ha fakavaʻe faʻufaʻu mateaki.
ʻE faingofua pe ke hiki ki Kotlin ʻa e kau developer ʻoku nau maheni mo Java, he ʻoku fie maʻu ha ngaahi houa siʻi pe ke ako. ʻOku ne toe poupouʻi foki ʻa e polokalama ngaue mo e coroutines, ʻa ia ko ha meʻa lelei ia ki he kau faʻufaʻu Android. ʻOku ne fakasiʻisiʻi foki ʻa e lahi ʻo e kouti ʻoku fie maʻu ke tohi ʻe ha developer.
Kātaki ʻo fakatokangaʻi ange, ʻoku mau fakaʻaongaʻi ʻa e cookies, ke fakaleleiʻi hono fakaʻaongaʻi ʻo e uepisaiti ko ʻení. ʻI hono fakaʻaongaʻi ʻo e uepisaití
hokohoko atu hono fakaʻaongaʻí, tali ʻa e cookies ko ʻení
ʻE lava ke maʻu ha fakamatala lahi ange ki he cookies ʻi heʻetau tuʻutuʻuni totonu fakafoʻituituí