Tampilkan postingan dengan label tutorial. Tampilkan semua postingan
Tampilkan postingan dengan label tutorial. Tampilkan semua postingan

Android Video Tutorial

Part 1

  1. Overview - Getting Started with Android - Download
    • Introduction
    • Installation and Configuration Step 1
    • Installation and Configuration Step 2
    • Installation and Configuration Step 3
  2. Build a Task Manager Application - Download
    • Create the add task view
    • Display a list of tasks
    • Homework and QA
    • Implement safe Canceling
    • Layout and build a task manager application
    • Sharing data across the task manager application
  3. Create a Task List - Download
    • Better list view
    • Completing tasks
    • Creating a list of tasks
    • Removing completed tasks
    • Showing the tasks
    • Wrap up homework and QA
  4. Add Persistence - Download
    • Adding new tasks to the database
    • Adding persistence to our task manager using SQLITE
    • Completing a task
    • Deleting Tasks
    • Loading tasks from the database
    • Wrap up homework and QA
  5. Add Location and Maps - Download (Part 1) and Download (Part 2)
    • Adding a location to a task
    • Adding location and maps to our task manger 
    • Displaying a map view
    • Returning the address to add task activity
    • Searching for an address and map overlays
    • Wrap up homework and QA
  6. Add location Awareness - Download
    • Adding location awareness to our task manager
    • Adding the devices current location to the map
    • Displaying the current location on the task list
    • Displaying the location of the task
    • Filtering the tasks by location
    • Saving the address on a task
    • Wrap up homework and QA

Part 2

  1. Overview - Build an Android Twitter Application - Download
    • Getting ready to Build a twitter application
    • O auth twitter authentication and QA
  2. Getting Authenticated with Twitter - Download
    • Becoming an oauth consumer
    • Example files
    • Introduction and review of oauth
    • Is the user authenticated
    • Loading twitters authentication page
    • Saving the access tokens
  3. Displaying Tweets and the Twitter public Timeline - Download
    • Example files
    • Introduction to loading tweets and threading
    • Loading newer tweets
    • Loading older tweets
    • Loading on a thread
    • Loading the twitter home timeline
    • Showing the status detail view
  4. Tweeting from your Application - Download
    • Example Files
    • Introduction to threads and tweets
    • Loading avatars with async task
    • Loading avatars  with threads
    • Loading tweets with async tasks
    • Navigating with a menu
    • Posting tweets
    • Wrap up homework and QA
  5. Adding Style to Your Application - Download
    • Creating a theme with colors and fonts
    • Example files
    • Introduction to skinning and styling your twitter application
    • Styling for different screens
    • Styling menus and buttons
    • Styling the text area and the list
  6. Posting Photos from your Application - Download
    • Attaching a photo from the camera
    • Attaching a photo from the library
    • Example files
    • Getting ready for photos
    • Introduction to posting your photos to twiiter
    • Posting a photo
    • Recap of course and QA
Read More..

Decorator design Pattern in Java with Example Java Tutorial

I was thinking to write on decorator design pattern in Java when I first wrote 10 interview questions on Singleton Pattern in Java. Since design pattern is quite important while building software and it’s equally important on any Core Java Interview, It’s always good to have clear understanding of various design patterns in Java. In this article we will explore and learn Decorator Design pattern in Java which is a prominent core Java design pattern and you can see lot of its example in JDK itself. JDK use decorator pattern in IO package where it has decorated Reader and Writer Classes for various scenario, for example BufferedReader and BufferedWriter are example of decorator design pattern in Java. From design perspective its also good idea to learn how existing things work inside JDK itself for example How HashMap works in Java or How SubString method work in Java, that will give you some idea of things you need to keep in mind while designing your Class or interface in Java. Now let’s Move on to Decorator pattern in Java.
Read more »
Read More..

10 Example of Hashtable in Java – Java Hashtable Tutorial

These Java hashtable Examples contains some of the frequently used operations on hastable in Java. when I discussed throw of How HashMap or Hashtable works in Java I touched based on inner working of hastable, while in this java hashtable tutorial we will see some examples of hashtable in Java like checking a key exits in hashmap or not or getting all keys and values from HashMap , Iterating on hashtable keys and values using Enumeration etc.
Read more »
Read More..

