SlideShare ist ein Scribd-Unternehmen logo
1 von 49
AndroidAndroid
ApplicationApplication
ConfigurationConfiguration
ReferencesReferences
• This tutorial is a brief overview of some major
concepts…Android is much richer and more
complex
• Developer’s Guide
o http://developer.android.com/guide/index.html
• API Reference
o http://developer.android.com/reference/packages.html
ToolsTools
• Phone
• Eclipse ( http://www.eclipse.org/downloads/ )
o Android Plugin (ADT)
• Android SDK (
http://developer.android.com/sdk/index.html )
o Install everything except Additional SDK Platforms, unless you want to
• Windows Users: may need to install Motorola Driver
directly (
http://www.motorola.com/Support/US-EN/Support-Homepage/Soft
)
Android SDKAndroid SDK
• Once installed open the SDK Manager
• Install the desired packages
• Create an Android Virtual Device (AVD)
SDK ManagerSDK Manager
AVDAVD
ADT Plugin (1)ADT Plugin (1)
• In Eclipse, go to Help -> Install New Software
• Click ‘Add’ in top right
• Enter:
o Name: ADT Plugin
o Location: https://dl-ssl.google.com/android/eclipse/
• Click OK, then select ‘Developer Tools’, click Next
• Click Next and then Finish
• Afterwards, restart Eclipse
• Specify SDK location (next 3 slides)
o Must do this every time start a new project in a new location (at
least in Windows)
ADT Plugin (2)ADT Plugin (2)
ADT Plugin (3)ADT Plugin (3)
ADT Plugin (4)ADT Plugin (4)
Creating a Project (1)Creating a Project (1)
Creating a Project (2)Creating a Project (2)
Need
the
items
circled
Then
click
Finish
Project ComponentsProject Components
• src – your source code
• gen – auto-generated code (usually just R.java)
• Included libraries
• Resources
o Drawables (like .png images)
o Layouts
o Values (like strings)
• Manifest file
XMLXML
• Used to define some of the resources
o Layouts (UI)
o Strings
• Manifest file
• Shouldn’t usually have to edit it directly, Eclipse can
do that for you
• Preferred way of creating UIs
o Separates the description of the layout from any actual code that
controls it
o Can easily take a UI from one platform to another
R ClassR Class
• Auto-generated: you shouldn’t edit it
• Contains IDs of the project resources
• Enforces good software engineering
• Use findViewById and Resources object to get
access to the resources
o Ex. Button b = (Button)findViewById(R.id.button1)
o Ex. getResources().getString(R.string.hello));
Layouts (1)Layouts (1)
• Eclipse has a great UI creator
o Generates the XML for you
• Composed of View objects
• Can be specified for portrait and landscape mode
o Use same file name, so can make completely different UIs for the
orientations without modifying any code
Layouts (2)Layouts (2)
Layouts (3)Layouts (3)
• Click ‘Create’ to make layout modifications
• When in portrait mode can select ‘Portrait’ to make
a res sub folder for portrait layouts
o Likewise for Landscape layouts while in landscape mode
o Will create folders titled ‘layout-port’ and ‘layout-land’
• Note: these ‘port’ and ‘land’ folders are examples
of ‘alternate layouts’, see here for more info
o http://developer.android.com/guide/topics/resources/providing-resources.html
• Avoid errors by making sure components have the
same id in both orientations, and that you’ve tested
each orientation thoroughly
Layouts (4)Layouts (4)
StringsStrings
• In res/values
o strings.xml
• Application wide available strings
• Promotes good software engineering
• UI components made in the UI editor should have
text defined in strings.xml
• Strings are just one kind of ‘Value’ there are many
others
Manifest File (1)Manifest File (1)
• Contains characteristics about your application
• When have more than one Activity in app,
NEED to specify it in manifest file
o Go to graphical view of the manifest file
o Add an Activity in the bottom right
o Browse for the name of the activity
• Need to specify Services and other
components too
• Also important to define permissions and
external libraries, like Google Maps API
Manifest File (2) – Adding an ActivityManifest File (2) – Adding an Activity
Android Programming ComponentsAndroid Programming Components
• Activity
o http://developer.android.com/guide/topics/fundamentals/activities.ht
• Service
o http://developer.android.com/guide/topics/fundamentals/services.htm
• Content Providers
• Broadcast Receivers
• Android in a nutshell:
o http://developer.android.com/guide/topics/fundamentals.html
Activities (1)Activities (1)
• The basis of android applications
• A single Activity defines a single viewable screen
o the actions, not the layout
• Can have multiple per application
• Each is a separate entity
• They have a structured life cycle
o Different events in their life happen either via the user touching buttons or
programmatically
Activities (2)Activities (2)
Services (1)Services (1)
• Run in the background
o Can continue even if Activity that started it dies
o Should be used if something needs to be done while the user is not
interacting with application
• Otherwise, a thread is probably more applicable
o Should create a new thread in the service to do work in, since the
service runs in the main thread
• Can be bound to an application
o In which case will terminate when all applications bound to it unbind
o Allows multiple applications to communicate with it via a common
interface
• Needs to be declared in manifest file
• Like Activities, has a structured life cycle
Services (2)Services (2)
Running in Eclipse (1)Running in Eclipse (1)
• Similar to launching a regular Java app, use the
launch configurations
• Specify an Android Application and create a new
one
• Specify activity to be run
• Can select a manual option, so each time program
is run, you are asked whether you want to use the
actual phone or the emulator
o Otherwise, it should be smart and use whichever one is available
Running in Eclipse (2)Running in Eclipse (2)
Running in Eclipse (3)Running in Eclipse (3)
Running in Eclipse (4)Running in Eclipse (4)
USB DebuggingUSB Debugging
• Should be enabled on phone to use developer
features
• In the main apps screen select Settings ->
Applications -> Development -> USB debugging (it
needs to be checked)
Android Debug BridgeAndroid Debug Bridge
• Used for a wide variety of developer tasks
o Read from the log file
o Show what android devices are available
o Install android applications (.apk files)
• In the ‘platform-tools’ directory of the main android
sdk directory
o Recommend putting this directory and the ‘tools’ directory on the system
path
• adb.exe
DebuggingDebugging• Instead of using traditional System.out.println, use the Log class
o Imported with android.util.Log
o Multiple types of output (debug, warning, error, …)
o Log.d(<tag>,<string>)
• Can be read using logcat.
o Print out the whole log, which auto-updates
• adb logcat
o Erase log
• adb logcat –c
o Filter output via tags
• adb logcat <tag>:<msg type> *:S
• can have multiple <tag>:<msg type> filters
• <msg type> corresponds to debug, warning, error, etc.
• If use Log.d(), then <msg type> = D
• Reference
o http://developer.android.com/guide/developing/debugging/debugging-log.ht
Maps Example (1)Maps Example (1)
• Using Google Maps in your app
• Setup project to use ‘Google API’ version
• Edit Manifest file
o To indicate the app will use maps and the internet
• Get a maps API key
• Note: Google Maps API can display a map and draw
overlays, but is not the full Google Maps experience you
enjoy on the web
o For example, there does not seem to be inherent support
for drawing routes between points (if you find it let me
know)…however, you can draw lines between points and
almost any type of overlay, but that’s different than street
routes
o The directions API is a web service, which is different,
among several other Google web services
• Read the Google API terms of use
Maps Example (2)Maps Example (2)
Maps Example (3) – Manifest (1)Maps Example (3) – Manifest (1)
• Open Manifest file
• Add map library tag
o Add the ‘Uses Library’ com.google.android.maps
• Indicate the app will access the internet
o Add the ‘Permission’ android.permission.lNTERNET
• End goal is to add the following two lines to XML
file, under the <manifest> and <application
tags>, respectively
o Under the <manifest> tag
• <uses-permission android:name="android.permission.INTERNET"></uses-
permission>
o Under the <application> tag
• <uses-library android:name="com.google.android.maps"></uses-library>
• Following is GUI way to add them
Maps Example (4) – Manifest (2)Maps Example (4) – Manifest (2)
1
2
Maps Example (5) – Manifest (3)Maps Example (5) – Manifest (3)
• Select ‘Add’ under ‘Uses Library’ (last slide)
• Then select ‘Uses Library at this prompt
• Set name as: com.google.android.maps (next slide)
and save
Maps Example (6) – Manifest (4)Maps Example (6) – Manifest (4)
Maps Example (7) – Manifest (5)Maps Example (7) – Manifest (5)
2
1
Maps Example (8) – Manifest (6)Maps Example (8) – Manifest (6)
• Select ‘Permissions’ and then ‘Add’ (last slide)
• Select ‘Uses Permissions’ at this prompt
• Set name to: android.permission.INTERNET and save
(next slide)
Maps Example (9) – Manifest (7)Maps Example (9) – Manifest (7)
Maps Example (10) – Maps API Key (1)Maps Example (10) – Maps API Key (1)
• All Android applications need to be signed
o The debug mode signs for you with special debug certificate
• All MapView elements in map applications need to
have an API key associated with them
o That key must be registered with the certificate used to sign the app
• When releasing app, need to sign with a release
certificate and get a new API Key
Maps Example (11) – Maps API Key (2)Maps Example (11) – Maps API Key (2)
• For debug mode, get the MD5 fingerprint of the debug certificate
o Locate the ‘keystore’
• Windows Vista: C:Users<user>.androiddebug.keystore
• Windows XP: C:Documents and
Settings<user>.androiddebug.keystore
• OS X and Linux: ~/.android/debug.keystore
o Use Keytool (comes with Java, in the bin directory with the other Java
tools, should put that dir on system PATH) to get fingerprint
• keytool -list –v -alias androiddebugkey -keystore
“<path_to_debug_keystore>” -storepass android -keypass android
o If don’t include –v option, then will probably get only 1
fingerprint, and if it’s not MD5, then need –v (Java 7 needs –v)
• Extract the MD5 fingerprint, SHA will not work unfortunately
• Go to https://code.google. com/android/maps-api-signup.html , agree to
terms and paste MD5 fingerprint, you will then be given an API Key
Maps Example (12)Maps Example (12)
• Need to put MapView tag in XML
o com.google.android.maps.MapView
o MapView is the basic view that represents a Google Map display
o Must include API Key in XML, inside a layout
• <com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey=“<api key>”/>
• Maps API Reference
o http://code.google.com/android/add-ons/google-apis/reference/inde
AcknowledgementsAcknowledgements
• Android Developer’s Website
o Activity and Service life-cycle flow charts
o Tons of other Android info
• Google Maps API external library
o http://code.google.com/android/add-ons/google-apis/maps-overview.html
• MightyPocket
o http://www.mightypocket.com/2010/08/android-screenshots-screen-capture-screen-cast/
• Numerous Forums & other developer sites, including:
o http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html
o http://efreedom.com/Question/1-6070968/Google-Maps-Api-Directions
o http://www.mail-archive.com/android-
developers@googlegroups.com/msg28487.html
o http://android.bigresource.com/ threads
o http://groups.google.com/group/android-developers threads
o Many http://stackoverflow.com threads
o http://www.anddev.org/google_driving_directions_-_mapview_overlayed-t826.html
• Zainan Victor Zhou – for advice and his own tutorial
ThankThank You !!!You !!!
For More Information click below link:
Follow Us on:
http://vibranttechnologies.co.in/android-classes-in-mumbai.html

Weitere ähnliche Inhalte

Ähnlich wie Android - Android Application Configuration

Android tutorial
Android tutorialAndroid tutorial
Android tutorialEd Zel
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorialkatayoon_bz
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android ApplicationArcadian Learning
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionDuckMa
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applicationsTOPS Technologies
 
Android best training-in-mumbai
Android best training-in-mumbaiAndroid best training-in-mumbai
Android best training-in-mumbaivibrantuser
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi androidsusijanny
 
Android app development
Android app developmentAndroid app development
Android app developmentAbhishek Saini
 
Android development orientation for starters v4 seminar
Android development orientation for starters v4   seminarAndroid development orientation for starters v4   seminar
Android development orientation for starters v4 seminarJoemarie Amparo
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Javaamaankhan
 

Ähnlich wie Android - Android Application Configuration (20)

Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android
AndroidAndroid
Android
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
Android best training-in-mumbai
Android best training-in-mumbaiAndroid best training-in-mumbai
Android best training-in-mumbai
 
Android session 1
Android session 1Android session 1
Android session 1
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
ANDROID PPT 1.pdf
ANDROID PPT 1.pdfANDROID PPT 1.pdf
ANDROID PPT 1.pdf
 
Android dev tips
Android dev tipsAndroid dev tips
Android dev tips
 
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
 
Android development orientation for starters v4 seminar
Android development orientation for starters v4   seminarAndroid development orientation for starters v4   seminar
Android development orientation for starters v4 seminar
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 

Mehr von Vibrant Technologies & Computers

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.Vibrant Technologies & Computers
 

Mehr von 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
 

Kürzlich hochgeladen

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Kürzlich hochgeladen (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Android - Android Application Configuration

  • 1.
  • 3. ReferencesReferences • This tutorial is a brief overview of some major concepts…Android is much richer and more complex • Developer’s Guide o http://developer.android.com/guide/index.html • API Reference o http://developer.android.com/reference/packages.html
  • 4. ToolsTools • Phone • Eclipse ( http://www.eclipse.org/downloads/ ) o Android Plugin (ADT) • Android SDK ( http://developer.android.com/sdk/index.html ) o Install everything except Additional SDK Platforms, unless you want to • Windows Users: may need to install Motorola Driver directly ( http://www.motorola.com/Support/US-EN/Support-Homepage/Soft )
  • 5. Android SDKAndroid SDK • Once installed open the SDK Manager • Install the desired packages • Create an Android Virtual Device (AVD)
  • 8. ADT Plugin (1)ADT Plugin (1) • In Eclipse, go to Help -> Install New Software • Click ‘Add’ in top right • Enter: o Name: ADT Plugin o Location: https://dl-ssl.google.com/android/eclipse/ • Click OK, then select ‘Developer Tools’, click Next • Click Next and then Finish • Afterwards, restart Eclipse • Specify SDK location (next 3 slides) o Must do this every time start a new project in a new location (at least in Windows)
  • 9. ADT Plugin (2)ADT Plugin (2)
  • 10. ADT Plugin (3)ADT Plugin (3)
  • 11. ADT Plugin (4)ADT Plugin (4)
  • 12. Creating a Project (1)Creating a Project (1)
  • 13. Creating a Project (2)Creating a Project (2) Need the items circled Then click Finish
  • 14. Project ComponentsProject Components • src – your source code • gen – auto-generated code (usually just R.java) • Included libraries • Resources o Drawables (like .png images) o Layouts o Values (like strings) • Manifest file
  • 15. XMLXML • Used to define some of the resources o Layouts (UI) o Strings • Manifest file • Shouldn’t usually have to edit it directly, Eclipse can do that for you • Preferred way of creating UIs o Separates the description of the layout from any actual code that controls it o Can easily take a UI from one platform to another
  • 16. R ClassR Class • Auto-generated: you shouldn’t edit it • Contains IDs of the project resources • Enforces good software engineering • Use findViewById and Resources object to get access to the resources o Ex. Button b = (Button)findViewById(R.id.button1) o Ex. getResources().getString(R.string.hello));
  • 17. Layouts (1)Layouts (1) • Eclipse has a great UI creator o Generates the XML for you • Composed of View objects • Can be specified for portrait and landscape mode o Use same file name, so can make completely different UIs for the orientations without modifying any code
  • 19. Layouts (3)Layouts (3) • Click ‘Create’ to make layout modifications • When in portrait mode can select ‘Portrait’ to make a res sub folder for portrait layouts o Likewise for Landscape layouts while in landscape mode o Will create folders titled ‘layout-port’ and ‘layout-land’ • Note: these ‘port’ and ‘land’ folders are examples of ‘alternate layouts’, see here for more info o http://developer.android.com/guide/topics/resources/providing-resources.html • Avoid errors by making sure components have the same id in both orientations, and that you’ve tested each orientation thoroughly
  • 21. StringsStrings • In res/values o strings.xml • Application wide available strings • Promotes good software engineering • UI components made in the UI editor should have text defined in strings.xml • Strings are just one kind of ‘Value’ there are many others
  • 22. Manifest File (1)Manifest File (1) • Contains characteristics about your application • When have more than one Activity in app, NEED to specify it in manifest file o Go to graphical view of the manifest file o Add an Activity in the bottom right o Browse for the name of the activity • Need to specify Services and other components too • Also important to define permissions and external libraries, like Google Maps API
  • 23. Manifest File (2) – Adding an ActivityManifest File (2) – Adding an Activity
  • 24. Android Programming ComponentsAndroid Programming Components • Activity o http://developer.android.com/guide/topics/fundamentals/activities.ht • Service o http://developer.android.com/guide/topics/fundamentals/services.htm • Content Providers • Broadcast Receivers • Android in a nutshell: o http://developer.android.com/guide/topics/fundamentals.html
  • 25. Activities (1)Activities (1) • The basis of android applications • A single Activity defines a single viewable screen o the actions, not the layout • Can have multiple per application • Each is a separate entity • They have a structured life cycle o Different events in their life happen either via the user touching buttons or programmatically
  • 27. Services (1)Services (1) • Run in the background o Can continue even if Activity that started it dies o Should be used if something needs to be done while the user is not interacting with application • Otherwise, a thread is probably more applicable o Should create a new thread in the service to do work in, since the service runs in the main thread • Can be bound to an application o In which case will terminate when all applications bound to it unbind o Allows multiple applications to communicate with it via a common interface • Needs to be declared in manifest file • Like Activities, has a structured life cycle
  • 29. Running in Eclipse (1)Running in Eclipse (1) • Similar to launching a regular Java app, use the launch configurations • Specify an Android Application and create a new one • Specify activity to be run • Can select a manual option, so each time program is run, you are asked whether you want to use the actual phone or the emulator o Otherwise, it should be smart and use whichever one is available
  • 30. Running in Eclipse (2)Running in Eclipse (2)
  • 31. Running in Eclipse (3)Running in Eclipse (3)
  • 32. Running in Eclipse (4)Running in Eclipse (4)
  • 33. USB DebuggingUSB Debugging • Should be enabled on phone to use developer features • In the main apps screen select Settings -> Applications -> Development -> USB debugging (it needs to be checked)
  • 34. Android Debug BridgeAndroid Debug Bridge • Used for a wide variety of developer tasks o Read from the log file o Show what android devices are available o Install android applications (.apk files) • In the ‘platform-tools’ directory of the main android sdk directory o Recommend putting this directory and the ‘tools’ directory on the system path • adb.exe
  • 35. DebuggingDebugging• Instead of using traditional System.out.println, use the Log class o Imported with android.util.Log o Multiple types of output (debug, warning, error, …) o Log.d(<tag>,<string>) • Can be read using logcat. o Print out the whole log, which auto-updates • adb logcat o Erase log • adb logcat –c o Filter output via tags • adb logcat <tag>:<msg type> *:S • can have multiple <tag>:<msg type> filters • <msg type> corresponds to debug, warning, error, etc. • If use Log.d(), then <msg type> = D • Reference o http://developer.android.com/guide/developing/debugging/debugging-log.ht
  • 36. Maps Example (1)Maps Example (1) • Using Google Maps in your app • Setup project to use ‘Google API’ version • Edit Manifest file o To indicate the app will use maps and the internet • Get a maps API key • Note: Google Maps API can display a map and draw overlays, but is not the full Google Maps experience you enjoy on the web o For example, there does not seem to be inherent support for drawing routes between points (if you find it let me know)…however, you can draw lines between points and almost any type of overlay, but that’s different than street routes o The directions API is a web service, which is different, among several other Google web services • Read the Google API terms of use
  • 37. Maps Example (2)Maps Example (2)
  • 38. Maps Example (3) – Manifest (1)Maps Example (3) – Manifest (1) • Open Manifest file • Add map library tag o Add the ‘Uses Library’ com.google.android.maps • Indicate the app will access the internet o Add the ‘Permission’ android.permission.lNTERNET • End goal is to add the following two lines to XML file, under the <manifest> and <application tags>, respectively o Under the <manifest> tag • <uses-permission android:name="android.permission.INTERNET"></uses- permission> o Under the <application> tag • <uses-library android:name="com.google.android.maps"></uses-library> • Following is GUI way to add them
  • 39. Maps Example (4) – Manifest (2)Maps Example (4) – Manifest (2) 1 2
  • 40. Maps Example (5) – Manifest (3)Maps Example (5) – Manifest (3) • Select ‘Add’ under ‘Uses Library’ (last slide) • Then select ‘Uses Library at this prompt • Set name as: com.google.android.maps (next slide) and save
  • 41. Maps Example (6) – Manifest (4)Maps Example (6) – Manifest (4)
  • 42. Maps Example (7) – Manifest (5)Maps Example (7) – Manifest (5) 2 1
  • 43. Maps Example (8) – Manifest (6)Maps Example (8) – Manifest (6) • Select ‘Permissions’ and then ‘Add’ (last slide) • Select ‘Uses Permissions’ at this prompt • Set name to: android.permission.INTERNET and save (next slide)
  • 44. Maps Example (9) – Manifest (7)Maps Example (9) – Manifest (7)
  • 45. Maps Example (10) – Maps API Key (1)Maps Example (10) – Maps API Key (1) • All Android applications need to be signed o The debug mode signs for you with special debug certificate • All MapView elements in map applications need to have an API key associated with them o That key must be registered with the certificate used to sign the app • When releasing app, need to sign with a release certificate and get a new API Key
  • 46. Maps Example (11) – Maps API Key (2)Maps Example (11) – Maps API Key (2) • For debug mode, get the MD5 fingerprint of the debug certificate o Locate the ‘keystore’ • Windows Vista: C:Users<user>.androiddebug.keystore • Windows XP: C:Documents and Settings<user>.androiddebug.keystore • OS X and Linux: ~/.android/debug.keystore o Use Keytool (comes with Java, in the bin directory with the other Java tools, should put that dir on system PATH) to get fingerprint • keytool -list –v -alias androiddebugkey -keystore “<path_to_debug_keystore>” -storepass android -keypass android o If don’t include –v option, then will probably get only 1 fingerprint, and if it’s not MD5, then need –v (Java 7 needs –v) • Extract the MD5 fingerprint, SHA will not work unfortunately • Go to https://code.google. com/android/maps-api-signup.html , agree to terms and paste MD5 fingerprint, you will then be given an API Key
  • 47. Maps Example (12)Maps Example (12) • Need to put MapView tag in XML o com.google.android.maps.MapView o MapView is the basic view that represents a Google Map display o Must include API Key in XML, inside a layout • <com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey=“<api key>”/> • Maps API Reference o http://code.google.com/android/add-ons/google-apis/reference/inde
  • 48. AcknowledgementsAcknowledgements • Android Developer’s Website o Activity and Service life-cycle flow charts o Tons of other Android info • Google Maps API external library o http://code.google.com/android/add-ons/google-apis/maps-overview.html • MightyPocket o http://www.mightypocket.com/2010/08/android-screenshots-screen-capture-screen-cast/ • Numerous Forums & other developer sites, including: o http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html o http://efreedom.com/Question/1-6070968/Google-Maps-Api-Directions o http://www.mail-archive.com/android- developers@googlegroups.com/msg28487.html o http://android.bigresource.com/ threads o http://groups.google.com/group/android-developers threads o Many http://stackoverflow.com threads o http://www.anddev.org/google_driving_directions_-_mapview_overlayed-t826.html • Zainan Victor Zhou – for advice and his own tutorial
  • 49. ThankThank You !!!You !!! For More Information click below link: Follow Us on: http://vibranttechnologies.co.in/android-classes-in-mumbai.html