Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.os.Build;

public class Main {
    /**
     * This method retrieve Serial number of the device,
     * Only if android.os.Build.VERSION.SDK is greater or equal android API Level 9
     *    
     * @return    Serial Number address
     */
    public static String getSerialNumber() {
        String serialNum = "";
        if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
            serialNum = Build.SERIAL;
        }
        return serialNum;
    }
}