SlideShare une entreprise Scribd logo
1  sur  29
Storing Information on the device
Internal Storage on the device

• You can save files directly on the device's internal storage
• By default, files saved to the internal storage are private to
  your application and other applications cannot access them
  (nor can the user).
• When the user uninstalls your application, these files are
  removed.
Usage:

• Call openFileOutput() with the name of the file and the
  operating mode. This returns aFileOutputStream
• Write to the file with write()
• Close the stream with close()
External Storage

• Every Android-compatible device supports a shared "external
  storage" that you can use to save files
• Files saved to the external storage are world-readable and can
  be modified by the user
Usage:

• Checking media availability :Using getExternalStorageState()
• If you're using API Level 8 or greater,
  use getExternalCacheDir() to open a File
• If you're using API Level 7 or lower,
  use getExternalStorageDirectory() to open a File
Finding the File:
Animation in Android
Animation

• There are two types of animations that you can do with the
  Animation framework of Android.
• Class - android.view.animation.Animation

1. Frame animation
2. Tween animation
Frame animation

• A series of frames is drawn one after the other at regular .

• Frame-by-frame animation is handled by the
  AnimationDrawable class.
android_frame_anim.xml

<?xml version="1.0" encoding="utf-8"?>
<animation-list
   xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/android_1" android:duration="100"   />
<item android:drawable="@drawable/android_2" android:duration="100"   />
<item android:drawable="@drawable/android_3" android:duration="100"   />
<item android:drawable="@drawable/android_4" android:duration="100"   />
<item android:drawable="@drawable/android_5" android:duration="100"   />
<item android:drawable="@drawable/android_6" android:duration="100"   />
<item android:drawable="@drawable/android_7" android:duration="100"   />
</animation-list>
Tween animation

• Simple transformations of position, size, rotation etc. to the
  content of a View.
• Animation can be defined in XML that performs transitions
  such as rotating, fading, moving, and stretching on a graphic.
• If you want to perform more than one Animation you can
  define in a <set>.
• <set> is a container that can holds other animation elements
  like - <alpha>,<scale>, <translate>,<rotate> or other <set>
<alpha>

• A fade-in or fade-out animation

• Attributes:
• android:fromAlpha – Float value. Starting opacity offset.
• android:toAlpha – Float value. Ending opacity offset

• Where 0.0 is transparent and 1.0 is opaque.
<scale>
• A resizing animation represents ScaleAnimation.

• You can specify the center point of the image from which it grows
  outward (or inward) by specifying pivotX and pivotY.

• <scale
      android:fromXScale="float"
      android:toXScale="float"
      android:fromYScale="float"
      android:toYScale="float"
      android:pivotX="float"
      android:pivotY="float" />
<translate>
• A vertical and/or horizontal motion represents TranslateAnimation.
   – values from -100 to 100 ending with "%", indicating a percentage relative to itself;
   – values from -100 to 100 ending in "%p", indicating a percentage relative to its parent;
   – a float value with no suffix, indicating an absolute value.


• <translate
      android:fromXDelta="float"
      android:toXDelta="float"
      android:fromYDelta="float"
      android:toYDelta="float" />
<rotate>

• A rotation animation represents a RotateAnimation.
• pivotX and pivotY will define the center point of rotation.

• <rotate
      android:fromDegrees="float“
      android:toDegrees="float"
      android:pivotX="float"
      android:pivotY="float" />
Async Task
AsyncTask

• AsyncTask class encapsulates the creation of Threads and
  Handlers.
• AsyncTask is started via the execute() method.
• The execute() method calls the doInBackground() and
  onPostExecute() method.
• The doInBackground() method contains the coding instruction
  which should be performed in a background (separate)
  thread.
• The onPostExecute() method updates the UI Thread once
  the doInBackground() method finishes.
AsyncTask

• AsyncTask<Params, Progress, Result>

• The three types used by an asynchronous task are the
  following:
   – Params, the type of the parameters sent to the task upon execution.
   – Progress, the type of the progress units published during the
     background computation.
   – Result, the type of the result of the background computation.
AsyncTask Coding Sample

