How to get date time and device id from BlackBerry device programatically Java

These are very basic things in mobile development. but its very useful to keep them documented.First we will see how to get date time
public static String  getCurrentDateTime()
    {
    SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss aaa");
    return dateFormat.format(new Date(System.currentTimeMillis()));

    }

Then we will see how to get device id from device 
net.rim.device.api.system.DeviceInfo.getDeviceId()

No comments:

Post a Comment

Empowering the Future of API Management: Unveiling the Journey of WSO2 API Platform for Kubernetes (APK) Project and the Anticipated Alpha Release

  Introduction In the ever-evolving realm of API management, our journey embarked on the APK project eight months ago, and now, with great a...