How to get environment variables in Java Example Tutorial

Environment variables in Java
There are two ways to get environment variable in Java, by using System properties or by using System.getEnv(). System properties provides only limited set of predefined environment variables like java.classpath, for retrieving Java Classpath or java.username  to get User Id which is used to run Java program etc but a more robust and platform independent way of getting environment variable in Java program on the other hand System.getEnv() method provide access to all environment variables inside Java program but subject to introduce platform dependency if program relies on a particular environment variable. System.getEnv() is overloaded method in Java API and if invoked without parameter it returns an unmodifiable String map which contains all environment variables and there values available to this Java process while System.getEnv(String name) returns value of environment variable if exists or null. In our earlier posts we have seen How to get current directory in Java and  How to run shell command from Java program and in this Java tutorial we will see how to access environment variable in Java.

How to get environment variables in Java - Example

How to get value of environment variable in Java - example tutorialHere is a quick example on How to get environment variable in Java using System.getEnv() and System.getProperty(). Remember System.getEnv() return String map of all environment variables while System.getEnv(String name) only return value of named environment variable like JAVA_HOME will return PATH of your JDK installation directory.

/**
 * Java program to demonstrate How to get value of environment variables in Java.
 * Dont confuse between System property and Environment variable and there is separate
 * way to get value of System property than environment variable in Java, as shown in this
 * example.
 *
 * @author Javin Paul
 */


public class EnvironmentVariableDemo {  

    public static void main(String args[]){
   
      //getting username using System.getProperty in Java
       String user = System.getProperty("user.name") ;
       System.out.println("Username using system property: "  + user);
   
     //getting username as environment variable in java, only works in windows
       String userWindows = System.getenv("USERNAME");
       System.out.println("Username using environment variable in windows : "  + userWindows);
   
     
     //name and value of all environment variable in Java  program
      Map<String, String> env = System.getenv();
        for (String envName : env.keySet()) {
            System.out.format("%s=%s%n", envName, env.get(envName));
        }

    }
     
}

Output:
Username using system property: harry
Username using environment variable in windows : harry
USERPROFILE=C:Documents and Settingsharry
JAVA_HOME=C:Program FilesJavajdk1.6.0_20
TEMP=C:DOCUME~1harryLOCALS~1Temp


Getting environment variable in Java – Things to remember
Java is platform independent language but there are many things which can make a Java program platform dependent e.g. using a native library. Since environment variables also vary from one platform to another e.g. from windows to Unix you need to be bit careful while directly accessing environment variable inside Java program. Here are few points which is worth noting :

1) Use system properties if value of environment variable is available via system property e.g. Username which is available using "user.name" system property. If you access it using environment variable directly you may need to ask for different variable as it may be different in Windows  e.g. USERNAME and Unix as USER.

2) Environment variables are case sensitive in Unix while case insensitive in Windows so relying on that can again make your Java program platform dependent.

3) System.getEnv() was deprecated in release JDK 1.3 in support of using System.getProperty() but reinstated again in JDK 1.5.

Thats all on how to get environment variable in Java. Though you have convenient method like System.getEnv() which can return value of environment variable, its better to use System.getProperty() to get that value in a platform independent way, if that environment variable is available as system property in Java.

Other How to tutorials from Javarevisited Blog
Read More..

Spring Framework Tutorial How to call Stored Procedures from Java using IN and OUT parameter example

Spring Framework provides excellent support to call stored procedures from Java application. In fact there are multiple ways to call stored procedure in Spring Framework, e.g. you can use one of the query() method from JdbcTemplate to call stored procedures, or you can extend abstract class StoredProcedure to call stored procedures from Java. In this Java Spring tutorial, we will see second approach to call stored procedure. It's more object oriented, but same time requires more coding. StoredProcedure class allows you to declare IN and OUT parameters and call stored procedure using its various execute() method, which has protected access and can only be called from sub class. I personally prefer to implement StoredProcedure class as Inner class, if its tied up with one of DAO Object, e.g. in this case it nicely fit inside EmployeeDAO. Then you can provide convenient method to wrap stored procedure calls. In order to demonstrate, how to call stored procedures from spring based application, we will first create a simple stored proc using MySQL database, as shown below.
Read more »
Read More..