public class Sample extends AsyncTask<String, String , String>{
    @Override
    protected void onProgressUpdate(String... values) {
           super.onProgressUpdate(values);
    }
    @Override
    protected String doInBackground(String... params) {
           return null;
    }
    @Override
    protected void onPostExecute(String result) {
           super.onPostExecute(result);
    }

}
Canvas
Canvas

• The Canvas class holds the "draw" calls.
• To draw something, you need 4 basic components:
   –   A Bitmap to hold the pixels
   –   A Canvas to host the draw calls (writing into the bitmap)
   –   a drawing primitive (e.g. Rect, Path, text, Bitmap)
   –   and a paint (to describe the colors and styles for the drawing)
Paint and Path
Paint

• The Paint object represents the "brush".
• Views draw themself in the onDraw() method.
• Canvas object allows you to perform drawing operations on it,
  e.g. draw lines, circle, text and Bitmaps.
• Invalidate(); method forces a view to draw.
• Because of invalidate(); onDraw method is called.
Properties

Paint Object Property                    Description
paint.setAntiAlias(true);                Makes the edges smooth.
paint.setColor(Color.RED);               Set the paint's color.
paint.setStyle(Paint.Style.STROKE);      Set the paint's style, It controls primitive geometry

paint.setStrokeJoin(Paint.Join.ROUND);   Sets the paint’s join.
paint.setStrokeWidth(15f);               Set the width for stroking.


Touch Event                              Description
MotionEvent.ACTION_DOWN                  When you touch the screen
MotionEvent.ACTION_MOVE                  When you move your finger across the screen
MotionEvent.ACTION_UP                    When you remove your finger from the screen
Process for Project Submission & Evaluation

• Each student is expected to create an Android App as Project
  Work for the Course.
• Certificates will be provided to the students after project
  submission and evaluation
• At the time of project submission a skype interview will be
  conducted.
• The project will be evaluated on Usability, Functionality and
  Design.
• We are always there to help you on forum and on skype.
Project Plan
               Week 4

                          +

                              Week 5




                 Week 6
Evaluation Process

                        10 Days                Interviews
                                                 Awards

                                               Certificates




                       Evaluation     7 Days
                     And Submission
•Q & A..?
Android webinar class_4

Contenu connexe

En vedette

Java class 6
Java class 6Java class 6
Java class 6Edureka!
 
Java class 3
Java class 3Java class 3
Java class 3Edureka!
 
Java class 7
Java class 7Java class 7
Java class 7Edureka!
 
Learn Hadoop
Learn HadoopLearn Hadoop
Learn HadoopEdureka!
 
Hadoop Adminstration with Latest Release (2.0)
Hadoop Adminstration with Latest Release (2.0)Hadoop Adminstration with Latest Release (2.0)
Hadoop Adminstration with Latest Release (2.0)Edureka!
 
Android webinar class_1
Android webinar class_1Android webinar class_1
Android webinar class_1Edureka!
 
Android webinar class_6
Android webinar class_6Android webinar class_6
Android webinar class_6Edureka!
 
Java class 5
Java class 5Java class 5
Java class 5Edureka!
 
Java class 1
Java class 1Java class 1
Java class 1Edureka!
 
Java class 4
Java class 4Java class 4
Java class 4Edureka!
 
Bulk Loading Into HBase With MapReduce
Bulk Loading Into HBase With MapReduceBulk Loading Into HBase With MapReduce
Bulk Loading Into HBase With MapReduceEdureka!
 
Learn Hadoop Administration
Learn Hadoop AdministrationLearn Hadoop Administration
Learn Hadoop AdministrationEdureka!
 
Build Application With MongoDB
Build Application With MongoDBBuild Application With MongoDB
Build Application With MongoDBEdureka!
 
Using Android 5.0 Lollipop
Using Android 5.0 LollipopUsing Android 5.0 Lollipop
Using Android 5.0 LollipopEdureka!
 
Create Restful Web Application With Node.js Express Framework
Create Restful Web Application With Node.js Express FrameworkCreate Restful Web Application With Node.js Express Framework
Create Restful Web Application With Node.js Express FrameworkEdureka!
 
New-Age Search through Apache Solr
New-Age Search through Apache SolrNew-Age Search through Apache Solr
New-Age Search through Apache SolrEdureka!
 
