Reputation: 27
I am beginner in android programming and I am developing an app in android where I want to save time and date when an app start. Are there any libraries , which will help me implement my idea?
Upvotes: 0
Views: 761
Reputation: 2883
you can get time by using below code
Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("dd:MMMM:yyyy HH:mm:ss a");
String strDate = sdf.format(c.getTime());
what you can do is when your app is installed then run that code and save that strDate in database or in sharedprefs and later on you can get that.
above is when you want to save time when you install your own application, and if you want to know that whenever an app is installed and you want to save the start time of that app then have a look at below link that might help you.
How to detect new apps in an Android device
Upvotes: 1