Details

Java Programming for Android Developers For Dummies


Java Programming for Android Developers For Dummies


2. Aufl.

von: Barry Burd

22,99 €

Verlag: Wiley
Format: PDF
Veröffentl.: 19.10.2016
ISBN/EAN: 9781119301127
Sprache: englisch
Anzahl Seiten: 464

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<b>Develop the next killer Android App using Java programming!</b> <p>Android is everywhere! It runs more than half the smartphones in the U.S.—and Java makes it go. If you want to cash in on its popularity by learning to build Android apps with Java, all the easy-to-follow guidance you need to get started is at your fingertips. Inside, you'll learn the basics of Java and grasp how it works with Android; then, you'll go on to create your first real, working application. How cool is that? <p>The demand for Android apps isn't showing any signs of slowing, but if you're a mobile developer who wants to get in on the action, it's vital that you get the necessary Java background to be a success. With the help of <i>Java Programming for Android Developers For Dummies</i>, you'll quickly and painlessly discover the ins and outs of using Java to create groundbreaking Android apps—no prior knowledge or experience required! <ul> <li>Get the know-how to create an Android program from the ground up</li> <li>Make sense of basic Java development concepts and techniques</li> <li>Develop the skills to handle programming challenges</li> <li>Find out how to debug your app</li> </ul> <p>Don't sit back and watch other developers release apps that bring in the bucks! Everything you need to create that next killer Android app is just a page away!
<p><b>Introduction 1</b></p> <p>How to Use This Book 1</p> <p>Conventions Used in This Book 2</p> <p>What You Don’t Have to Read 2</p> <p>Foolish Assumptions 3</p> <p>How This Book Is Organized 4</p> <p>Part 1: Getting Started with Java Programming for Android Developers 4</p> <p>Part 2: Writing Your Own Java Programs 5</p> <p>Part 3: Working with the Big Picture: Object-Oriented Programming 5</p> <p>Part 4: Powering Android with Java Code 5</p> <p>Part 5: The Part of Tens 5</p> <p>More on the web! 6</p> <p>Icons Used in This Book 6</p> <p>Beyond the Book 7</p> <p>Where to Go from Here 7</p> <p><b>Part 1: Getting Started with Java Programming For Android Developers 9</b></p> <p><b>Chapter 1: All about Java and Android 11</b></p> <p>The Consumer Perspective 12</p> <p>The Many Faces of Android 13</p> <p>The Developer Perspective 15</p> <p>Java 15</p> <p>Xml 18</p> <p>Linux 19</p> <p>From Development to Execution with Java 20</p> <p>What is a compiler? 20</p> <p>What is a virtual machine? 24</p> <p>Java, Android, and Horticulture 26</p> <p><b>Chapter 2: Getting the Tools That You Need 27</b></p> <p>The Stuff You Need 28</p> <p>If You Don’t Like to Read the Instructions . 29</p> <p>Getting This Book’s Sample Programs 32</p> <p>Setting Up Java 33</p> <p>Setting Up Android Studio and the Android SDK 37</p> <p>Launching the Android Studio IDE 38</p> <p>Opening One of This Book’s Sample Programs 40</p> <p>Using Android Studio 42</p> <p>Starting up 42</p> <p>The main window 43</p> <p>Things You Might Eventually Have to Do 48</p> <p>Installing new versions (and older versions) of Android 49</p> <p>Creating an Android virtual device 50</p> <p><b>Chapter 3: Creating and Running an Android App 55</b></p> <p>Creating Your First App 56</p> <p>First things first 57</p> <p>Launching your first app 61</p> <p>If the Emulator Doesn’t Behave 63</p> <p>Running third-party emulators 64</p> <p>Testing apps on a physical device 65</p> <p>The Project Tool Window 68</p> <p>The app/manifests branch 68</p> <p>The app/java branch 69</p> <p>The app/res branches 69</p> <p>The Gradle scripts branch 70</p> <p>Dragging, Dropping, and Otherwise Tweaking an App 70</p> <p>Creating the “look” 71</p> <p>Coding the behavior 83</p> <p>What All That Java Code Does 88</p> <p>Finding the EditText and TextView components 88</p> <p>Responding to a button click 90</p> <p>The rest of the code 91</p> <p>Going Pro 93</p> <p><b>Part 2: Writing Your Own Java Programs 95</b></p> <p><b>Chapter 4: An Ode to Code 97</b></p> <p>Hello, Android! 97</p> <p>The Java Class 99</p> <p>The names of classes 103</p> <p>Why Java Methods Are Like Meals at a Restaurant 105</p> <p>What does Mom’s Restaurant have to do with Java? 106</p> <p>Method declaration 106</p> <p>Method call 108</p> <p>Method parameters 108</p> <p>The chicken or the egg 109</p> <p>How many parameters? 109</p> <p>Method declarations and method calls in an Android program 111</p> <p>Punctuating Your Code 116</p> <p>Comments are your friends 119</p> <p>What’s Barry’s excuse? 122</p> <p>All About Android Activities 123</p> <p>Extending a class 124</p> <p>Overriding methods 124</p> <p>An activity’s workhorse methods 125</p> <p><b>Chapter 5: Java’s Building Blocks 129</b></p> <p>Info Is As Info Does 130</p> <p>Variable names 133</p> <p>Type names 133</p> <p>Assignments and initializations 134</p> <p>Expressions and literals 136</p> <p>How to string characters together 139</p> <p>Java’s primitive types 140</p> <p>Things You Can Do with Types 142</p> <p>Add letters to numbers (Huh?) 144</p> <p>Java’s exotic assignment operators 146</p> <p>True bit 147</p> <p>Java isn’t like a game of horseshoes 148</p> <p>Use Java’s logical operators 150</p> <p>Parenthetically speaking 155</p> <p><b>Chapter 6: Working with Java Types 157</b></p> <p>Working with Strings 157</p> <p>Going from primitive types to strings 158</p> <p>Going from strings to primitive types 159</p> <p>Getting input from the user 160</p> <p>Practice Safe Typing 163</p> <p>Widening is good; narrowing is bad 165</p> <p>Incompatible types 166</p> <p>Using a hammer to bang a peg into a hole 167</p> <p><b>Chapter 7: Though These Be Methods, Yet There Is Madness in’t 169</b></p> <p>Minding Your Types When You Call a Method 170</p> <p>Method parameters and Java types 173</p> <p>If at first you don’t succeed 174</p> <p>Return types 174</p> <p>The great void 175</p> <p>Displaying numbers 176</p> <p>Primitive Types and Pass-by Value 177</p> <p>What’s a developer to do? 181</p> <p>A final word 183</p> <p><b>Chapter 8: What Java Does (and When) 187</b></p> <p>Making Decisions 187</p> <p>Java if statements 189</p> <p>Choosing among many alternatives 191</p> <p>Some formalities concerning Java switch statements 198</p> <p>Repeating Instructions Over and Over Again 199</p> <p>Check, and then repeat 200</p> <p>Repeat, and then check 207</p> <p>Count, count, count 211</p> <p>What’s Next? 214</p> <p><b>Part 3: Working with the Big Picture: Object-oriented Programming 215</b></p> <p><b>Chapter 9: Why Object-Oriented Programming Is Like Selling Cheese 217</b></p> <p>Classes and Objects 219</p> <p>What is a class, really? 220</p> <p>What is an object? 222</p> <p>Creating objects 223</p> <p>Reusing names 227</p> <p>Calling a constructor 230</p> <p>More About Classes and Objects (Adding Methods to the Mix) 232</p> <p>Constructors with parameters 235</p> <p>The default constructor 239</p> <p>This is it! 240</p> <p>Giving an object more responsibility 242</p> <p>Members of a class 245</p> <p>Reference types 246</p> <p>Pass by reference 247</p> <p>Java’s Modifiers 251</p> <p>Public classes and default-access classes 251</p> <p>Access for fields and methods 253</p> <p>Using getters and setters 257</p> <p>What does static mean? 260</p> <p>To dot, or not 263</p> <p>A bad example 264</p> <p>What’s Next? 265</p> <p><b>Chapter 10: Saving Time and Money: Reusing Existing Code 267</b></p> <p>The Last Word on Employees — Or Is It? 268</p> <p>Extending a class 269</p> <p>Overriding methods 272</p> <p>Java’s super keyword 278</p> <p>Java annotations 279</p> <p>More about Java’s Modifiers 281</p> <p>Keeping Things Simple 285</p> <p>Using an interface 286</p> <p>Some Observations about Android’s Classes 291</p> <p>Java’s super keyword, revisited 292</p> <p>Casting, again 293</p> <p><b>Part 4: Powering Android with Java Code 295</b></p> <p><b>Chapter 11: The Inside Story 297</b></p> <p>A Button-Click Example 297</p> <p>This is a callback 302</p> <p>Android string resources (A slight detour) 302</p> <p>Introducing Inner Classes 307</p> <p>No Publicity, Please! 309</p> <p>Lambda Expressions 313</p> <p><b>Chapter 12: Dealing with a Bunch of Things at a Time 317</b></p> <p>Creating a Collection Class 318</p> <p>More casting 320</p> <p>Java generics 321</p> <p>Java’s wrapper classes 325</p> <p>Stepping Through a Collection 326</p> <p>Using an iterator 326</p> <p>The enhanced for statement 328</p> <p>A cautionary tale 329</p> <p>Functional programming techniques 331</p> <p>Java’s Many Collection Classes 332</p> <p>Arrays 333</p> <p>String resource arrays 336</p> <p>Java’s varargs 337</p> <p>Using Collections in an Android App 340</p> <p>The listener 343</p> <p>The adapter 343</p> <p><b>Chapter 13: An Android Social Media App 345</b></p> <p>The Twitter App’s Files 346</p> <p>The Twitter4J API jar file 346</p> <p>The manifest file 348</p> <p>The main activity’s layout file 349</p> <p>How to Talk to the Twitter Server 352</p> <p>Using OAuth 353</p> <p>Making a ConfigurationBuilder 353</p> <p>Getting OAuth keys and tokens 355</p> <p>The Application’s Main Activity 357</p> <p>The onCreate method 362</p> <p>The button listener methods 363</p> <p>The trouble with threads 363</p> <p>Understanding Android’s AsyncTask 366</p> <p>My Twitter app’s AsyncTask classes 368</p> <p>Cutting to the chase, at last 370</p> <p>Java’s Exceptions 372</p> <p>Catch clauses 374</p> <p>A finally clause 375</p> <p>Passing the buck 376</p> <p><b>Chapter 14: Hungry Burds: A Simple Android Game 381</b></p> <p>Introducing the Hungry Burds Game 382</p> <p>The Main Activity 385</p> <p>The code, all the code, and nothing but the code 388</p> <p>Measuring the display 392</p> <p>Constructing a Burd 395</p> <p>Android animation 398</p> <p>Creating menus 400</p> <p>Shared preferences 403</p> <p>Informing the user 404</p> <p>It’s Been Fun 405</p> <p><b>Part 5: the Part of Tens 407</b></p> <p><b>Chapter 15: Ten Ways to Avoid Mistakes 409</b></p> <p>Putting Capital Letters Where They Belong 409</p> <p>Breaking Out of a switch Statement 410</p> <p>Comparing Values with a Double Equal Sign 410</p> <p>Adding Listeners to Handle Events 411</p> <p>Defining the Required Constructors 411</p> <p>Fixing Nonstatic References 412</p> <p>Staying within Bounds in an Array 412</p> <p>Anticipating Null Pointers 412</p> <p>Using Permissions 414</p> <p>The Activity Not Found 414</p> <p><b>Chapter 16: Ten Websites for Developers 415</b></p> <p>This Book’s Websites 415</p> <p>The Horse’s Mouth 416</p> <p>Finding News and Reviews 416</p> <p>Index 417</p>
<p><b>Barry Burd, PhD,</b> is a professor in the Department of Mathematics and Computer Science at Drew University in Madison, New Jersey. He has lectured at conferences in the United States, Europe, Australia, and Asia. He hosts podcasts and videos about software and other technology topics. He is the author of many articles and books, including <i>Java For Dummies</i>.
<ul> <li>Master basic Java programming</li> <li>Create an Android program from start to finish</li> <li>Assemble and debug your own app</li> </ul> <p><b>The knowledge you need to build Android apps!</b> <p>Do you have a great idea that you want to turn into an even better app? Java is the building block you need to develop remarkable Android programs. Even if you have zero Java experience, these step-by-step instructions get you going without any head-scratching or hand-wringing. First, you'll explore how Java and Android work together. Then you'll learn Java basics, how to work with Android Studio, and the essentials of object-oriented programming—all while creating and testing real working apps. <p><b>Inside…</b> <ul> <li>Getting and installing Android Studio and why you need it</li> <li>Steps for setting up your app</li> <li>Using an Android virtual device</li> <li>Java building blocks</li> <li>How and why to reuse code</li> <li>Testing and debugging tips</li> <li>How to build an Android game</li> </ul>

Diese Produkte könnten Sie auch interessieren:

Software Process Modeling
Software Process Modeling
von: Silvia T. Acuna, Natalia Juristo
PDF ebook
96,29 €
A Software Process Model Handbook for Incorporating People's Capabilities
A Software Process Model Handbook for Incorporating People's Capabilities
von: Silvia T. Acuna, Natalia Juristo, Ana Maria Moreno, Alicia Mon
PDF ebook
149,79 €
XML for Bioinformatics
XML for Bioinformatics
von: Ethan Cerami
PDF ebook
53,49 €