Java for Android Applications Programming
Java is a registered trade mark of Oracle
|
Objectives
- Master the concepts of Java
- Secure your Java applications exception handling language
- Control mechanism threads
- Control function call C / C + + Java programs via JNI
- Use collections of objects in Java
- Master the main utility classes in Java
- Optimize the Java code
|
This course is the prerequisite to our Android programming courses: |
|
Course environment
- A PC for two trainees with
- The JDK
- Eclipse development environment for Java applications
- Course material, printed (for face to face trainings) and in PDF format
- Exercises source code (with solutions)
Prerequisites
- Knowledge of a programming language like C or C + +
First Day
Introduction
- History of Java
- Features of Java
- Portability
- Security
- Robustness
- Simplicity
- Multithreading
- The JDK (Java Development Kit)
- The virtual machine
- The basics of JAVA
- Data types
- Operators
- Flow control
Exercise: |
Write the "Hello World" program in Java |
Object Programming in Java
- Classes
- Encapsulation
- Inheritance
- Polymorphism
- Interfaces
Exercise: |
Write a producer-consumer program in java (plant) |
- The nested classes and interfaces
- Internal Classes
- Anonymous Classes
- Typecasts and instanceof operator
- Packages: definition, import, search order
Exercise: |
Rewrite the plant using anonymous classes |
Advanced aspects
- Generics in Java
- Generic Classes (parameterized)
- Generic Methods
Exercise: |
Configuring the plant with generic types |
- Java exceptions
- Presentation of exceptions and their mechanism
- Capture and propagation of exceptions
- Exception classes
- Business exceptions
Exercise: |
Controlling the plant with exceptions |
Second Day
Multitask programming in Java
- What is a thread
- The Java threading API
- Inter-thread synchronization
- Thread scheduling
- Asynchronous communication between threads
Exercise: |
Create two plants working in parallel, the second consuming the products of the first |
Java utility classes
- Manipulating strings
- The String class
- The StringBuffer class
- Input/Output
- The java.io package
- Standard I/O read and write
- Reading and writing text files
Exercise: |
Write a program that reads a text file and print one word per line |
- Mathematical computations:
- Date management
- Environment access
- The System class
- The Runtime class
Exercise: |
Modify the program to sort the result (using the "sort" command) |
Data management in Java
- Collections
- The collection types and interfaces
- The collection abstract classes
- The implementation classes
- The Iterator interface
- Comparing and sorting objects
- Rational use of collections
Exercise: |
Rewrite the previous program to count the number of occurrences of each word and display the 10 most frequent |