Programų išradėjas: sukurkite „Android“ programą - mokymo programa
Šiame praktiniame patarime paaiškiname, kaip sukurti „Android“ programas naudojant „App Inventor“. Vykdykite šį mokymą, kad per palyginti trumpą laiką sukurtumėte programas.
Prisijunkite prie „MIT App Inventor“
Eikite į „App Inventor“ svetainę ir viršutiniame dešiniajame kampe spustelėkite mygtuką „Sukurti“.
- „App Inventor“ reikalingas leidimas norint pasiekti jūsų „Google“ paskyrą. Patvirtinkite spustelėdami „Leisti“.
- Po pirmo prisijungimo galite dalyvauti apklausoje. Jei to nenorite, spustelėkite „Niekada nesiimti apklausos“.
- Tada spustelėkite „Tęsti“ į „App Inventor“ darbo vietą.
Sukurkite pirmąją programą „App Inventor“ - išdėstymą
- Viršutiniame kairiajame kampe spustelėkite mygtuką „Naujas projektas“. Įveskite projekto pavadinimą ir pasirinkite „Gerai“.
- Dabar vilkite „Etiketę“ iš „Vartotojo sąsajos“ kairėje į ekrano vidurį. Skiltyje „Ypatybės“ galite pakeisti pažymėtos naujai pridėtos etiketės „Tekstas“.
- Išsaugokite savo projektą per „Projektas“ ir pasirinkite „Išsaugoti projektą“.
- Dabar visus kitus vartotojo sąsajos elementus galite įstumti į ekraną. Kitą medijos turinį taip pat galima pridėti per „Piešimas ir animacija“.
- Norėdami pakeisti elementų išdėstymą, naudokite „Išdėstymas“.
Logika per blokus - pavyzdys
Jei norite sukurti papildomus programos ekranus, spustelėkite „Pridėti ekraną“. Tada, pavyzdžiui, galite pereiti prie antrojo ekrano išdėstymo, naudodami „Button“ vartotojo sąsajos elementą. Tačiau tam reikia logikos, veikiančios fone. „App Inventor“ juos sukursite naudodami „Blokus“.
- Norėdami tai padaryti, spustelėkite „Blokai“ šalia „Dizaineris“ viršutiniame dešiniajame kampe. Ten pateksite į atitinkamą ekraną ir spustelėsite mygtuką kairiajame „Blokų“ ekrane.
- Pasirinkite funkciją „kai mygtukas1.Spustelėkite padaryti“.
- Dabar į šį „Dėlionės“ elementą įdėkite „Kontrolės“ elementą, būtent „atidaryti kitą ekrano ekrano pavadinimą“.
- Dabar trūksta tik slapyvardžio. Norėdami tai padaryti, spustelėkite „Tekstas“ „Blocks“ ekrane ir pasirinkite viršutinį elementą, kurį sudaro tik dvi kabutės.
- Šiame teksto elemente, šiame pavyzdyje „Screen2“, įveskite ekrano pavadinimą.
Išbandykite programą savo išmaniajame telefone
Jei norite išbandyti „App Inventor“ sukurtas programas tiesiogiai „Android“ išmaniajame telefone, atlikite toliau nurodytus veiksmus.
- Įdiekite „MIT App Inventor Companion“ programą į „Android“ išmanųjį telefoną.
- Patikrinkite, ar kompiuteris ir „Android“ išmanusis telefonas yra tame pačiame „WiFi“ tinkle.
- Atidarykite programą savo išmaniajame telefone ir viršutinėje kompiuterio meniu juostoje spustelėkite „Prijunkite“ ir pasirinkite „AI Companion“.
- Išmaniojo telefono programoje palieskite „nuskaityti QR kodą“ ir nuskaitykite savo kompiuteryje rodomą QR kodą. Arba įveskite 6 skaitmenų kodą, rodomą programos teksto lauke, ir bakstelėkite mygtuką „prisijungti su kodu“.
- Dabar programą galite išbandyti savo „Smarpthone“.
Išbandykite programą naudodami emuliatorių
Jei neturite išmaniojo telefono, išbandykite programą emuliatoriuje, integruotame „App Inventor“.
- Atsisiųskite ir įdiekite „App Inventor“ programinę įrangą.
- Dabar atidarykite įdiegtą programą. Kompiuteryje atidaromas mobiliojo telefono ekranas.
- Dabar spustelėkite „Prisijungti“ meniu juostoje, esančioje „App-Inventor“ po jūsų atviru projektu, ir ten pasirinkite „Emuliatorius“. Jei anksčiau buvote prisijungę prie išmaniojo telefono, gali tekti paliesti „Reset Connection“.
- Programa dabar rodoma emuliatoriuje.
- Kai kuriais atvejais pamatysite klaidos pranešimą. Todėl „Companion“ programa nebeatnaujinta. Tada pasirodžiusiame lange spustelėkite „Gerai“.
- Patvirtinkite atnaujinimą emuliatoriuje spustelėdami „Gerai“ ir „Įdiegti“. Galiausiai emuliatoriaus ekrane spustelėkite „Atlikta“.
- Vėl prijunkite per „Prijungti“ -> „Atstatyti ryšį“, tada „Prijungti“ -> „Emuliatorius“.
Sukūrę programą, galite išsaugoti programos .apk failą kompiuteryje meniu juostoje, naudodami „Sukurti“. Paskelbę programą „Google Play“, turėtumėte pagalvoti ir apie programos rinkodarą.