Association Mining
Association Mining Association Mining
Association Mining Edureka!
 
Spark Streaming
Spark StreamingSpark Streaming
Spark StreamingEdureka!
 
MS .Net - An IntelliSense Way of Web Development
MS .Net - An IntelliSense Way of Web DevelopmentMS .Net - An IntelliSense Way of Web Development
MS .Net - An IntelliSense Way of Web DevelopmentEdureka!
 
Prince2 for Value Driven Project Management
Prince2 for Value Driven Project ManagementPrince2 for Value Driven Project Management
Prince2 for Value Driven Project ManagementEdureka!
 

En vedette (20)

Java class 6
Java class 6Java class 6
Java class 6
 
Java class 3
Java class 3Java class 3
Java class 3
 
Java class 7
Java class 7Java class 7
Java class 7
 
Learn Hadoop
Learn HadoopLearn Hadoop
Learn Hadoop
 
Hadoop Adminstration with Latest Release (2.0)
Hadoop Adminstration with Latest Release (2.0)Hadoop Adminstration with Latest Release (2.0)
Hadoop Adminstration with Latest Release (2.0)
 
Android webinar class_1
Android webinar class_1Android webinar class_1
Android webinar class_1
 
Android webinar class_6
Android webinar class_6Android webinar class_6
Android webinar class_6
 
Java class 5
Java class 5Java class 5
Java class 5
 
Java class 1
Java class 1Java class 1
Java class 1
 
Java class 4
Java class 4Java class 4
Java class 4
 
Bulk Loading Into HBase With MapReduce
Bulk Loading Into HBase With MapReduceBulk Loading Into HBase With MapReduce
Bulk Loading Into HBase With MapReduce
 
Learn Hadoop Administration
Learn Hadoop AdministrationLearn Hadoop Administration
Learn Hadoop Administration
 
Build Application With MongoDB
Build Application With MongoDBBuild Application With MongoDB
Build Application With MongoDB
 
Using Android 5.0 Lollipop
Using Android 5.0 LollipopUsing Android 5.0 Lollipop
Using Android 5.0 Lollipop
 
Create Restful Web Application With Node.js Express Framework
Create Restful Web Application With Node.js Express FrameworkCreate Restful Web Application With Node.js Express Framework
Create Restful Web Application With Node.js Express Framework
 
New-Age Search through Apache Solr
New-Age Search through Apache SolrNew-Age Search through Apache Solr
New-Age Search through Apache Solr
 
Association Mining
Association Mining Association Mining
Association Mining
 
Spark Streaming
Spark StreamingSpark Streaming
Spark Streaming
 
MS .Net - An IntelliSense Way of Web Development
MS .Net - An IntelliSense Way of Web DevelopmentMS .Net - An IntelliSense Way of Web Development
MS .Net - An IntelliSense Way of Web Development
 
Prince2 for Value Driven Project Management
Prince2 for Value Driven Project ManagementPrince2 for Value Driven Project Management
Prince2 for Value Driven Project Management
 

Similaire à Android webinar class_4

Basic Android Animation
Basic Android Animation Basic Android Animation
Basic Android Animation Shilu Shrestha
 
iOS 101 - Xcode, Objective-C, iOS APIs
iOS 101 - Xcode, Objective-C, iOS APIsiOS 101 - Xcode, Objective-C, iOS APIs
iOS 101 - Xcode, Objective-C, iOS APIsSubhransu Behera
 
Synapse india reviews on i phone and android os
Synapse india reviews on i phone and android osSynapse india reviews on i phone and android os
Synapse india reviews on i phone and android ossaritasingh19866
 
React Native: Introduction
React Native: IntroductionReact Native: Introduction
React Native: IntroductionInnerFood
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAmir Barylko
 
iOS Development: What's New
iOS Development: What's NewiOS Development: What's New
iOS Development: What's NewNascentDigital
 
iPhone dev intro
iPhone dev introiPhone dev intro
iPhone dev introVonbo
 
Beginning to iPhone development
Beginning to iPhone developmentBeginning to iPhone development
Beginning to iPhone developmentVonbo
 
