Documente Academic
Documente Profesional
Documente Cultură
Contests(/contest/) Classes(/classes/)
Publish(/about/create.jsp)
(http://www.autodesk.com/)
Featured: RobotsClass(/class/RobotsClass/) Gardening(/howto/gardening/) ForTeachers(/teachers/)
Mother'sDay(/howto/mothers+day+gifts+breakfast+flowers/) advertisement
HowtoCreateanAndroidAppWithAndroidStudio by
TheZachBales(/member/TheZachBales/)insoftware(/tag/typeid/categorytechnology/channelsoftware/)
AboutThisInstructable
License:
8 1,171,454 views
1,759 favorites
TheZachBales
(/member/TheZachBales/)
(/file/F6G6BVPI7MXHO7C/)
Follow 123
(/member/TheZachBales/)
ThistutorialwillteachyouthebasicsofhowtobuildanAndroidappusingthe
MorebyTheZachBales:
AndroidStudiodevelopmentenvironment.AsAndroiddevicesbecome
increasinglymorecommon,demandfornewappswillonlyincrease.Android
Studioisaneasytouse(andfree)developmentenvironmenttolearnon.It's
bestifonehasaworkingknowledgeoftheJavaprogramminglanguageforthis (/id/HowToCreate
tutorialbecauseitisthelanguageusedbyAndroid.Therewon'tbemuchcode
usedinthistutorial,soIwillassumethatyouknowenoughJavatounderstand
orarewillingtolookupwhatyoudon'tknow.Thiswilltakeroughly3060 AnAndroidAppWithAndroidStudio/)
minutes,dependingonhowquicklyyouareabletodownloadandinstallAndroid
Studio.AfterusingthistutorialtocreateyourfirstAndroidapp,you'llbewellon
yourwaytoafunnewhobbyorpossiblyevenapromisingcareerinmobile Related
development.
EnablingDeveloperOptions
onAndroidPhone
Step1:InstallAndroidStudio (/id/EnablingDeveloper
OptionsonAndroidPhone/)
(/id/Enabling byNaveenG15
HowToSetupEclipsefor
AndroidAppDevelopment
(/id/HowToSetupEclipse
forAndroidApp
(/id/HowTo Development/)
YourfirstAndroid
Application(/id/Yourfirst
AndroidApplication/)
byComputothought
HowToRootAnAndroid
Device(/id/HowToRootAn
AndroidDevice/)
byAshishA5
(/id/HowTo (/member/AshishA5/)
CreatinganAndroidappto
communicatethroughAWS
(/id/CreatinganAndroidApp
toCommunicateThrough
(/id/Creating AWS/)
advertisement
(/file/FEBX9MXI7MXG4I1/)
(/file/F4P571QI7MXG4I4/)
1.Gotohttp://developer.android.com/sdk/index.html
(http://developer.android.com/sdk/index.html)todownloadAndroidStudio.
2.UsetheinstallertoinstallAndroidStudiofollowingitsinstructions.
advertisement
Step2:OpenaNewProject
(/file/FIA90KGI7MXG4IA/)
(/file/F1ZVMKJI7MXG4HX/) (/file/F71O9LTI7MXG4NN/)
(/file/FYGIC6BI7MXG4HW/) (/file/FC03WKLI7MXG4I0/)
1.OpenAndroidStudio.
2.Underthe"QuickStart"menu,select"StartanewAndroidStudioproject."
3.Onthe"CreateNewProject"windowthatopens,nameyourproject
"HelloWorld".
4.Ifyouchooseto,setthecompanynameasdesired*.
5.Notewheretheprojectfilelocationisandchangeitifdesired.
6.Click"Next."
7.Makesureonthat"PhoneandTablet"istheonlyboxthatischecked.
8.Ifyouareplanningtotesttheapponyourphone,makesuretheminimum
SDKisbelowyourphone'soperatingsystemlevel.
9.Click"Next."
10.Select"BlankActivity."
11.Click"Next."
12.LeavealloftheActivitynamefieldsastheyare.
13.Click"Finish."
*Note:ItistypicalnamingconventioninAndroidprojectstosetthecompany
nameassomeformof"example.name.here.com".
Step3:EdittheWelcomeMessageintheMainActivity
(/file/FLHQ3QMI7MXG4HY/)
(/file/FG53NYVI7MXG4NP/)
1.Navigatetotheactivity_main.xmltabifitisnotalreadyopen.
2.MakesurethattheDesigntabisopenontheactivity_main.xmldisplay.
3.Clickanddragthe"Hello,world!"fromtheupperleftcornerofthephone
displaytothecenterofthescreen.
4.Intheprojectfilesystemontheleftsideofthewindow,openthevalues
folder.
5.Inthevaluesfolder,doubleclickthestrings.xmlfile.
6.Inthisfile,findtheline"Helloworld!".
7.Afterthe"Helloworld!"message,add"Welcometomyapp!"
8.Navigatebacktotheactivity_main.xmltab.
9.Makesurethatyourcenteredtextnowreads"Helloworld!Welcometomy
app!"
Step4:AddaButtontotheMainActivity
(/file/FE60OS4I7MXG4NQ/)
(/file/FFQTVSVI7MXG4I7/)
1.NavigatetotheDesigntaboftheactivity_main.xmldisplay.
2.InthePalettemenutotheleftofthephonedisplay,findButton(underthe
headingWidgets).
3.ClickanddragButtontobecenteredunderneathyourwelcomemessage.
4.Makesureyourbuttonisstillselected.
5.InthePropertiesmenu(ontherightsideofthewindow),scrolldowntofind
thefieldfor"text."
6.Changethetextfrom"NewButton"to"NextPage."
Step5:CreateaSecondActivity
(/file/F65D7O2I7MXG4I6/)
(/file/FAOI00QI7MXG4K4/) (/file/F9YOCNXI7MXG4ID/)
1.Atthetopoftheproject'sfilesystemtree,rightclickon"app."
2.NavigatethroughtoNew>Activity>BlankActivity.
3.Changethenameofthisactivityto"SecondActivity".
4.Click"Finish."
5.MakesureyouareintheDesignviewofactivity_second.xml.
6.Dragthetextboxintheupperleftofthephonedisplaydowntothecenteras
youdidontheMainActivity.
7.Withthetextboxstillselected,findthe"id"fieldinthePropertiesmenuon
theright,andsetitto"text2".
8.Openstrings.xmlagain.
9.Addanewlineunder"Helloworld!Welcometomyapp!"thatreads
"Welcometothesecondpage!".
10.Navigatebacktoactivity_second.xml.
11.Selectthetextboxagain.
12.InthePropertiespane,setthe"text"fieldto"@string/second_page".
13.Makesurethatthetextboxnowreads"Welcometothesecondpage!"andis
inthecenterofthescreeninthephonedisplay.
Step6:WritetheButton's"onClick"Method
(/file/FGSOB2UI7MXG4I8/)
(/file/FV8RGT0I7MXG4I2/) (/file/F32T387I7MXG4I3/)
1.SelecttheMainActivity.javatabalongthetopoftheworkenvironment.
2.AddthefollowinglinesofcodeattheendoftheonCreatemethod:
Buttonbutton=(Button)findViewById(R.id.button)
button.setOnClickListener(newView.onClickListener(){
@Override
publicvoidonClick(Viewv){
goToSecondActivity()
}
})
3.AddthefollowingmethodtothebottomoftheMainActivityclass:
privatevoidgoToSecondActivity(){
Intentintent=newIntent(this,SecondActivity.class)
startActivity(intent)
}
4.Clickthe+nexttoimportatthethirdlineofMainActivity.javatoexpandthe
importstatements.
5.Addthefollowingtotheendoftheimportstatementsiftheyarenotalready
there:
importandroid.content.Intent
importandroid.view.View
importandroid.widget.TextView
Step7:TesttheApplication
(/file/FKWKMGCI7MXG4I9/)
(/file/FX9AJOJI7MXG4HZ/)
1.ClickthegreenplaysymbolfromthetoolbaratthetopoftheAndroidStudio
window.
2.Whenthe"ChooseDevice"dialogapperas(thismaytakeafewmoments),
selectthe"Lauchemulator"option.
3.ClickOK.
4.Whentheemulatoropens(thistoocouldtakeawhile),theappwill
automaticallylaunchtheappuponthevirtualphonebeingunlocked.
5.Makesurethatallofyourtextdisplayscorrectlyandthatthebuttontakes
youtothenextpage.
Step8:Up,Up,andAway!
(/file/FYRRF0HI7MXG4IB/)
(/file/F2ZDSY1I7MXG4IC/)
Congrats!You'venowcompletedyourfirstAndroidapplicationwithsomebasic
functionality.Yourfinishedappshouldhaveapagegreetingtheuseranda
buttonthattakestheusertoasecondpage.
Fromhereyouhavethecursoryknowledgeyouneedtogoontolearnallthere
istoknowaboutAndroidapplicationdevelopment.
advertisement
Ad
CallCenterSoftware
forthebestCustomerJourneyExperience
XCALLY
Wehaveabenicecommentpolicy.
Pleasebepositiveandconstructive. wIMadeit! AddImages PostComment
withoutthecompanydetails.can'twecreatetheapp??
GuysIhaveagreatideaforanappbutIdon'tknowhowtobuildit.Help
anyone?
mymailkumarkushal71@gmail.com
Hi!Ihaveanidea.aGreatappthatwillbehelpful.butIdon'tknowhowtomake
it(stillthinkinghow).thisapplicationmaybehelpfultothosewhoownmedium
businesses.Idon'tknowwho'stherightpersontodiscussthis.
pleasehelpme.
thankyou:)
pleasesendemail.Thankyou.
n.rey_noya@yahoo.com(mailto:n.rey_noya@yahoo.com)
Iwantappmakeaapformywebsitehttp://www.mloot.com,anyadvise?
2monthsago
Http:www.mloot.com
2monthsago
Http://mloot.com
phillearnsolutions(/member/phillearnsolutions) . huz25144
(/member/huz25144) amonthago Reply
Hello,wecanmakeanappforyourwebsite.Letmetakethisopportunity
tointroduceourcompanyPhillearnSolutions,asoftwareandtraining
solutionscompanyatanaffordablecost.Youcancontactusat
9030973722orphillearnsolutions@gmail.com.Kindlyforwardyour
contactyourdetails,sothatwecangetintouchwithyou.
CreateanAndroidAppWithAndroidStudio
http://www.tricksandhacks.com/createandroidappw...
(http://www.tricksandhacks.com/createandroidappwithappstudio/)
wheniruntheappiamgettingstringtypesnotallowed(at'id'withvalue
'@+id/')errorhelpmefixit
(https://cdn.instructables.com/FSB/CYD1/IZT6T49N/FSBCYD1IZT6T49N.LARGE.jpg)
veryhelpfulforbeginner...!!Thanks
ThankyouforposthelpfultutorialforNewcomersuserforAndroiddevelopment
andlearninguser.
Error:Failedtofindtargetwithhashstring'android24'in:C:\Android\sdk1
<ahref="install.android.platform">Installmissingplatform(s)andsync
project</a>
howtoresolve
HowToCreateAnAndroidAppWithAndroidStudio
http://www.tricksandhacks.com/createandroidappw...
(http://www.tricksandhacks.com/createandroidappwithappstudio/)
ithinkyouhavetoupdateyourinstructions,asthelatestversionshavehalfthe
stuffchangedbutotherthanthat,thiswasbrilliant
JonesS5(/member/JonesS5)
AclearguidetodevelopourownAndroidApp 3monthsago Reply
(http://www.credosystemz.com/traininginchennai/best
androidtraininginchennai/)withAndroidStudio.
Thnaksforyourinformativearticle.itsveryuseful.<a
href="http://www.bestandroidtrainingchennai.in/(http://www.google.com/url?
q=http%3A%2F%2Fwww.bestandroidtrainingchennai.in%2F&sa=D&sntz=1&usg=AFQjCNFIq7D_HTwFckyei_ZkSH3BBN
kAQ)">AndroidTraininginChennai</a>
HiGuys,
Icantseethisbitunderstrings:
Addanewlineunder"Helloworld!Welcometomyapp!"thatreads"Welcome
tothesecondpage!".
Seebelow:
Whatamidoingwrong?
(https://cdn.instructables.com/F55/NX04/IZ6CB3IC/F55NX04IZ6CB3IC.LARGE.jpg)
Itisverygoodwayforappdevelopment
3monthsago Reply
tejaswiTeju(/member/tejaswiTeju)madeit!
Unabletodowmloadthefoolowing.Helpmeout
(https://cdn.instructables.com/FU0/8M49/IYNLN9CG/FU08M49IYNLN9CG.LARGE.jpg)
Ialreadyandroidstudioinstalled
idont'tknowhowtodevolepapppleaseteachme
HowToCreateAnAndroidAppWithAndroidStudio
http://www.tricksandhacks.com/setupeclipseforan...
(http://www.tricksandhacks.com/setupeclipseforandroidappdevelopment/)
OK,soundacoolwhenIreadaboutstep4:clickanddragbuttons?
1,674MBfordownloadingtheAndroidStudio...
Iamnotabletoseemyappinandroidemulator
myemulatordoesn'topen...andafteropenanerrorisVTxandBIOS.blah!
blah!blah!pleasetellmesolutiontoopenmyemulator.
5monthsago
Hey!.
OnWindows,gotoBIOS>advancedsettings>
Thereshouldbeanoptiontoenablevirtualization
Saveandrestartyoursystem
ididnotunderstandhowtoopenthestrings.xmlpage
11monthsago
HarshulSthestrings.xmlpagecanbefoundinthefollowing
area:
"project_name"\app\src\main\res\values\strings.xml
Toopenit,justdoubleclickitintheleftpaneofAndroidStudio.
Hopethishelps.
10monthsago
Openingthatdoesnotchangecenteredtextforme
Ionlyhadonelineofcodeinthere(otherthan<resources></resources>
anditwas<stringname="app_name">HelloWorld!</string>
DoIhavetoaddtheothers?BecauseItriedthatanditstilldidn'tchange
thecenteredtext.
BinditaJ(/member/BinditaJ) . OjoeMDC(/member/OjoeMDC) Reply
6monthsago
youneedtochangethetextpropertyofthistextboxto
@string/hello_world.Intheproperties,youmightsee2"text"s.Change
theonethathasasmallspannerlikeicon.
6monthsago
Iamalsoexperiencingthisproblem.IthinkthatAndroid
StudioProjectshasbeenupdatedsincethistutorialwasmade.An
excellenttutorial,justcan'tfollowitexactalystepbystepanymore.
6monthsago
Yep,imgladtoknowimnottheonlyonewiththisproblem.
6monthsago
ThatistrueweareuptoAPI25nowandthisthiswas
writtenwhen21wasthelatestAPI.TruthbetoldtheONLYtimeIbother
withstrings.xml(whichstillisinthesamestructureImentionedabove)is
forthingslikeappnameorstaticmenubartitles.Studiowillcomplain
whenyoubuildtheprojectandsuggestthatyouusethestrings.xmlfile
butwhenyoustartgettingintothreadedappsanddynamiclabelsthe
stringsfileloosesitsusefullnes.
NotsurewhatversionofAndriodstudioyouareusingbutIhave2.2.2forlinux
installedandhadtoprettymuchusemyownprogrammingskillstomakeanyof
thiswork.:(
Iamjustgettingtoknowhowtoprogram,Ineedasamplebuttoncodethat
openinputtedURLonadefaultbrowserandalsoacodethatdisplaywritten
textinanewwindow
HowToCreateAnAndroidAppWithAndroidStudio
http://www.tricksandhacks.com/createandroidappw...
(http://www.tricksandhacks.com/createandroidappwithappstudio/)
Ithinkthisisoutofdate.IntheversionofAndroidStudioIdownloadedand
installedtoday,there'sno"BlankActivity"option.Also,thestrings.xmlfileisnot
readilyavailableIhadtolookatanothercommenttoseewhereitwas.Plusthe
"helloworld"stringisn'tinthere.
WhenItrytorunthis,I'mtoldthatandroid.support.design.widgetdoesn'texist...
whichisbewildering,becauseitautomaticallyaddedthatimporttomyJavafile!
Whywoulditdothatifitdoesn'texist?Apparentlythesolutionistoeditthe
Gradlefile,butIdon'tknowwhatthatisanddon'tfeellikefiguringitoutnow.I'm
notsureifthisisrelevanttothetutorialbutIthoughtI'dbringitupjustincase.
LeviJacobC(/member/LeviJacobC) . teiladnam(/member/teiladnam) Reply
7monthsago
DidyoufindamoreuptodatestepbystepguideasI'm
havingthesameissue.
6monthsago
Iamhavingasimilarissuefollowingthestepbystepguide,I
thinkthey'veswitchedthingsaroundwiththenewestupdate.Exactsame
issuesasteiladnam(https://www.instructables.com/member/teiladnam)is
describing.
Firsttimetrying,IthinktheonlythingIhadtroublewithwasthefactthatIhadto
capitalisetheOinonClickListener.Otherthanthat,perfectfirsttutorial.
setOnClickListener
onClickListenershouldbeOnClickListener
ayearago
Thankyou,somuch!!!
RohanSharmag(/member/RohanSharmag) . Fomenkof(/member/Fomenkof)
6monthsago Reply
https://mcent.com/app/?
mcode=Q08W5K&tcx=WAPP
11monthsago
yupyupYup!,,,metoo.Thistookmeacouplehoursto
identifyuntil
Ireadthiscommentthenitfixedmerightandremovedtheredonthis.
ThanksforbuttoningitupDouglasH1
Overallgreatinstructable.Ilearned!
Thanksforthisarticle,
Ihavefollowedallsteps...
oncompilationIgetfollowingerrors...
error:cannotfindsymbolclassonClickListner.
pleasehelp
Thanks
RohanSharmag(/member/RohanSharmag) . sharadkapil(/member/sharadkapil)
6monthsago Reply
https://mcent.com/app/?
mcode=Q08W5K&tcx=WAPP
Hithere,iamtryingtodoasimplepictureappbutikeepgettingtangleup.
Pleasehelp.
RohanSharmag(/member/RohanSharmag) . apple99t(/member/apple99t)
6monthsago Reply
https://mcent.com/app/?
mcode=Q08W5K&tcx=WAPP
I MoreComments
advertisement
Ad
CallCenterSoftware
forthebestCustomerJourneyExperience
XCALLY
FEATURED CHANNELS
FindUs Resources
Facebook(http://www.facebook.com/instructables) ForTeachers(/teachers/)
Youtube(http://www.youtube.com/user/instructablestv) ResidencyProgram(/pier9residency)
Twitter(http://www.twitter.com/instructables) GiftPremiumAccount(/account/give?sourcea=footer)
Forums(/community/)
Pinterest(http://www.pinterest.com/instructables)
Answers(/tag/typequestion/?sort=RECENT)
Google+(https://plus.google.com/+instructables)
Sitemap(/sitemap/)
TermsofService(http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |
PrivacyStatement(http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) |
LegalNotices&Trademarks(http://usa.autodesk.com/legalnoticestrademarks/) | MobileSite(https://www.instructables.com)
(http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)
2016Autodesk,Inc.