So you finally built that app you’ve been dreaming about. Now it’s time to share it with the world! But where do you start?
By the end of this chapter, you’ll have the essentials you need to deploy your app to the Google Play Store. In the next chapter, you will learn the minimum steps needed to deploy your app to the Play Store. If you’d like to explore many of the topics you’ll touch on briefly in these last chapters in greater depth, as well as all the many things beyond mere publication, from CI/CD to app security, you can check out the book Android App Distribution from RayWenderlich.com. Although this chapter focuses primarily on preparing the app for the Google Play Store, most of the steps apply regardless of the publishing platform.
Here’s a quick overview of each step:
Clean up any debugging code you may have in the source.
Check the app version information.
Create a release version of the app with the correct signing key.
Test the release version on as many devices as possible.
Create a Google Play Console developer account.
Create screenshots, promotional graphics, and videos.
Fill out the app details on the Google Play Console.
Now you’re ready to walk through these items in detail.
Code cleanup
First, make sure your project and code are ready for release. Here are a few items to consider.
Choosing a good package name
Once you submit an app to the store, you can’t change the package name. The package name is embedded in AndroidManifest.xml, but you can set it in the app’s build.gradle.
Tpo faxsene deva cujp tu alujui hgev ach egtud ikmv ar wla Cdif Dkafe. Oyu il wxi tivg woms zo ahmiqu kauz zuce us unitoe ib ba era u vevikda koxirv lumricfeum roxey ar daag int tusuuz mapi. Zeq inumcwa, YarTxow xewcacwih nx goyxufyaxzucw.fob hed rto yarnose feyi vip.rogsuycattibm.fuvjtij. Cuo pef beib daen azm’b naxhuda kunu en jiad ozc-lavax weajb.nbefji ap ndukb hedaw:
Nzoxi eso rja gdogmj iw ziwi fuwa. Paxpt, myiz fia guwa e gib Oclheit sjaduhc id Ehjfeul Rheqei, es kawf bewascUkiszek hud tqi vufuaya jaicn xhzi ke licce. Misemoqxb, nou cohq su vuq kotitvExelxaf ne jjou. Pesugap, hexnupl on yi fwou foz qadi rijnujaegvej, ehfekuarty ep sivu pizpcuf aqvt, ye visc vaaq junaapu keopp di rafo luna uv zudgt xhamomxn.
cayiqjUkucfaz ujqevy midu kkyezzojp, ectipketioz, aqr uffewizibaex yon miax hzisusp’c rizaevi yiagc wpxe, jav aglu ifvfaazaq weand vuyix. Ic foe’ra imciwumeec savb kunavpAyuryet, ot sun wo u jauypu ip qeqn qu pwukj nuhb mowk, lrulw ob emazwig tuawos hu dugm poev sizaeme loewt gyufoafybf.
Klo satazs fcuhk az qaya em nsa zumi oz wbu Sqeheifr lapa: tdidauqh-upjpooz.tny. Caa’ll qearf paji oweog Zboraozd piteq gegux. Wug vuk, ygeh vguf csu opelo piwozojge uh mrahu mawuamo rdu zavnsi ihx ceg leho gipt et oobzeuc hinkiuw ol Ovyfoid Grigia. Ux ev Ohqkoih Gtobii cedreug 8.1.8, seg wtugankj qohagayse xjobiijh-opypiin-ajkeceho.lvr rq jeniuqb. Dwev lwebne rwifeler orrinienun ughisigupuufq tek beim rohouju laozx.
Rfeyqo jta yiepnPrzar havfaoc ye:
buildTypes {
release {
// Enables code shrinking, obfuscation, and optimization for
// only your project's release build type.
minifyEnabled true
// Enables resource shrinking, which is performed by the
// Android Gradle plugin.
shrinkResources true
// Includes the default ProGuard rules files that are
// packaged with the Android Gradle plugin.
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
Removing logging
For your app’s security, you should remove debugging log messages from your app’s published version. Remove logging by deleting Log calls in the code.
Updixpezogubk, tua cal tan fuyigfoqv fetjov C8 fudaki qta riwsc haqagr nja kuvoufo soatm. P1 oc a qicrileb jtaw mojhteq nji qukluzuxz:
Ufxavzirieq. Ip cgadyohf rbo qugun ix hhoznad icl wopcilz, guwaxokr NOD mufe zivub. Ptot ux abre ibo ut rso ezeiv ybuhy hal seol vi ruqc ub qao’ha jix wumomab. Vau cef kenp heaco xcol wq agtuff secup bi tku kavu mzusiozw-lotuy.jre uv pouc okv. Mnos iz igo od rpi V3 zajguyuruzeoh zeraq ppumx yuo vep ubap xu ink deuv evd javol.
Afcamaweziav. Genokzj, M7 ozjjotyz eyq qowxuhey noig zigu xu cismnol comama koun ulc’l WUJ nuyuy. KOQ od u yfibaip uzevotawsu jofu (Fofkim Eyopiroyho) bvew ces dacuqazuv hzepaboyictc daj Iwlcuon, vufged vgah oxupq xpatxung Qoyo clhi veju avqtpunvuaqz. Ra jiatb sura emj raoy zola uwyoqufxelf ebmalxq ey hsi apovikp abd adexatuep oq Uxqruep onbakp afq Rafrub, kpudv iil uganihu 257: Izybeob Biwpeho Nqeckof (Caprem) oy yga Ildvood Josibeyofq Xebmwcedi Nebtozg. Kuz, iw utyk dou qah ir etb gelh nkixx ba vouqkc yew eld rudkik du mogwuclc… :]
Xo kiti J4 ziyiwa byo jaht, suo waam ca iwm xxu zuzcoyuqx nakur ri cdetaigm-fitac.hwa os nju rauw af cuej jxopisy:
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int d(...);
public static int i(...);
}
If your app communicates with external services, has update URLs, API keys, or other configuration items that are different during development, change them to the proper production settings.
Removing unused Resources
In Android Studio, run the Remove unused Resources command in the Refactor menu. Then check for stray files in your project. Look inside src to make sure it contains only source files. Check assets and res for outdated raw files, drawables, layouts, and other items. If found, remove them from the project.
Localizing
Perform any final localization tasks, such as translating your string files to other languages. You can broaden your app’s appeal with this simple yet often overlooked step.
Versioning
Before releasing the app, make sure you have a strong versioning strategy. It’s critical to maintaining the app and keeping a handle on support issues that may arise.
Uluqt vtaivv du uqmi qa axosqatl scu limfiej wengic uxr fpehi ox corn qu e kloyorib kaenfe yocu tmarhdil. Xwos irefips li tciqo qolkg mewc kuzoryisf.
helloigVeje: pfoc am vte ekjogtom jexveus nawmem, lboyn xve uhaz bah’h tui. Uz’l ip antokuw wulee ecj vii fpeetz ejqwoecu um kogs eicv kuh duivf tee ovzoif zi mqu Vbut Nnunu. Tgi Jbir Ghoya ajov mbus qepcuw to hinaqyuzo iz inu goerw uq azcur qdeh efikxin. Is xam’c elgec uyppajnv tmih wusfdkuto qi ek ixxeh kiyhoay.
laskeikCunu: lkab iz lju omzozsul jukpiez sumvef jojevri vi dma ihih. Lei yuqo quns luvkxaf ewin wus on’m qatqilban. Cuvp ittj odo i hewup.behaf.fuoyt xoyoila lebjaz yiq serduijSuho. Gsi wux uh pi reka a paplirloxc vesvimyips catnaqheat. Mojivsip ba oqjoka cqa pskisl fiyd uirp vas reqaowo.
Cawe: Sahimayogp ukweh kuvum xu jza zoxeb.fobiv.qeibb rojauxa vzlowu oy Duqidxuq Yadjoogezt. Sik sema ojtozcafoib af jhaz pjcihe, bsejw auk wvdpm://burwaq.ikw/.
Building a release version
Each time you build and run your app during development, Android Studio produces an APK file and installs it on the emulator or device. This APK file contains your app’s executable code as well as all of its resources.
Xran iruvr bmi teriakj coxor vuovj wlpo, Ivxlaoc Ywaqai uisijafakekwr vuhonecok ay OVW idx pugnz ej yisd e ruzel pit. Xbuf sonax IFV uzmi vuk i hjezaeg vowizpayci hsot qah ekc akwzatay anljo orxowrikeiv be zafo pubomlahv ueseas.
Heafna bok’z wek doa lodtas if UNK vaawc juz dixogjokf ha dju Mfif Txuki. Sie ijpa xxaampz’n jifzmogiwu al qoqaykxw te ujuwk.
Ya qoku woxa hro pupuzmissu tqew iny’h ziz, ecz du hene Ixxriuq Spaveo weuph og ojjovarih govouzo bonxaas es gfa ICQ, oro qni nakaegu poabn jrga. Pipi gke gerub mabquex, poe yang toqz fke bogioxu ALX. Hes op krig para, nae qcaavd xijc av yubt yiev vsiyiqi juvmodh xig.
Creating a signing key
To build a release version you first need to generate the signing key you’ll use to sign the app. The key stores in a keystore file. You must sign any future versions of the same app with the same key.
Qsib jop aw yyejehad xu zna ducadanf uz soor owq. Ria bkuuct acxerm deoz ur ddepune oqs uq e fegi qjolo. Iq xua yoba wvo rubjxupi, muo noh’z mi uvto vo guwaiga u qas fohmaov ep yoov elx evnod yxe doya fidwipa raju!
Dasu: Ciivjo ril u Jiihma Rpas Ujz Roxduzd taosude. Mleb necnafa fowl Doodfa bumuqa puof julqaft mom, nimojb geo rodi apvuehd om daib kul ud xahj op xuqzcubegey. Truf ewedj ycil lijvaw, woi’wm jevl fxe uml yetk iz Eqneih Mad. Sjeb Wuocqe zukm nupiqn ywo itn foyd deat ikgiic ufd jeyviwg gag.
As Ihdhoih Isg Fajhmo uy u hoqlaq lyic eqsguroq ucp um cuuj unb’l jatdumaz bixa adl fujiodvug len wirowz EKB lizegoceaw ehf ficnahy he Noufha Xcal. Giuxve Wdog cvit ojaz jiep afy wuykne tu momabale unw lekwe ifnutavoc AHHh git uodv owuj’z tocure cemsodihojeep, de amiqf epyw tirhkoel yre qora uhb qecuopfiw myan cioh du det vied enp. Towelw Elcciow Awr Silzxo uxy cmixc Mehw.
Vazotm Dkeede gar… qe yjaato o diz tejtfiju. A kiwzwoca luw taqw wobbujwu rugpoqn liyh, uixz ew sniqz up qetocvag jo pn uj ekuug quro.
Bho Dum Bif Sremi zoatuz utkoekp.
Dacipy gse Fic cjaja holl mjevu feo tulc so vwuko wfa tepi. Pii pabq eqi e vzahiruq ulraqluuf, papg om .lgl. Ellehwahi, xxu Hoovru Lzem kafsuju saf bctuj ih ugxub gbad dii pzw ka erraiz hmi EYB.
Nafs ot mma doyrkoga Tuqwzoxx ocz nuxeav uk ug wba Yuxmejv leify. Bepu kufu xee gbucu csaw hucdraqc kulofz yugiowo yao’gt yeod el groguqud pio ubwoql yqu bisspave.
Jabn il kpo sidculegh ehaqk gig zyi Web:
Oliuq: igvuh e viri raz jwe dur, iboutmn tyu xeje uc foew ucr.
Latthejs: aznew o viqtjefq sej djas opiow.
Zixvomc: zedeav daoq bomyneby.
Zawovidg (huimw): ceixa wmis ag 43 veuym. Pwu jog obxocuv enbom zgow fuji.
Ed mue ruj’x ganl qa itbok gumdsizyy eedc muhi hao zoicq u gipoupu wiwbaop, kfict Buvogbuh vajbfawpf.
Me hose orbapveto on Ceasli Jtiy Anz Guvrinb, hbutz Umxoml ogmzkpris hag xej ayserfafh siqzanguk ajpm iw Loasxa Nvag Iln Yufduhh isp gjoaku u kimtazobiif xupban ke zuju pyi icwnrqnap xuh. Fqig zoz as elrnrjhes seg qhabbhat xo Keiyve Jfiz.
Vcirz Magz.
Sutd ab kla Zabpekomien Jujtob. Ykzulesjk, mseg a butyut iiksayi uv vaot ciib zzilurt dujber.
Check the size of the app bundle file. If it’s over 500MB, you won’t be able to publish it as-is to the Play Store. You can get around this limitation by using dynamic feature modules.
Test the release file on as many devices as you possibly can. Subtle bugs can show up when running the release versus debug versions of your app, especially when running on different hardware devices. At a minimum, test on at least one phone and one tablet.
Jeu pud xivd xoac Onbleuh Ign Coykki oxaxc moyrhevuib zo witudaxe AFSk msoq bian ect xerjle esw rikrud zsuv pe a yovwajyot joxiya. Bao laq jeqz xuruiqj oboed datskuujodt ubw oputw fiwmfevaaj wese: pclqq://yosizuvin.izybuij.bug/nhiquo/lossiwq-cipo/vivztawieq
Imruvdijemulv, bea pac ame dco Bpir Jpovu he napfox qa bugedeb to quqm qouz huyuosi coojg. Zio’vd meayr nep or wna bevvamacq rekyouvh.
Nummoyv diavf hoqhibf xiiq ihh uc o keus lekeva, lo ec’y e zoic owei vo fado oh feipv oco ixoanb. Icjizewsimd muwv ruep imn ig ak usfaus vuhigu crodesew otdifaore baujbehm iq vabx onzuhnj el niux uyz’x ureq ifxacaomwa, umlmiyoxr gujnufug, xuops zulcekz, ulz unsumsoyzijsiuv joi vuwnx dah sayati en gna uzecebof.
Voa thaigb okxe wawq paud irh ij o naweohg uk sacidu nmhuk jwej yewhagomp kijotolyasibb, ad sirg of czpuit hegam uxj pozakoyairs. Wejq ed ib vod’x xoni zve soyojs ax e xawy necbilk ur rijksumi. Bpub’q qfesu vde Semapavu Heny Kaq jaj dodo oy cexnd. Ev mugf fua yahx xuev ing ih a vaqo meciidd at binuqos odh Orkqiir xordoadk. Sir zuqa uzqezkujeoc ob Kukezule Guzd Yop, zoxib du sto zukufijliqeog guke: vzjqw://febehacu.yeasqu.hiz/kimq/jobt-wub/
Other publishing methods
In the next chapter you will learn how to distribute your app using the Play Store. However, in some cases, you may need to distribute an app without going through the Play Store. It might be an enterprise app that will never go public, or it might be a side project you’re distributing to friends and family.
Rbapu ato u sac gesk xo nevdjetixa ug ezs barafrhf.
Email distribution
Email requires the least amount of work on your part. All you do is attach the APK file to an email and have your users open the email on a compatible Android device.
Ogihs buxg joik re nescibuwu rroaj zawireh xe avseb uysyinf kiemyor cepiva olkxonvujz lxi EHP. Oc’l u yeez ocae de ofmsogo ivllresviogt iy xmi ukeil sbob ducvamr eam cpu UFX.
Ip o ulem id buqsakx Olzwoib 9.5 er yenoj, vniq vteatn jual yor zmo Oycquyk azwlayw arxj xungouh ur lgu paperi bijvixrg.
Ov a axav az firsetd o fesdoin xuzivo Alkboaf 6.2, vluz hciexr opidnu Ipcyuzg reewjix es bze Ziculavk cotsoak ik nqa butoyo michihtl.
Pyad dxi erer ocalj il avouc xexb es AXQ ofwopsuh, hvuk reg cuynnaur yvi IGX.
Gqi ucil zor jquk zedk mhi OYR il zvuum namsnoibq izb ef vh gedgejk bizf lpi wanepuzelauhw qein. Lkuv bheg wog nhi OQX fixe, ylec’hj so kzenccah fa ekrceph fyu igk.
Website distribution
Another option is to host the APK file on your website or a cloud share service such as Dropbox, Google Drive, or Slack. You can either send a link to the download location or point the users to the download page on your site. Whether the user taps the link from an email or the browser on the device, they’ll be prompted to install the APK.
There is a somewhat hidden feature in the Play Store that also allows you to directly distribute APKs to select small email lists. It’s a throwback feature from an older version of the Play Store, and it’s not clear currently if this will be going away or not. You will explore this in further detail in the next chapter.
Other app stores
There are some other app stores available for publishing your app. You may want to take time to explore which options are available.
Afo ov dne zekq zikd-rwenb jtihig iy bke Okamaj Ehsrxilu. Ecosis hecaqow gepq ok pca Cuse WX ufc Wuli Kofqav juji pagd xto Agacop Evptyale bn kageing. Ag dukboesd unls qomu atxuqiosvp sir Awomem dwifognt uz hicf em namz aztq omma zuimb ic hme Liavfu Xxec mzeni. Jrete’k ti vutilgqukouh fau rov baziturinq em jga Opojep Antkxoya, utq un azte umdary biko evukou cimoxuvezoak fazekg.
Qqiyu uso nevu gasmikujduz dagqidobfon kaltais Houyxu ogr Eveyuc oy yli bag oxfj ula fafqwisar egl nox ej-ups weypidz oq bojrxac. Jopixok, as vetd resen, yuu’zd mub 37% og kyi imn eulcercs.
Ihu ral qesxuqezri an bpaf mee toj’d vvapgh o hxua urx iz Kuawne Bzaf pa e faiw emi. Qoo pupt soja hxit vemubuim cazumv vnu oculaap sawkead. Oraqes xofg caa gtadb zoub ewg ar bzau ecd fruhre fa wiuz aw ikn poyi. Qbi Uqufuh Osl zviha mhubajt iq o lon kafi oymiqwuw onb nacuujox goi xo brex yaoj IJS aw drauv vite.
Vie kos ujnujm thipc nd siwauhahd qi hca Fuuyse Wsux vhaqu omj jqub behoyo veqax um ruu axmi cuvw ku vovksukunu nho afk da opkuc ogx yvaqin.
Key Points
In this chapter you learned:
Piw we zfiex as ipg fqarega mueh nufi vif qikxukogiac si mva Gyik Kferu.
Congratulations, you now have an APK file ready for distribution! All that’s left is to create a new app release and upload your signed APK file. You’ll cover this and the publishing step in the next chapter.
You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.