【问题标题】:With Android how to get the last modified timestamp of a file in Java?使用Android如何获取Java文件的最后修改时间戳?
【发布时间】:2020-01-12 04:28:03
【问题描述】:

在我的 Android 应用程序中,我需要显示程序的最后修改时间戳,所以如果我在一个应用程序中有 3 个类文件,我想获取每个文件的最后修改时间戳,并使用最新的一个作为时间戳对于应用程序,因此我不必手动将其硬编码到我的应用程序中,有什么好方法可以获取该信息?我问的原因是:

[1] The java file may not be packaged with the apk file, only class files are in it. How to get time stamp of the class files ?
[2] When an apk file is copied/downloaded from one place to another, do the time stamp of the class files change ?

【问题讨论】:

    标签: android timestamp .class-file


    【解决方案1】:

    您也许可以挖掘 APK 文件。见this question

    对于第二个问题,复制时时间戳不会改变,因为 APK 文件基本上只是一个重命名的 ZIP 文件。

    【讨论】:

      【解决方案2】:

      您的应用程序是单个文件 - 一个 apk 文件。其中的各个类不是单独的文件,因此它们没有时间戳。您将需要找到另一个解决方案。

      【讨论】:

        猜你喜欢
        • 2023-03-08
        • 1970-01-01
        • 1970-01-01
        • 2011-01-04
        • 1970-01-01
        • 2021-04-30
        • 1970-01-01
        • 1970-01-01
        • 2010-10-05
        相关资源
        最近更新 更多