Monday, June 8, 2015

Read Excel From Storage And Parse

Here is complete code by which we can read and parse excel file.

package pro.kondratev.androidreadxlsx;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Iterator;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;

import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.util.Log;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;


public class ReadXlsx extends Activity {

static final int BUF_SIZE = 8 * 1024;
protected EditText output;
protected String outputString;
protected Handler handler;
protected InputStream xlsxFileStream;
protected ProgressBar progress;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_read_xlsx);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); //Lock portrait orientation

//        readExcelFile(this, "/storage/sdcard0/Download/ExcelOrderFile.xls");
//        readExcelFile(this, "/storage/sdcard0/Download/ReligiousPack_DailyRevenueReport_June_2015.xls");
        readExcelFile(this, "/storage/sdcard0/Download/DailyReport_April_2015.xls");
       
       
    }

   
    private static void readExcelFile(Context context, String filename) {
   
        if (!isExternalStorageAvailable() || isExternalStorageReadOnly()) {
            Log.w("FileUtils", "Storage not available or read only");
            return;
        }

        try{
            // Creating Input Stream
            File file = new File(/*context.getExternalFilesDir(null),*/ filename);
            FileInputStream myInput = new FileInputStream(file);

            // Create a POIFSFileSystem object
            POIFSFileSystem myFileSystem = new POIFSFileSystem(myInput);

            // Create a workbook using the File System
            HSSFWorkbook myWorkBook = new HSSFWorkbook(myFileSystem);

            // Get the first sheet from workbook
            HSSFSheet mySheet = myWorkBook.getSheetAt(1);

            /** We now need something to iterate through the cells.**/
            Iterator<Row> rowIter = mySheet.rowIterator();

            while(rowIter.hasNext()){
                HSSFRow myRow = (HSSFRow) rowIter.next();
                Iterator<Cell> cellIter = myRow.cellIterator();
                while(cellIter.hasNext()){
                    HSSFCell myCell = (HSSFCell) cellIter.next();
                    Log.w("FileUtils", "Cell Value: " +  myCell.toString());
                    Toast.makeText(context, "cell Value: " + myCell.toString(), Toast.LENGTH_SHORT).show();
                }
            }
        }catch (Exception e){e.printStackTrace(); }

        return;
    }

    public static boolean isExternalStorageReadOnly() {
        String extStorageState = Environment.getExternalStorageState();
        if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(extStorageState)) {
            return true;
        }
        return false;
    }

    public static boolean isExternalStorageAvailable() {
        String extStorageState = Environment.getExternalStorageState();
        if (Environment.MEDIA_MOUNTED.equals(extStorageState)) {
            return true;
        }
        return false;
    }
}
   
   
Download source code here.

Reference: Googling

   


Friday, June 5, 2015

Read excel from a URL and Parse

Here is the code to read and parse excel file from url

ReadExcelFromUrlActivity.java

package com.example.readexcel;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;

import com.example.readexcelfromurl.R;

import android.app.Activity;
import android.widget.ArrayAdapter;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.widget.ListView;
import android.widget.Toast;
public class ReadExcelFromUrlActivity extends Activity {
private String LOG_TAG = "ReadExcelFromUrl";


ArrayList<ShoppingCart> shoppingCartList;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.main);

//URL path for the Excel file
String url = "http://demo.mysamplecode.com/Servlets_JSP/demoFiles/ExcelOrderFile.xls";
excelURL(url);

}

private void displayCart() {

//Array list of countries
List<String> myList = new ArrayList<String>();
for(int i = 0, l = shoppingCartList.size(); i < l; i++){
ShoppingCart shoppingCart = shoppingCartList.get(i);
String myData = shoppingCart.getItemNumber() + ": " +
shoppingCart.getDescription() + "\nPrice: $" +
shoppingCart.getPrice() + "\nQuantity: " +
shoppingCart.getQuantity();
myList.add(myData);
System.out.println("My data..................."+ myData);
}

//Display the Excel data in a ListView
// ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,
// R.layout.data_list, myList);
// ListView listView = (ListView) findViewById(R.id.listView1);
// listView.setAdapter(dataAdapter);


}

public void excelURL(String url) {
Log.v(LOG_TAG, url);
new ExcelURL().execute(url);
}

private class ExcelURL extends AsyncTask<String, Void, String> {
private static final int REGISTRATION_TIMEOUT = 3 * 1000;
private static final int WAIT_TIMEOUT = 30 * 1000;
private final HttpClient httpclient = new DefaultHttpClient();
final HttpParams params = httpclient.getParams();
HttpResponse response;
private String content = null;
private ProgressDialog dialog = new ProgressDialog(ReadExcelFromUrlActivity.this);

protected void onPreExecute() {
dialog.setMessage("Getting your data... Please wait...");
dialog.show();
}

protected String doInBackground(String... urls) {

String URL = null;

try {

URL = urls[0];
HttpConnectionParams.setConnectionTimeout(params, REGISTRATION_TIMEOUT);
HttpConnectionParams.setSoTimeout(params, WAIT_TIMEOUT);
ConnManagerParams.setTimeout(params, WAIT_TIMEOUT);

HttpGet httpGet = new HttpGet(URL);
response = httpclient.execute(httpGet);

StatusLine statusLine = response.getStatusLine();
if(statusLine.getStatusCode() == HttpStatus.SC_OK){
parseExcel(response.getEntity().getContent());
} else{
//Closes the connection.
Log.w("HTTP1:",statusLine.getReasonPhrase());
response.getEntity().getContent().close();
throw new IOException(statusLine.getReasonPhrase());
}
} catch (ClientProtocolException e) {
Log.w("HTTP2:",e );
content = e.getMessage();
cancel(true);
} catch (IOException e) {
Log.w("HTTP3:",e );
content = e.getMessage();
cancel(true);
}catch (Exception e) {
Log.w("HTTP4:",e );
content = e.getMessage();
cancel(true);
}

return content;
}

protected void onCancelled() {
dialog.dismiss();
Toast toast = Toast.makeText(ReadExcelFromUrlActivity.this,
"Error connecting to Server", Toast.LENGTH_LONG);
toast.setGravity(Gravity.TOP, 25, 400);
toast.show();

}

protected void onPostExecute(String content) {
dialog.dismiss();
displayCart();
}



private void parseExcel(InputStream fis){

shoppingCartList = new ArrayList<ShoppingCart>();

try{

// Create a workbook using the Input Stream
HSSFWorkbook myWorkBook = new HSSFWorkbook(fis);

// Get the first sheet from workbook
HSSFSheet mySheet = myWorkBook.getSheetAt(0);

// We now need something to iterate through the cells
Iterator<Row> rowIter = mySheet.rowIterator();
while(rowIter.hasNext()){

HSSFRow myRow = (HSSFRow) rowIter.next();
// Skip the first 2 rows
if(myRow.getRowNum() < 2) {
continue;
}

ShoppingCart shoppingCart = new ShoppingCart();

Iterator<Cell> cellIter = myRow.cellIterator();
while(cellIter.hasNext()){

HSSFCell myCell = (HSSFCell) cellIter.next();
String cellValue = "";

// Check for cell Type
if(myCell.getCellType() == HSSFCell.CELL_TYPE_STRING){
cellValue = myCell.getStringCellValue();
}
else {
cellValue = String.valueOf(myCell.getNumericCellValue());
}

// Just some log information
Log.v(LOG_TAG, cellValue);

// Push the parsed data in the Java Object
// Check for cell index
switch (myCell.getColumnIndex()) {
case 0:
shoppingCart.setItemNumber(cellValue);
break;
case 1:
shoppingCart.setDescription(cellValue);
break;
case 2:
shoppingCart.setPrice(Double.valueOf(cellValue));
break;
case 3:
shoppingCart.setQuantity(Double.valueOf(cellValue));
break;
default:
break;
}

}

// Add object to list
shoppingCartList.add(shoppingCart);
}
}
catch (Exception e){
e.printStackTrace();
}

}

}

}


ShoppingCart.java


package com.example.readexcel;


public class ShoppingCart {

String itemNumber = null;
String description = null;
Double price = null;
Double quantity = null;

public String getItemNumber() {
 return itemNumber;
}
public void setItemNumber(String itemNumber) {
 this.itemNumber = itemNumber;
}
public String getDescription() {
 return description;
}
public void setDescription(String description) {
 this.description = description;
}
public Double getPrice() {
 return price;
}
public void setPrice(Double price) {
 this.price = price;
}
public Double getQuantity() {
 return quantity;
}
public void setQuantity(Double quantity) {
 this.quantity = quantity;
}


}

Download full code here.

Reference:
http://www.mysamplecode.com/2012/08/android-read-excel-file-from-website.html



Receive Emails by java mail API Android


We can get email through IMAP (Internet Message Access Protocol) Protocol that makes a copy of all mails from your email id and you can get mail using it. Here is a little source code by which we can get email from any gmail id.


package com.example.reademaildemo;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import javax.mail.Address;
import javax.mail.BodyPart;
import javax.mail.Flags;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.NoSuchProviderException;
import javax.mail.Part;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Store;

import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;

public class EmailAttachmentReceiverActivity extends Activity {

Properties properties = null;
   private Session session = null;
   private Store store = null;
   private Folder inbox = null;
   private String userName = "";// provide user name
   private String password = "";// provide password
   String downloadDirectory = Environment.getExternalStorageState() + "/downloads/";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_email_attachment_receiver);
readMails();

