Your SlideShare is downloading. ×
Android webinar class_4
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Android webinar class_4

347

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
347
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • 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 <TypeOfVarArgParams , ProgressValue , ResultValue> .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.
  • 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 <TypeOfVarArgParams , ProgressValue , ResultValue> .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.
  • 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 <TypeOfVarArgParams , ProgressValue , ResultValue> .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.
  • 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 <TypeOfVarArgParams , ProgressValue , ResultValue> .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.
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  • Transcript

    • 1. Storing Information on the device
    • 2. Internal Storage on the device• You can save files directly on the devices 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 youre using API Level 8 or greater, use getExternalCacheDir() to open a File• If youre using API Level 7 or lower, use getExternalStorageDirectory() to open a File
    • 6. Finding the File:
    • 7. Animation in Android
    • 8. Animation• There are two types of animations that you can do with the Animation framework of Android.• Class - android.view.animation.Animation1. Frame animation2. 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" />
    • 16. Async Task
    • 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 Samplepublic 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); }}
    • 20. Canvas
    • 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)
    • 22. Paint and Path
    • 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. PropertiesPaint Object Property Descriptionpaint.setAntiAlias(true); Makes the edges smooth.paint.setColor(Color.RED); Set the paints color.paint.setStyle(Paint.Style.STROKE); Set the paints style, It controls primitive geometrypaint.setStrokeJoin(Paint.Join.ROUND); Sets the paint’s join.paint.setStrokeWidth(15f); Set the width for stroking.Touch Event DescriptionMotionEvent.ACTION_DOWN When you touch the screenMotionEvent.ACTION_MOVE When you move your finger across the screenMotionEvent.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
    • 28. •Q & A..?

    ×