Log In
Or create an account -> 
Imperial Library
  • Home
  • About
  • News
  • Upload
  • Forum
  • Help
  • Login/SignUp

Index
1. getting started: Diving In
Welcome to Androidville
Layouts define what each screen looks like Activities define what the app does Extra resources may be needed too
Activities and layouts form the backbone of your app Here’s what we’re going to do Android Studio: your development environment
You need to install Android Studio
Install Android Studio Build a basic app How to build the app
1. Create a new project 2. Choose your project 3. Configure your project
You’ve created your first Android project Dissecting your new project
The folder structure includes different types of files
Introducing the key files in your project Edit code with the Android Studio editors
The code editor The design editor
The story so far... How to run the app on a physical device
1. Enable USB debugging on your device 2. Set up your computer to detect the device 3. Use a USB cable to plug your device into your computer 4. Run your app
How to run the app on a virtual device Create an Android Virtual Device (AVD)
Open the Android Virtual Device Manager Select the hardware Select a system image Verify the AVD configuration The virtual device gets created Run the app on the AVD
Compile, package, deploy, run Test drive What just happened? Refine the app
The app has one activity and one layout The activity controls what the app does The layout controls the app’s appearance
What’s in the layout?
The design editor The code editor
activity_main.xml has two elements Update the text displayed in the layout What the code does Test drive Your Android Toolbox
2. building interactive apps: Apps That Do Something
Let’s build a Beer Adviser app Here’s what we’re going to do Create the project We’ve created a default activity and layout A closer look at the design editor Add a button using the design editor
Changes in the design editor are reflected in the XML
activity_main.xml has a new button
Buttons and text views are subclasses of the same Android View class android:id android:layout_width, android:layout_height android:text
A closer look at the layout code The <LinearLayout> element
The Button element The TextView element
Let’s update the layout XML The XML changes are reflected in the design editor Test drive There are warnings in the layout...
...because there’s hardcoded text
Put text in a String resource file
Android Studio helps you extract String resources
Extract the String resource
A String resource has been added to strings.xml
activity_main.xml uses the String resource
You also can extract String resources manually
Add and use a new String resource Test drive Add values to the spinner
Adding an array resource is similar to adding a String
Add the string-array to strings.xml
Get the spinner to display the array’s values
The full code for activity_main.xml Test drive We need to make the app interactive What our MainActivity code looks like A button can listen for on-click events...
...using an OnClickListener
Get a reference to the button...
...and call its setOnClickListener method
Pass a lambda to the setOnClickListener method How to edit a text view’s text
How to get the spinner’s selected value
The updated code for MainActivity.kt What happens when you run the code Test drive Add the findBeers function The full code for MainActivity.kt What happens when you run the code Test drive Your Android Toolbox
  • ← Prev
  • Back
  • Next →
  • ← Prev
  • Back
  • Next →

Chief Librarian: Las Zenow <zenow@riseup.net>
Fork the source code from gitlab
.

This is a mirror of the Tor onion service:
http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion