SlideShare uma empresa Scribd logo
1 de 24
Android GUI ProjectAndroid GUI Project
AndroidAndroid
• 1. Android Basics
• 2. Android Development
• 3. Android UI
• 4. Hello, World
• 5. My Project
Android BasicsAndroid Basics
• Open source OS
• Uses Linux kernel
• Optimized for limited-resource environment
• Apps typically written in Java
• Apps run on the Dalvik Virtual Machine
• Not a JVM, but works similarly from developer’s
point of view
• Usually one app per DVM
• Each DVM runs under Linux as a separate user
• App permissions set at install time
• Possible to use C or C++ compiled to machine code,
but still runs on VM. It’s not clear to me how this works.
• Docs say it does not necessarily improve
performance.
Copyright ©2010 Lauren Darcey and Shane Conder
Android DevelopmentAndroid Development
• Well-defined framework for app
development
• Apps are typically coded using Java
syntax, but other parts of the Java platform
are missing
• Some standard Java SE or ME APIs and
class libraries are not included
• I will give examples when I find out!
Android DevelopmentAndroid Development
• Standard development environment is Eclipse +
Android Development Tools plugin + Android SDK
• Development requires either an Android OS device
or an emulator
• Emulator has limitations:
• Performance is poor
• Camera, etc., simulated using your computer’s
hardware
• No real phone calls or texts
• GPS data, battery readings, etc. must be simulated
• Real device is affected by specific hardware and
software configuration
Android vs. Other Mobile OSAndroid vs. Other Mobile OS
I was able to choose what kind of smart phone to get according
to which platform I wanted to use to try mobile development
Android:
•I had Java backend code ready to go for a first project
•Interesting platform:
• Familiar programming environment
• Currently the market leader
• Broad market, unlike more focused iOS, Blackberry, and
(Palm) webOS
• Development tools are open source and are free even for
commercial use, unlike Visual Studio
Android App vs. Mobile- Optimized RIAAndroid App vs. Mobile- Optimized RIA
• Android Flash plugins available; Silverlight coming soon
• Could develop in JavaScript and/or HTML5
• WWW App
• Easier for users to run; no need to install
• For a paid app, avoid the 30% App Store commission
• Easier to write cross-platform apps
• Android Apps
• Fewer security hurdles
• Use APIs for access to built in GPS, camera, etc.
• Probably better performance; one layer less
Android Apps: MarketingAndroid Apps: Marketing
• Usually market apps through Android App Market
• There are other markets, also
• App store will dominate the market due to
access through built in app
• Can set up for download directly on a website
• User must agree to “install apps from unknown
sources”
Android Apps: MarketingAndroid Apps: Marketing
• Revenue from app sales prices and/or advertising
• Conventional wisdom is that iOS users will pay for
apps, but Android users won’t
• 57% of Android App Store apps are free, vs. 28% for
Apple App Store
• Android Market takes 30% commission
• Any purchase model other than one-time purchase
must be homegrown, using Paypal or similar service
• PPC ads
• My guess is that response to these is extremely low
• Probably need to be very aggressive with banner
ads
• Sell to companies?
Android DeploymentAndroid Deployment
• Apps are packaged in .apk format, variant
of .jar, then downloaded to device and
installed
• .apks contain .dex files (bytecode),
manifest and various other files
• Manifest contains security and link info,
hardware access info, minimum OS
release info, etc.
Android UIAndroid UI
• Activity: single screen with a UI, somewhat analogous to
XAML / code behind pattern in .NET
• Email app might have one activity that shows a list of
new emails, another activity to compose an email, and
another activity for reading emails
• Implement by subclassing Activity class
• View: drawable object
• Android UI View ≠ MVC View
• UI contains a hierarchy of Views
• View is a class, subclassed by the drawable objects in
the UI
Android UIAndroid UI
• Service: background operation
• play music in the background while the
user is in a different application
• fetch data over the network without
blocking user interaction with an activity
• Content Provider: DB or other data access
• Broadcast Receiver: responds to system
messages
• Battery low
Android UIAndroid UI
• UI construction can be done in three ways:
• Programmatic, like hand-coded Java
desktop GUI construction
• Declarative hand-written, like Java web
UI construction
• XML
• Declarative with a GUI builder, like .NET
UI construction
• GUI builder generates the XML
Programmatic UIProgrammatic UI
import android.app.Activity;
import android.widget.TextView;
import android.os.Bundle;
public class AndroidDemo extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Activity is a subclass of context, so the TextView takes this as a parameter
TextView tv = new TextView(this);
tv.setText("Hello, vibrant");
setContentView(tv);
}}
Manual Declarative UIManual Declarative UI
main.xml Layout File:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/textview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/hello"/>
strings.xml resource file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello Again, vibrant!</string>
<string name="app_name">vibrantAndroidDemo</string>
</resources>
Manual Declarative UIManual Declarative UI
Java class:
package vibrant.demo;
import android.app.Activity;
import android.os.Bundle;
public class AndroidDemo extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}}
What’s R?What’s R?
/* AUTO-GENERATED FILE. DO NOT MODIFY. This class was automatically generated by the
* aapt tool from the resource data it found. It should not be modified by hand. */
package vibrant.demo;
public final class R {
public static final class attr { }
public static final class drawable { public static final int icon=0x7f020000; }
public static final class id {
public static final int textview=0x7f050000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}}
UI With GUI BuilderUI With GUI Builder
Android Event HandlersAndroid Event Handlers
From the code file for the activity:
Button ok = (Button) findViewById(R.id.button1);
ok.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
CharSequence s = et.getText();
tv.setText("Welcome, " + s);
}
});
Copyright ©2010 Lauren Darcey and Shane Conder
APIs for Android built-insAPIs for Android built-ins
• Android OS ships with many built in apps
• Web Browser
• Google Maps
• Navigation
• Camera apps
• Built in access for these as well as TTS and
Voice Recognition, etc.
ThankThank You !!!You !!!
For More Information click below link:
Follow Us on:
http://vibranttechnologies.co.in/android-classes-in-mumbai.html

Mais conteúdo relacionado

Mais procurados

Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
Chris Morrell
 

Mais procurados (20)

Building a mobile application for dot netnuke
Building a mobile application for dot netnukeBuilding a mobile application for dot netnuke
Building a mobile application for dot netnuke
 
Selenium web driver_2.0_presentation
Selenium web driver_2.0_presentationSelenium web driver_2.0_presentation
Selenium web driver_2.0_presentation
 
Apache cordova
Apache cordovaApache cordova
Apache cordova
 
Cross platform mobile application development
Cross platform mobile application developmentCross platform mobile application development
Cross platform mobile application development
 
Building iOS App Project & Architecture
Building iOS App Project & ArchitectureBuilding iOS App Project & Architecture
Building iOS App Project & Architecture
 
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
 
[2015/2016] Apache Cordova
[2015/2016] Apache Cordova[2015/2016] Apache Cordova
[2015/2016] Apache Cordova
 
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
 
Cordova 3, apps para android
Cordova 3, apps para androidCordova 3, apps para android
Cordova 3, apps para android
 
IONIC - Hybrid Mobile App Development
IONIC - Hybrid Mobile App DevelopmentIONIC - Hybrid Mobile App Development
IONIC - Hybrid Mobile App Development
 
Introduction to the Ionic Framework
Introduction to the Ionic FrameworkIntroduction to the Ionic Framework
Introduction to the Ionic Framework
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
 
Building Mobile Apps with Cordova , AngularJS and Ionic
Building Mobile Apps with Cordova , AngularJS and IonicBuilding Mobile Apps with Cordova , AngularJS and Ionic
Building Mobile Apps with Cordova , AngularJS and Ionic
 
Building Salesforce1 Communities Apps with React Native and Flux
Building Salesforce1 Communities Apps with React Native and FluxBuilding Salesforce1 Communities Apps with React Native and Flux
Building Salesforce1 Communities Apps with React Native and Flux
 
Hybrid app in ionic framework overview
Hybrid app in ionic framework overviewHybrid app in ionic framework overview
Hybrid app in ionic framework overview
 
Building Universal Windows Apps for Smartphones and Tablets with XAML & C#
Building Universal Windows Apps for Smartphones and Tablets with XAML & C#Building Universal Windows Apps for Smartphones and Tablets with XAML & C#
Building Universal Windows Apps for Smartphones and Tablets with XAML & C#
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
 
Phonegap/Cordova vs Native Application
Phonegap/Cordova vs Native ApplicationPhonegap/Cordova vs Native Application
Phonegap/Cordova vs Native Application
 
Build uwp apps with windows app studio
Build uwp apps with windows app studioBuild uwp apps with windows app studio
Build uwp apps with windows app studio
 
Smartface ile Crossplatform Uygulama Geliştirme
Smartface ile Crossplatform Uygulama GeliştirmeSmartface ile Crossplatform Uygulama Geliştirme
Smartface ile Crossplatform Uygulama Geliştirme
 

Semelhante a Android - Anroid Pproject

Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob
 
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9
Gustavo Fuentes Zurita
 
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9
Gustavo Fuentes Zurita
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
aswapnal
 

Semelhante a Android - Anroid Pproject (20)

Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
 
Pertemuan 3 pm
Pertemuan 3   pmPertemuan 3   pm
Pertemuan 3 pm
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app development
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programming
 
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9
 
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9
 
Developing for Android-Types of Android Application
Developing for Android-Types of Android ApplicationDeveloping for Android-Types of Android Application
Developing for Android-Types of Android Application
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Android
AndroidAndroid
Android
 
Introduction_to_android_and_android_studio
Introduction_to_android_and_android_studioIntroduction_to_android_and_android_studio
Introduction_to_android_and_android_studio
 
Android ppt
Android ppt Android ppt
Android ppt
 
Android Applications
Android ApplicationsAndroid Applications
Android Applications
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdf
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi android
 
Android app development
Android app developmentAndroid app development
Android app development
 

Mais de Vibrant Technologies & Computers

Mais de Vibrant Technologies & Computers (20)

Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5
 
SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables  SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables
 
SQL- Introduction to MySQL
SQL- Introduction to MySQLSQL- Introduction to MySQL
SQL- Introduction to MySQL
 
SQL- Introduction to SQL database
SQL- Introduction to SQL database SQL- Introduction to SQL database
SQL- Introduction to SQL database
 
ITIL - introduction to ITIL
ITIL - introduction to ITILITIL - introduction to ITIL
ITIL - introduction to ITIL
 
Salesforce - Introduction to Security & Access
Salesforce -  Introduction to Security & Access Salesforce -  Introduction to Security & Access
Salesforce - Introduction to Security & Access
 
Data ware housing- Introduction to olap .
Data ware housing- Introduction to  olap .Data ware housing- Introduction to  olap .
Data ware housing- Introduction to olap .
 
Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.
 
Data ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housingData ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housing
 
Salesforce - classification of cloud computing
Salesforce - classification of cloud computingSalesforce - classification of cloud computing
Salesforce - classification of cloud computing
 
Salesforce - cloud computing fundamental
Salesforce - cloud computing fundamentalSalesforce - cloud computing fundamental
Salesforce - cloud computing fundamental
 
SQL- Introduction to PL/SQL
SQL- Introduction to  PL/SQLSQL- Introduction to  PL/SQL
SQL- Introduction to PL/SQL
 
SQL- Introduction to advanced sql concepts
SQL- Introduction to  advanced sql conceptsSQL- Introduction to  advanced sql concepts
SQL- Introduction to advanced sql concepts
 
SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data   SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data
 
SQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set OperationsSQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set Operations
 
Sas - Introduction to designing the data mart
Sas - Introduction to designing the data martSas - Introduction to designing the data mart
Sas - Introduction to designing the data mart
 
Sas - Introduction to working under change management
Sas - Introduction to working under change managementSas - Introduction to working under change management
Sas - Introduction to working under change management
 
SAS - overview of SAS
SAS - overview of SASSAS - overview of SAS
SAS - overview of SAS
 
Teradata - Architecture of Teradata
Teradata - Architecture of TeradataTeradata - Architecture of Teradata
Teradata - Architecture of Teradata
 
Teradata - Restoring Data
Teradata - Restoring Data Teradata - Restoring Data
Teradata - Restoring Data
 

Último

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Android - Anroid Pproject

  • 1.
  • 3. AndroidAndroid • 1. Android Basics • 2. Android Development • 3. Android UI • 4. Hello, World • 5. My Project
  • 4. Android BasicsAndroid Basics • Open source OS • Uses Linux kernel • Optimized for limited-resource environment • Apps typically written in Java • Apps run on the Dalvik Virtual Machine • Not a JVM, but works similarly from developer’s point of view • Usually one app per DVM • Each DVM runs under Linux as a separate user • App permissions set at install time • Possible to use C or C++ compiled to machine code, but still runs on VM. It’s not clear to me how this works. • Docs say it does not necessarily improve performance.
  • 5. Copyright ©2010 Lauren Darcey and Shane Conder
  • 6. Android DevelopmentAndroid Development • Well-defined framework for app development • Apps are typically coded using Java syntax, but other parts of the Java platform are missing • Some standard Java SE or ME APIs and class libraries are not included • I will give examples when I find out!
  • 7. Android DevelopmentAndroid Development • Standard development environment is Eclipse + Android Development Tools plugin + Android SDK • Development requires either an Android OS device or an emulator • Emulator has limitations: • Performance is poor • Camera, etc., simulated using your computer’s hardware • No real phone calls or texts • GPS data, battery readings, etc. must be simulated • Real device is affected by specific hardware and software configuration
  • 8. Android vs. Other Mobile OSAndroid vs. Other Mobile OS I was able to choose what kind of smart phone to get according to which platform I wanted to use to try mobile development Android: •I had Java backend code ready to go for a first project •Interesting platform: • Familiar programming environment • Currently the market leader • Broad market, unlike more focused iOS, Blackberry, and (Palm) webOS • Development tools are open source and are free even for commercial use, unlike Visual Studio
  • 9. Android App vs. Mobile- Optimized RIAAndroid App vs. Mobile- Optimized RIA • Android Flash plugins available; Silverlight coming soon • Could develop in JavaScript and/or HTML5 • WWW App • Easier for users to run; no need to install • For a paid app, avoid the 30% App Store commission • Easier to write cross-platform apps • Android Apps • Fewer security hurdles • Use APIs for access to built in GPS, camera, etc. • Probably better performance; one layer less
  • 10. Android Apps: MarketingAndroid Apps: Marketing • Usually market apps through Android App Market • There are other markets, also • App store will dominate the market due to access through built in app • Can set up for download directly on a website • User must agree to “install apps from unknown sources”
  • 11. Android Apps: MarketingAndroid Apps: Marketing • Revenue from app sales prices and/or advertising • Conventional wisdom is that iOS users will pay for apps, but Android users won’t • 57% of Android App Store apps are free, vs. 28% for Apple App Store • Android Market takes 30% commission • Any purchase model other than one-time purchase must be homegrown, using Paypal or similar service • PPC ads • My guess is that response to these is extremely low • Probably need to be very aggressive with banner ads • Sell to companies?
  • 12. Android DeploymentAndroid Deployment • Apps are packaged in .apk format, variant of .jar, then downloaded to device and installed • .apks contain .dex files (bytecode), manifest and various other files • Manifest contains security and link info, hardware access info, minimum OS release info, etc.
  • 13. Android UIAndroid UI • Activity: single screen with a UI, somewhat analogous to XAML / code behind pattern in .NET • Email app might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails • Implement by subclassing Activity class • View: drawable object • Android UI View ≠ MVC View • UI contains a hierarchy of Views • View is a class, subclassed by the drawable objects in the UI
  • 14. Android UIAndroid UI • Service: background operation • play music in the background while the user is in a different application • fetch data over the network without blocking user interaction with an activity • Content Provider: DB or other data access • Broadcast Receiver: responds to system messages • Battery low
  • 15. Android UIAndroid UI • UI construction can be done in three ways: • Programmatic, like hand-coded Java desktop GUI construction • Declarative hand-written, like Java web UI construction • XML • Declarative with a GUI builder, like .NET UI construction • GUI builder generates the XML
  • 16. Programmatic UIProgrammatic UI import android.app.Activity; import android.widget.TextView; import android.os.Bundle; public class AndroidDemo extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Activity is a subclass of context, so the TextView takes this as a parameter TextView tv = new TextView(this); tv.setText("Hello, vibrant"); setContentView(tv); }}
  • 17. Manual Declarative UIManual Declarative UI main.xml Layout File: <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/textview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/hello"/> strings.xml resource file: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Hello Again, vibrant!</string> <string name="app_name">vibrantAndroidDemo</string> </resources>
  • 18. Manual Declarative UIManual Declarative UI Java class: package vibrant.demo; import android.app.Activity; import android.os.Bundle; public class AndroidDemo extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); }}
  • 19. What’s R?What’s R? /* AUTO-GENERATED FILE. DO NOT MODIFY. This class was automatically generated by the * aapt tool from the resource data it found. It should not be modified by hand. */ package vibrant.demo; public final class R { public static final class attr { } public static final class drawable { public static final int icon=0x7f020000; } public static final class id { public static final int textview=0x7f050000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f040001; public static final int hello=0x7f040000; }}
  • 20. UI With GUI BuilderUI With GUI Builder
  • 21. Android Event HandlersAndroid Event Handlers From the code file for the activity: Button ok = (Button) findViewById(R.id.button1); ok.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { CharSequence s = et.getText(); tv.setText("Welcome, " + s); } });
  • 22. Copyright ©2010 Lauren Darcey and Shane Conder
  • 23. APIs for Android built-insAPIs for Android built-ins • Android OS ships with many built in apps • Web Browser • Google Maps • Navigation • Camera apps • Built in access for these as well as TTS and Voice Recognition, etc.
  • 24. ThankThank You !!!You !!! For More Information click below link: Follow Us on: http://vibranttechnologies.co.in/android-classes-in-mumbai.html