/* Properties props = new Properties();
   //IMAPS protocol
   props.setProperty("mail.store.protocol", "imaps");
   //Set host address
   props.setProperty("mail.imaps.host", "imap.gmail.com");
   //Set specified port
   props.setProperty("mail.imaps.port", "993");
   //Using SSL
   props.setProperty("mail.imaps.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
   props.setProperty("mail.imaps.socketFactory.fallback", "false");
   //Setting IMAP session
   Session imapSession = Session.getInstance(props);
   
try {
Store store = imapSession.getStore("imaps");
//Connect to server by sending username and password.
//Example mailServer = imap.gmail.com, username = abc, password = abc
store.connect("imap.gmail.com", "email", "pass");     // put email and password here.........
//Get all mails in Inbox Forlder
Folder inbox = store.getFolder("Inbox");
inbox.open(Folder.READ_ONLY);
//Return result to array of message
Message[] result = inbox.getMessages();
Log.d("EMAILBYSHIVANG","here...");
Log.d("EMAILBYSHIVANG", "result.................."+result[0].getSubject());
Log.d("EMAILBYSHIVANG", "result.................."+result[0].getMessageNumber());
Log.d("EMAILBYSHIVANG", "result.................."+result[0].getDescription());
Log.d("EMAILBYSHIVANG", "result.................."+result[0].getReceivedDate());
Log.d("EMAILBYSHIVANG", "result.................."+result[0].getFileName());
Log.d("EMAILBYSHIVANG", "result.................."+result[result.length-1].getSubject());
Multipart mp = (Multipart) result[0].getContent();
            BodyPart bp = mp.getBodyPart(0);
            System.out.println("SENT DATE:" + result[0].getSentDate());
            System.out.println("SUBJECT:" + result[0].getSubject());
            System.out.println("CONTENT:" + bp.getContent());
} catch (Exception e) {
Log.d("EMAILBYSHIVANG","Exception........................");
e.printStackTrace();
}
*/ }
public void readMails() {
        properties = new Properties();
        properties.setProperty("mail.host", "imap.gmail.com");
        properties.setProperty("mail.port", "995");
        properties.setProperty("mail.transport.protocol", "imaps");
        session = Session.getInstance(properties,
                new javax.mail.Authenticator() {
                    protected PasswordAuthentication getPasswordAuthentication() {
                        return new PasswordAuthentication(userName, password);
                    }
                });
        try {
            store = session.getStore("imaps");
            store.connect();
            inbox = store.getFolder("INBOX");
            inbox.open(Folder.READ_ONLY);
//            Message messages[] = inbox.search(new FlagTerm(new Flags(Flag.SEEN), false));
            Message messages[] = inbox.getMessages();

            System.out.println("Shivang........Number of mails = ......................" + messages.length);
            for (int i = 0; i < messages.length; i++) {
                Message message = messages[i];
                Address[] from = message.getFrom();
                System.out.println("Shivang-------------------------------");
                System.out.println("Date : " + message.getSentDate());
                System.out.println("From : " + from[0]);
                System.out.println("Subject: " + message.getSubject());
                System.out.println("Content :");
                processMessageBody(message);
                System.out.println("--------------------------------");
            }
            inbox.close(true);
            store.close();
        } catch (NoSuchProviderException e) {
            e.printStackTrace();
        } catch (MessagingException e) {
            e.printStackTrace();
        }
}

    public void processMessageBody(Message message) {
        try {
            Object content = message.getContent();
            // check for string
            // then check for multipart
            if (content instanceof String) {
                System.out.println("String Content:....................."+content);
            } else if (content instanceof Multipart) {
            System.out.println("Multipart content...........................");
                Multipart multiPart = (Multipart) content;
                procesMultiPart(multiPart);
            } else if (content instanceof InputStream) {
            System.out.println("Input stream.................................");
                InputStream inStream = (InputStream) content;
                int ch;
                while ((ch = inStream.read()) != -1) {
                    System.out.write(ch);
          
                }
            }

        } catch (IOException e) {
            e.printStackTrace();
        } catch (MessagingException e) {
            e.printStackTrace();
        }
    }

 /*   public void procesMultiPart(Multipart content) {

        try {
            int multiPartCount = content.getCount();
            for (int i = 0; i < multiPartCount; i++) {
                BodyPart bodyPart = content.getBodyPart(i);
                Object o;

                o = bodyPart.getContent();
                if (o instanceof String) {
                    System.out.println(o);
                } else if (o instanceof Multipart) {
                    procesMultiPart((Multipart) o);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (MessagingException e) {
            e.printStackTrace();
        }

    }*/
    
    public void procesMultiPart(Multipart content) {
   
    System.out.println("Here to get attchment,.................................");
        try {
            for (int i = 0; i < content.getCount(); i++) {
                BodyPart bodyPart = content.getBodyPart(i);
                Object o;
                o = bodyPart.getContent();
                if (o instanceof String) {
                    System.out.println("Text............................... = " + o);
                } else if (null != bodyPart.getDisposition()
                        && bodyPart.getDisposition().equalsIgnoreCase(Part.ATTACHMENT)) {
                   
                    System.out.println("Saving Attached Doc.............................................");

               
                String fileName = bodyPart.getFileName();
                    System.out.println("fileName = " + fileName);
                    InputStream inStream = bodyPart.getInputStream();
                    
                    
                    System.out.println("Saving Attached Doc.............................................");
                    
//                    String root = getFilesDir().getAbsolutePath();
            String root = Environment.getExternalStorageDirectory().toString();
            File myDir = new File(root + "/EmailTestFolder");    
            myDir.mkdirs();
           
            File file = new File (myDir, fileName);
            if (file.exists ()) file.delete (); 
            /*try {
            FileOutputStream out = new FileOutputStream(file);
//             bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
            out.flush();
            out.close();
            } catch (Exception e) {
            e.printStackTrace();
//             CommonsObjects.logger.log("Exception when save Bitmap to Sd Card", e);
            }
            }*/
                    
                FileOutputStream outStream = new FileOutputStream(file);
                    
//                    FileOutputStream outStream = new FileOutputStream(new File(
//                            downloadDirectory + fileName));
                    byte[] tempBuffer = new byte[4096];// 4 KB
                    int numRead;
                    while ((numRead = inStream.read(tempBuffer)) != -1) {
                        outStream.write(tempBuffer);
                    }
                    inStream.close();
                    outStream.close();
                }
                // else?
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (MessagingException e) {
            e.printStackTrace();
        }
    }
    
    
    public void closeSession() {
        if (null != inbox && null != store) {
            try {
                inbox.close(true);
                store.close();
            } catch (MessagingException e) {
                e.printStackTrace();
            }
        }
    }
    public void deleteMessage(Message message) {
        try {
            message.setFlag(Flags.Flag.DELETED, true);
            System.out.println("deleted mail");
        } catch (MessagingException e) {
            e.printStackTrace();
        }
    }
}

Android Permissions Required:

<uses-permission android:name="com.google.android.gm.permission.READ_GMAIL"/>
<uses-permission android:name="com.google.android.gm.permission.WRITE_GMAIL"/>
<uses-permission android:name="com.google.android.gm.permission.MailProvider"/>
<uses-permission android:name="android.permission.INTERNET"/>
  
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />


Download complete demo project from here.

Reference: Googling.




Friday, May 29, 2015

JNI (Java Native Interface)

The Java Native Interface (JNI) is a Java layer that allows Java code running in the Java Virtual Machine (JVM) to call and be called by native applications and libraries written in other languages, such as C, C++, and assembly. Developers use the JNI to write native methods to handle situations when an application cannot be written entirely in Java, such as when the standard Java class library does not support the platform-dependent features or program library. It is also used to modify an existing application, written in another programming language, to be accessible to Java applications.
Many of the standard library classes depend on the JNI to provide functionality to the developer and the user, e.g., I/O file reading and sound capabilities. The inclusion of performance- and platform-sensitive API implementations in the standard library allows all Java applications to access this functionality in a safe and platform-independent manner. Before resorting to using the JNI, developers should make sure the functionality is not already provided in the standard libraries. In this introductory article, I will cover how the JNI works and how native types are mapped to Java types and classes.

How the JNI works

In the JNI, native functions are implemented in a separate .c or .cpp file. (C++ provides a slightly cleaner interface with the JNI.) When the JVM invokes the function, it passes a JNIEnv pointer, a jobject pointer, and any Java arguments declared by the Java method. A JNI function may look like this:
JNIEXPORT void JNICALL Java_ClassName_MethodName
  (JNIEnv *env, jobjectobj)

{
    //Method native implemenation

}
The env pointer is a structure that contains the interface to the JVM. It includes all of the functions necessary to interact with the JVM and to work with Java objects. Example JNI functions are converting native arrays to and from Java arrays, converting native strings to and from Java strings, instantiating objects, throwing exceptions, etc. Basically, you can use JNIEnv to do anything that Java does, albeit with considerably less ease.
To be more formal, native code accesses JVM features by calling JNI functions, which are available through an interfacepointer (this is a pointer to a pointer). This pointer points to an array of pointers, each of which points to an interface function. Every interface function is at a predefined offset inside the array. Native methods receive the JNI interface pointer as an argument. The JVM is guaranteed to pass the same interface pointer to a native method when it makes multiple calls to the native method from the same Java thread. However, a native method can be called from different Java threads, and therefore may receive different JNI interface pointers.
Native methods are loaded with the System.loadLibrary method. In the following example, the class initialization method loads a platform-specific native library in which the native method f is defined:
packagepkg;  

class Cls { 
     native double f(inti, String s); 
     static { 
         System.loadLibrary(pkg_Cls"); 
     } 

}
The argument to System.loadLibrary is a library name chosen arbitrarily by the programmer. The system follows a standard, platform-specific approach to convert the library name to a native library name. For example, a Solaris system converts the name pkg_Cls to libpkg_Cls.so, while a Win32 system converts the same pkg_Cls name to pkg_Cls.dll.
Dynamic linkers resolve entries based on their names. A native method name is concatenated from components, which include: the prefix Java_, a mangled fully-qualified class name, and a mangled method name.
Note: Microsoft's implementation of a JVM has a similar mechanism for calling native Windows code from Java called the Raw Native Interface (RNI).

* Dynamic Linker : In computing, a dynamic linker is the part of an operating system that loads and links the shared libraries needed by an executable when it is executed (at "run time"), by copying the content of libraries from persistent storage to RAM, and filling jump tables and relocating pointers. The specific operating system and executable format determine how the dynamic linker functions and how it is implemented.
Linking is often referred to as a process that is performed when the executable is compiled, while a dynamic linker is a special part of an operating system that loads external shared libraries into a running process and then binds those shared libraries dynamically to the running process. This approach is also called dynamic linking or late linking.

* Jump Table : In computer programming, a branch table or jump table is a method of transferring program control (branching) to another part of a program (or a different program that may have been dynamically loaded) using a table of branch or jump instructions.

Data type mapping

Primitive types, such as integers, characters, and so on, are copied between Java and native code. Arbitrary Java objects, on the other hand, are passed by reference.
This table shows the mapping of types between Java and native code. These types are interchangeable. You can use jint where you normally use an int, and vice-versa without any typecasting required. However, mapping between Java Strings and arrays to native strings and arrays is different. If you use a jstring where a char * would be, your code could crash the JVM. This is an example of how you should work correctly with strings:
JNIEXPORT void JNICALL Java_ClassName_MethodName
  (JNIEnv *env, jobjectobj, jstringjavaString)

{
    //Get the native string from Java string
    const char *nativeString = env->GetStringUTFChars(env,javaString, 0);
    printf("%s", nativeString);
    env->ReleaseStringUTFChars(env,javaString, nativeString);

}
You always manipulate Java objects using the interface pointer env.

Thursday, May 28, 2015

Apache™ Subversion®

            
              Apache Subversion (often abbreviated SVN, after the command name svn) is a software versioning and revision control system distributed as free software under the Apache License. Developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly compatible successor to the widely used Concurrent Versions System (CVS).             


             Subversion is an open source version control system. Founded in 2000 by CollabNet, Inc., the Subversion project and software have seen incredible success over the past decade. Subversion has enjoyed and continues to enjoy widespread adoption in both the open source arena and the corporate world. Subversion is developed as a project of the Apache Software Foundation, and as such is part of a rich community of developers and users. We're always in need of individuals with a wide range of skills, and we invite you to participate in the development of Apache Subversion.

Version Control System (VCS) is a software that helps software developers to work together and maintain a complete history of their work.
Following are the goals of a Version Control System.
  • Allow developers to work simultaneously.
  • Do not overwrite each other’s changes.
  • Maintain history of every version of everything.
A VCS is divided into two categories.
  • Centralized Version Control System (CVCS), and
  • Distributed/Decentralized Version Control System (DVCS).
In this tutorial, we will concentrate only on the Centralized Version Control System and especially Subversion. Subversion falls under centralized version control system, meaning that it uses central server to store all files and enables team collaboration.

Version Control Terminologies

Let us start by discussing some of the terms that we will be using in this tutorial.
  • Repository: A repository is the heart of any version control system. It is the central place where developers store all their work. Repository not only stores files but also the history. Repository is accessed over a network, acting as a server and version control tool acting as a client. Clients can connect to the repository, and then they can store/retrieve their changes to/from repository. By storing changes, a client makes these changes available to other people and by retrieving changes, a client takes other people's changes as a working copy.
  • Trunk: The trunk is a directory where all the main development happens and is usually checked out by developers to work on the project.
  • Tags : The tags directory is used to store named snapshots of the project. Tag operation allows to give descriptive and memorable names to specific version in the repository.
    For example, LAST_STABLE_CODE_BEFORE_EMAIL_SUPPORT is more memorable than
    Repository UUID: 7ceef8cb-3799-40dd-a067-c216ec2e5247 and
    Revision: 13
  • Branches: Branch operation is used to create another line of development. It is useful when you want your development process to fork off into two different directions. For example, when you release version 5.0, you might want to create a branch so that development of 6.0 features can be kept separate from 5.0 bug-fixes.
  • Working copy: Working copy is a snapshot of the repository. The repository is shared by all the teams, but people do not modify it directly. Instead each developer checks out the working copy. The working copy is a private workplace where developers can do their work remaining isolated from the rest of the team.
  • Commit changes: Commit is a process of storing changes from private workplace to central server. After commit, changes are made available to all the team. Other developers can retrieve these changes by updating their working copy. Commit is an atomic operation. Either the whole commit succeeds or is rolled back. Users never see half finished commit.


Reference link: 
http://en.wikipedia.org/wiki/Apache_Subversion
http://www.tutorialspoint.com/svn/svn_basic_concepts.htm

Friday, May 22, 2015

Visual voicemail

                 
                Visual voicemail is random-access voicemail with a visual interface. Such an interface presents a list of messages for playback and may include a transcript of each message. In 2007, Apple's iPhone was the first cell phone promoting this feature. Since then, several companies in the telecommunications space have integrated a visual element into their voicemail services, as Samsung's Instinct and the BlackBerry Storm and Torch.

               In 2007, YouMail was the first third-party, multi-platform visual voicemail service for mobile phones, storing voice mail in the cloud rather than the mobile carrier's network, and providing access to it through any web browser or by e-mail. In 2009, YouMail was the first to then extend this to also provide this functionality with an app for the BlackBerry, iPhone, and Android platforms, and an API that allowed others to build clients for Windows Phone 7 and WebOS.

              There are two options for managing voicemail on your LTE Android Smartphone: AT&T Basic Voicemail or Visual Voicemail.
  • Basic Voicemail: Basic voicemail is the standard voicemail answering service that is available on all AT&T wireless phones, and can be accessed even after setting up Visual Voicemail. Basic Voicemail allows you to dial into your voicemail box, and follow the voice prompts to listen to or manage voice messages. For additional information.
      
  • Visual Voicemail: Visual Voicemail allows you to play and manage your voicemail messages from an on-screen inbox, just as you would with an email account. Visual Voicemail is offered for select 4G LTE Android smartphones either as a free downloadable app, or a built-in application. 

             Visual voicemail, like traditional voicemail, forwards your unanswered calls to a voicemail box. Unlike traditional voicemail, the voicemails are delivered to your phone over the data network as a sound file. Because it is stored as a file on your phone, you can listen to your voicemail at any time once it has been downloaded. You can select an individual message to listen to without having to listen to all of your other new messages first.


Visual Voicemail App Screenshots 
 
  
                  Visual voicemail is a relatively new voicemail technology when compared with traditional phone based voicemail systems. In a few words: visual voicemail is a way to listen and interact with your voicemails through a graphical interface. VVM was first heavily publicised in 2007 with the release of the iPhone 2G which contained a native client to handle visual voicemail systems.

                   Being able to access your voicemail visually without the need of all the extra prompts and annoyances striked great support and today visual voicemail exists in most carriers around the world. However the introduction of visual voicemail in itself created a whole new surface area which could be targeted to gain access to someones voicemail.
                 
                   Under the hood, when visual voicemail is used, the visual voicemail client connects to an IMAP server in the background. The authentication process is done fairly seemlessly, and most of the times, no pin prompt is required.

                   Any voicemails ever left via the phone to you are then forwarded to the inbox of your personal email-like account and a two way relationship is formed. Actions made through visual voicemail are forwarded on to reflect changes on legacy voicemail servers.




Referance Link:
http://en.wikipedia.org/wiki/Visual_voicemail
https://support.solavei.com/en/mobile-service/visual-voicemail
http://www.att.com/devicehowto/index.jsp?id=stepbystep_KB419752&make=Samsung&model=GalaxyS5G900A
http://shubh.am/breaking-international-voicemail-security-via-vvm-exploitation/

Thursday, May 21, 2015

Augmented Reality 

                   Augmented reality (AR) is a live direct or indirect view of a physical, real-world environment whose elements are augmented (or supplemented) by computer-generated sensory input such as sound, video, graphics or GPS data. It is related to a more general concept called mediated reality, in which a view of reality is modified (possibly even diminished rather than augmented) by a computer. As a result, the technology functions by enhancing one’s current perception of reality. By contrast, virtual reality replaces the real world with a simulated one. Augmentation is conventionally in real-time and in semantic context with environmental elements, such as sports scores on TV during a match. With the help of advanced AR technology (e.g. adding computer vision and object recognition) the information about the surrounding real world of the user becomes interactive and digitally manipulable. Artificial information about the environment and its objects can be overlaid on the real world.


AndAR - Android Augmented Reality

AndAR is a project that enables Augmented Reality on the Android platform. The whole project is released under the GNU General Public License. This means you can freely use it in any of your projects, as long as you license them under the same license, this means the GPL. As it is a Open Source project any code contributions from you are welcome. ARToolworks offers commercial licensing for the underlying ARToolKit.


Download sample android app here.
Source code here.


Reference Link:
http://en.wikipedia.org/wiki/Augmented_reality
http://code.google.com/p/andar/