Adventures in cross platform ConnectJS / TiConnect 2014
Adventures in cross platform ConnectJS / TiConnect 2014Adventures in cross platform ConnectJS / TiConnect 2014
Adventures in cross platform ConnectJS / TiConnect 2014Jason Kneen
 
Being Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentBeing Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentReto Meier
 
Android 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkAndroid 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkJussi Pohjolainen
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart JfokusLars Vogel
 
Scalamen and OT
Scalamen and OTScalamen and OT
Scalamen and OTgetch123
 
Developing for Leap Motion
Developing for Leap MotionDeveloping for Leap Motion
Developing for Leap MotionIris Classon
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOSPetr Dvorak
 
Build Your First Android App Session #1
Build Your First Android App Session #1Build Your First Android App Session #1
Build Your First Android App Session #1Troy Miles
 
JavaFX - Next Generation Java UI
JavaFX - Next Generation Java UIJavaFX - Next Generation Java UI
JavaFX - Next Generation Java UIYoav Aharoni
 

Similaire à Android webinar class_4 (20)

Basic Android Animation
Basic Android Animation Basic Android Animation
Basic Android Animation
 
iOS 101 - Xcode, Objective-C, iOS APIs
iOS 101 - Xcode, Objective-C, iOS APIsiOS 101 - Xcode, Objective-C, iOS APIs
iOS 101 - Xcode, Objective-C, iOS APIs
 
Synapse india reviews on i phone and android os
Synapse india reviews on i phone and android osSynapse india reviews on i phone and android os
Synapse india reviews on i phone and android os
 
React Native: Introduction
React Native: IntroductionReact Native: Introduction
React Native: Introduction
 
Synapse india mobile apps update
Synapse india mobile apps updateSynapse india mobile apps update
Synapse india mobile apps update
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App Testing
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescript
 
Intro to appcelerator
Intro to appceleratorIntro to appcelerator
Intro to appcelerator
 
iOS Development: What's New
iOS Development: What's NewiOS Development: What's New
iOS Development: What's New
 
iPhone dev intro
iPhone dev introiPhone dev intro
iPhone dev intro
 
Beginning to iPhone development
Beginning to iPhone developmentBeginning to iPhone development
Beginning to iPhone development
 
Adventures in cross platform ConnectJS / TiConnect 2014
Adventures in cross platform ConnectJS / TiConnect 2014Adventures in cross platform ConnectJS / TiConnect 2014
Adventures in cross platform ConnectJS / TiConnect 2014
 
Being Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentBeing Epic: Best Practices for Android Development
Being Epic: Best Practices for Android Development
 
Android 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkAndroid 2D Drawing and Animation Framework
Android 2D Drawing and Animation Framework
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
 
Scalamen and OT
Scalamen and OTScalamen and OT
Scalamen and OT
 
Developing for Leap Motion
Developing for Leap MotionDeveloping for Leap Motion
Developing for Leap Motion
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
 
Build Your First Android App Session #1
Build Your First Android App Session #1Build Your First Android App Session #1
Build Your First Android App Session #1
 
JavaFX - Next Generation Java UI
JavaFX - Next Generation Java UIJavaFX - Next Generation Java UI
JavaFX - Next Generation Java UI
 

Plus de Edureka!

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaEdureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaEdureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaEdureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaEdureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaEdureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaEdureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaEdureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaEdureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaEdureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaEdureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | EdurekaEdureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEdureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEdureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaEdureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaEdureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaEdureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaEdureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaEdureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | EdurekaEdureka!
 

Plus de Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 

