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.
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.
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.
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.