0

I want to get last installed package when every package installed in the device.I can get the list of all packages installed in my device,Now how can I extract the last installed package only??

2 Answers 2

0

I thing you get the package name and then get the corresponding installing time use the below code,

long installed = context
.getPackageManager()
.getPackageInfo("package.name", 0)
.firstInstallTime
 ;

Then stored that the installination time in arraylist, and then the installation time changed to the seconds, and then compare the current time vs the apps installation time.which one apps installion time get minimum ,that is your latest installed apps.

0

It may help you firstInstallTime (Added in API level 9)

The time at which the app was first installed. Units are as per currentTimeMillis().

long installedTime = context.getPackageManager().getPackageInfo("package.name", 0).firstInstallTime;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.