Android webinar class_4

  • 2. Internal Storage on the device • You can save files directly on the device's internal storage • By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). • When the user uninstalls your application, these files are removed.
  • 3. Usage: • Call openFileOutput() with the name of the file and the operating mode. This returns aFileOutputStream • Write to the file with write() • Close the stream with close()
  • 4. External Storage • Every Android-compatible device supports a shared "external storage" that you can use to save files • Files saved to the external storage are world-readable and can be modified by the user
  • 5. Usage: • Checking media availability :Using getExternalStorageState() • If you're using API Level 8 or greater, use getExternalCacheDir() to open a File • If you're using API Level 7 or lower, use getExternalStorageDirectory() to open a File
  • 8. Animation • There are two types of animations that you can do with the Animation framework of Android. • Class - android.view.animation.Animation 1. Frame animation 2. Tween animation
  • 9. Frame animation • A series of frames is drawn one after the other at regular . • Frame-by-frame animation is handled by the AnimationDrawable class.
  • 10. android_frame_anim.xml <?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/android_1" android:duration="100" /> <item android:drawable="@drawable/android_2" android:duration="100" /> <item android:drawable="@drawable/android_3" android:duration="100" /> <item android:drawable="@drawable/android_4" android:duration="100" /> <item android:drawable="@drawable/android_5" android:duration="100" /> <item android:drawable="@drawable/android_6" android:duration="100" /> <item android:drawable="@drawable/android_7" android:duration="100" /> </animation-list>
  • 11. Tween animation • Simple transformations of position, size, rotation etc. to the content of a View. • Animation can be defined in XML that performs transitions such as rotating, fading, moving, and stretching on a graphic. • If you want to perform more than one Animation you can define in a <set>. • <set> is a container that can holds other animation elements like - <alpha>,<scale>, <translate>,<rotate> or other <set>
  • 12. <alpha> • A fade-in or fade-out animation • Attributes: • android:fromAlpha – Float value. Starting opacity offset. • android:toAlpha – Float value. Ending opacity offset • Where 0.0 is transparent and 1.0 is opaque.
  • 13. <scale> • A resizing animation represents ScaleAnimation. • You can specify the center point of the image from which it grows outward (or inward) by specifying pivotX and pivotY. • <scale android:fromXScale="float" android:toXScale="float" android:fromYScale="float" android:toYScale="float" android:pivotX="float" android:pivotY="float" />
  • 14. <translate> • A vertical and/or horizontal motion represents TranslateAnimation. – values from -100 to 100 ending with "%", indicating a percentage relative to itself; – values from -100 to 100 ending in "%p", indicating a percentage relative to its parent; – a float value with no suffix, indicating an absolute value. • <translate android:fromXDelta="float" android:toXDelta="float" android:fromYDelta="float" android:toYDelta="float" />
  • 15. <rotate> • A rotation animation represents a RotateAnimation. • pivotX and pivotY will define the center point of rotation. • <rotate android:fromDegrees="float“ android:toDegrees="float" android:pivotX="float" android:pivotY="float" />
  • 17. AsyncTask • AsyncTask class encapsulates the creation of Threads and Handlers. • AsyncTask is started via the execute() method. • The execute() method calls the doInBackground() and onPostExecute() method. • The doInBackground() method contains the coding instruction which should be performed in a background (separate) thread. • The onPostExecute() method updates the UI Thread once the doInBackground() method finishes.
  • 18. AsyncTask • AsyncTask<Params, Progress, Result> • The three types used by an asynchronous task are the following: – Params, the type of the parameters sent to the task upon execution. – Progress, the type of the progress units published during the background computation. – Result, the type of the result of the background computation.
  • 19. AsyncTask Coding Sample public class Sample extends AsyncTask<String, String , String>{ @Override protected void onProgressUpdate(String... values) { super.onProgressUpdate(values); } @Override protected String doInBackground(String... params) { return null; } @Override protected void onPostExecute(String result) { super.onPostExecute(result); } }
  • 21. Canvas • The Canvas class holds the "draw" calls. • To draw something, you need 4 basic components: – A Bitmap to hold the pixels – A Canvas to host the draw calls (writing into the bitmap) – a drawing primitive (e.g. Rect, Path, text, Bitmap) – and a paint (to describe the colors and styles for the drawing)
  • 23. Paint • The Paint object represents the "brush". • Views draw themself in the onDraw() method. • Canvas object allows you to perform drawing operations on it, e.g. draw lines, circle, text and Bitmaps. • Invalidate(); method forces a view to draw. • Because of invalidate(); onDraw method is called.
  • 24. Properties Paint Object Property Description paint.setAntiAlias(true); Makes the edges smooth. paint.setColor(Color.RED); Set the paint's color. paint.setStyle(Paint.Style.STROKE); Set the paint's style, It controls primitive geometry paint.setStrokeJoin(Paint.Join.ROUND); Sets the paint’s join. paint.setStrokeWidth(15f); Set the width for stroking. Touch Event Description MotionEvent.ACTION_DOWN When you touch the screen MotionEvent.ACTION_MOVE When you move your finger across the screen MotionEvent.ACTION_UP When you remove your finger from the screen
  • 25. Process for Project Submission & Evaluation • Each student is expected to create an Android App as Project Work for the Course. • Certificates will be provided to the students after project submission and evaluation • At the time of project submission a skype interview will be conducted. • The project will be evaluated on Usability, Functionality and Design. • We are always there to help you on forum and on skype.
  • 26. Project Plan Week 4 + Week 5 Week 6
  • 27. Evaluation Process 10 Days Interviews Awards Certificates Evaluation 7 Days And Submission

