Training Session 2
-
Upload
vivek-bhusal -
Category
Technology
-
view
939 -
download
4
description
Transcript of Training Session 2
![Page 1: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/1.jpg)
HELLO FELLOW ENTHUSIASTS
![Page 2: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/2.jpg)
Vivek Bhusal Mobile Application Developer, YoungInnovations
2 years in mobile application development
http://vivekbhusal.com
Toastmasters Timer
StoresMunk iPaidaBribe Marriage Center
Collection
@vivekbhusal
![Page 3: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/3.jpg)
Rakeeb Rajbhandari Jr. Mobile Application Developer, YoungInnovations
6 months in mobile application development
Taxi Fare Self Help
![Page 4: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/4.jpg)
Anjan Shrestha UX Lead, YoungInnovations
http://anjhero.me
5+ years in UI design and development
![Page 5: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/5.jpg)
Prawesh Shrestha Project Manager, YoungInnovations
3+ years Manager for Mobile Nepal
![Page 6: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/6.jpg)
Mobile Nepal Community Common Platform to share, learn and grow
Events Hello Sarkar M2Work Hackathon Pivot Nepal NASA Space Apps
http://mobilenepal.net
![Page 7: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/7.jpg)
This is an extensive course that covers the Android Basics and more.
![Page 8: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/8.jpg)
This is an extensive course that covers the Android Basics and more. Aimed to get you STARTED on the right foot.
![Page 9: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/9.jpg)
This is an extensive course that covers the Android Basics and more. Aimed to get you STARTED on the right foot. Know your Android better.
![Page 10: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/10.jpg)
This is an extensive course that covers the Android Basics and more. Aimed to get you STARTED on the right foot. Know your Android better. Develop an Android Application?
![Page 11: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/11.jpg)
INSTALLATION
![Page 12: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/12.jpg)
The official development environment Google recommends for Android
Java SDK Android SDK Android Eclipse IDE
![Page 13: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/13.jpg)
The official development environment Google recommends for Android
Java SDK Android SDK Android Eclipse IDE
Installed Together is the
ADT Bundle
![Page 14: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/14.jpg)
Installed Together is the
ADT Bundle
PREREQUISITES Java SDK and the Java Runtime Environment
http://bit.ly/bMkbpo
![Page 15: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/15.jpg)
Download ADT Bundle from http://developer.android.com/sdk/index.html
Unzip and Extract
Navigate to the “eclipse” folder to launch eclipse
![Page 16: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/16.jpg)
Development demands packages which can be downloaded from SDK Manager
![Page 17: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/17.jpg)
Select these boxes.
Also, select - Doc, Samples,
Intel - Optional
- Android Support Library
- Google USB Driver
Select Install Packages
![Page 18: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/18.jpg)
TESTING ON
EMULATORS
![Page 19: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/19.jpg)
We can test apps that we are building on Android Emulator Testing can also be done plugging an Android device For a smoother experience, installation of the Intel x86 HAXM is recommended. http://bit.ly/1aFloCd
http://developer.android.com/tools/devices/emulator.html
![Page 20: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/20.jpg)
Setting up Emulator
![Page 21: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/21.jpg)
AVD Manager
![Page 22: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/22.jpg)
In Eclipse, select window -> Android Virtual Device Manager Select New … on the right menu. Enter values as shown.
![Page 23: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/23.jpg)
Running the Emulator
![Page 24: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/24.jpg)
AVD Manager
![Page 25: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/25.jpg)
TIME TO
PROGRAM
![Page 26: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/26.jpg)
SETTING UP THE PROJECT
![Page 27: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/27.jpg)
SETTING UP THE PROJECT
![Page 28: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/28.jpg)
SETTING UP THE PROJECT
Checklist
Minimum SDK support must be setup Features like the ActionBar is not available in
earlier API versions. Target APK
The API being targetted Always compile with the latest API
Keep clicking on Next untill we end the setup process
![Page 29: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/29.jpg)
Getting started
Create the UI for our application.
1
2 Make the UI functional
xml
java
![Page 30: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/30.jpg)
xml java
UI Instatiation
UI Functions
![Page 31: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/31.jpg)
Guidelines
![Page 32: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/32.jpg)
While working with Views/UI elements always give them an id
<Button android:id = “@+id/button” android:layout_width = “fill_parent” android:layout_height = “wrap_content” android:text = “Press Me”/>
width and height are compulsory to declare. id's are to be declared if they are to be manipulated.
![Page 33: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/33.jpg)
Refer to your layout in your src with this
setContentView() : … setContentView(R.layout.file_name);
![Page 34: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/34.jpg)
Refer to the Button declared earlier
Button button: … (inside onCreate()) button = (Button) findViewById(R.id.button);
![Page 35: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/35.jpg)
Manipulating the Button
button.setOnClickListener( … );
![Page 36: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/36.jpg)
Displaying the Short Popup
Toast.makeText(getApplicationContext(), “This is a short popup message”, Toast.LENGTH_SHORT).show();
![Page 37: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/37.jpg)
R class found under gen
Auto-generated: DO NOT EDIT
Contains ID of the project resources
Use findViewById and Resources object to get access to the resources:
E.g. Button = (Button)findViewById(R.id.button); E.g. getResources().getString(R.string.hello);
![Page 38: Training Session 2](https://reader033.fdocuments.in/reader033/viewer/2022052505/555ac749d8b42a761a8b4eb0/html5/thumbnails/38.jpg)
THAT’S ALL FOLKS! WE’LL SEE YOU TOMORROW