Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic Android Tutorial USF’s Association for Computing Machinery.

Similar presentations


Presentation on theme: "Basic Android Tutorial USF’s Association for Computing Machinery."— Presentation transcript:

1 Basic Android Tutorial USF’s Association for Computing Machinery

2 Overview of Tutorial 1.What You Need 2.Create the Project 3.Overview of Files 4.Create the Layout 5.Create the Functionality 6.Debugging 7.Publish App 8.Download to Device

3 What You Need Android Studio and Android SDK Android device and charging cable (Optional) – The emulator can be used, but it is very slow OEM USD Drive (For Windows users only) – Only necessary if you are not using the emulator – Follow these instructions Follow these instructions Resume Information (Optional) – You can just use gibberish until you have a resume This image file: USFLogo.png

4 Create The Project New Project

5 Create The Project Name and Domain App Name: – “[Yourname]Resume” Domain – Normally the developer’s website – If you don’t have a website default to: [netid].myweb.usf.edu

6 Create The Project Select SDK Only use Phone and Tablet for now The Min SDK affects what features and libraries are available to your app.

7 Create The Project Select First Activity

8 Create The Project Name First Activity

9 Overview of Files Layout Files Language: XML Determines the User Interface

10 Overview of Files Backend Files Language: Java Determines the App’s Behavior

11 Overview of Files Image Resource Files Contain the images that will be used in your app Currently contains nothing, we’ll add an image later

12 Overview of Files Strings and Styles Strings.xml – Contains the text associated with each string ID Styles.xml – Contains info for custom themes

13 Overview of Files App Manifest Presents essential information to the Android system – Java package name – Activities and Services – Permissions – Min Level of API – Referenced Libraries

14 Overview of Files Gradle Build File Automates many of the build processes for Android Studio Contains build info – SDK Version – Dependencies – Build type

15 Add the Resources Add an Image 1.Download the Image 2.Copy/Paste into the drawable folder of your app – C:\Users\USERNAME\AndroidStudioProjects\APP NAME\app\src\main\res\drawable 3.Finish

16 Add the Resources Add Strings 1.Open strings.xml 2.Add strings for the following categories – Contact Info – Education Info – Work Experience – Extracurricular Activities Download Example Here

17 Add the Resources Add Styles 1.Open styles.xml 2.Add styles for the following categories – Your Name – Section Title – Item Header – Content – Content Holder Download Example Here

18 Create the UI Layout Format 1.In Text Editor change “RelativeLayout” to “LinearLayout” 2.Specify orientation – android:orientation="vertical“ 3.Remove existing Textview Types of Layout – Relative: specify the location of child objects relative to each other – Linear: organizes its children into a single horizontal or vertical row

19 Create the UI Add Name and Headers 1.Create TextView for your name, with the style “name” 2.Add TextViews for the following categories, with the style “sectionTitle” – Contact Info – Education Info – Work Experience – Extracurricular Activities 1 2

20 Create the UI Layout So Far

21 Create the UI Nested Layout and Content 1.Create a vertical Linear Layout underneath “contactTitle” – Use the style “contentHolder” 2.Add TextViews for each of the following, with the style “content” – Address – Email – Phone Number 3.Do this for all the content headers

22 Create the UI Layout So Far

23 Create the UI Add an Image 1.Add an ImageView above name 2.Set the source to the drawable image resource we added earlier

24 Create the UI Nested Layout and Content 1.Create a vertical Linear Layout underneath “contactTitle” – Use the style “contentHolder” 2.Add TextViews for each of the following, with the style “content” – Address – Email – Phone Number 3.Do this for all the content headers

25 Create the UI Add A Button 1.Add a button at the end of the layout. 2.Set the top margin to 50px 3.Set the id to “linkedin” – Or anything really Download Layout Example Here

26 Test it Out Setup your System to Debug (if using the emulator, skip this) 1.Verify that your application is "debuggable" in your manifest or build.gradle file. – Remember to undo this before publishing 2.Enable debugging on your device i.(If Android 3.2 or lower): Settings > Applications > Development ii.Settings > About phone iii.Tap Build number seven times. iv.Return to the previous screen to find Developer options AndroidManifext.xml build.gradle (Module: app)

27 Test it Out Set up your system to detect your device (if using the emulator, skip this) Windows: Follow the instructions herehere Mac OS X: It just works. Skip this step. Ubuntu Linux: You’re over complicating this.

28 Test it Out Connect Device and Debug 1.Connect device with USB cable – If using emulator: load it up 2.Run or Debug 3.Select your device or emulator and click OK RunDebug

29 Create the UI Oh no! It doesn’t scroll! Layouts do not scroll on their own. They need a control that contains a scrolling action. 1.Replace the LinearLayout root element with a ScrollView – Be sure to delete the orientation tag 2.Add a LinearLayout within the ScrollView 3.Change/Add the end tags......

30 Create the Functionality Button Click Event 1.Open Resume.java 2.Reference Button from the layout 3.Set click listener and handler 4.There will be several errors. To fix, include the following references: – android.widget.Button – android.content.Intent – android.net.Uri Download Example Here 4 2 3

31 Debugging 1.Set a debug point – Click on the vertical bar to the left of the code – Or, hit Ctrl+F8 with the line selected 2.Click Debug – Step Over/Next Line: F8 – Step Into: F7 – Step Out/Return: Shift+F8

32 Publish App 1.Turn off debugging – ApplicationManifest.xml – build.gradle 2.Sign your Application i.Build > Generate Signed APK ii.Create New… iii.Fill in all fields iv.Ok v.Next vi.Finish

33 Publish App Email APK file to your device 1.C:\Users\USERNAME\AndroidStudioProjects\APPNAME\app 2.There will be a file ending in.apk 3.Email APK file to yourself 4.Open email on your android device and download APK file 5.It will ask you to install 6.Now you can send your resume app to everyone you know!

34 THE END


Download ppt "Basic Android Tutorial USF’s Association for Computing Machinery."

Similar presentations


Ads by Google