Notes de l'éditeur

  1. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  2. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  3. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  4. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  5. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  6. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  7. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  8. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  9. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  10. AsyncTask class encapsulates the creation of Threads and Handlers. An AsyncTask is started via the execute() method.The execute() method calls the doInBackground() and the onPostExecute() method.The doInBackground() method contains the coding instruction which should be performed in a background thread. This method runs automatically in a separate Thread.The onPostExecute() method synchronize itself again with the user interface thread and allows to update it. This method is called by the framework once the doInBackground() method finishes.To use AsyncTask you must subclass it. AsyncTask uses generics and varargs. The parameters are the following AsyncTask &lt;TypeOfVarArgParams , ProgressValue , ResultValue&gt; .TypeOfVarArgParams is passed into the doInBackground() method as input, ProgressValue is used for progress information and ResultValue must be returned from doInBackground() method and is passed toonPostExecute() as parameter.
  11. AsyncTask class encapsulates the creation of Threads and Handlers. An AsyncTask is started via the execute() method.The execute() method calls the doInBackground() and the onPostExecute() method.The doInBackground() method contains the coding instruction which should be performed in a background thread. This method runs automatically in a separate Thread.The onPostExecute() method synchronize itself again with the user interface thread and allows to update it. This method is called by the framework once the doInBackground() method finishes.To use AsyncTask you must subclass it. AsyncTask uses generics and varargs. The parameters are the following AsyncTask &lt;TypeOfVarArgParams , ProgressValue , ResultValue&gt; .TypeOfVarArgParams is passed into the doInBackground() method as input, ProgressValue is used for progress information and ResultValue must be returned from doInBackground() method and is passed toonPostExecute() as parameter.
  12. AsyncTask class encapsulates the creation of Threads and Handlers. An AsyncTask is started via the execute() method.The execute() method calls the doInBackground() and the onPostExecute() method.The doInBackground() method contains the coding instruction which should be performed in a background thread. This method runs automatically in a separate Thread.The onPostExecute() method synchronize itself again with the user interface thread and allows to update it. This method is called by the framework once the doInBackground() method finishes.To use AsyncTask you must subclass it. AsyncTask uses generics and varargs. The parameters are the following AsyncTask &lt;TypeOfVarArgParams , ProgressValue , ResultValue&gt; .TypeOfVarArgParams is passed into the doInBackground() method as input, ProgressValue is used for progress information and ResultValue must be returned from doInBackground() method and is passed toonPostExecute() as parameter.
  13. AsyncTask class encapsulates the creation of Threads and Handlers. An AsyncTask is started via the execute() method.The execute() method calls the doInBackground() and the onPostExecute() method.The doInBackground() method contains the coding instruction which should be performed in a background thread. This method runs automatically in a separate Thread.The onPostExecute() method synchronize itself again with the user interface thread and allows to update it. This method is called by the framework once the doInBackground() method finishes.To use AsyncTask you must subclass it. AsyncTask uses generics and varargs. The parameters are the following AsyncTask &lt;TypeOfVarArgParams , ProgressValue , ResultValue&gt; .TypeOfVarArgParams is passed into the doInBackground() method as input, ProgressValue is used for progress information and ResultValue must be returned from doInBackground() method and is passed toonPostExecute() as parameter.
  14. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  15. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.