Back to project page twawm2.
The source code is released under:
Copyright (c) 2014, afnf All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistr...
If you think the Android project twawm2 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.appspot.afnf4199ga.wmgraph.app; /* w ww. j a v a 2 s . c o m*/ import java.text.SimpleDateFormat; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import android.app.Activity; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.os.Bundle; import android.widget.TextView; import com.appspot.afnf4199ga.utils.Logger; import com.appspot.afnf4199ga.wmgraph.R; public class InfoActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_info); try { PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0); TextView appVerText = (TextView) findViewById(R.id.appVerText); appVerText.setText(getString(R.string.app_version) + packageInfo.versionName); } catch (Throwable e) { Logger.w("getPackageInfo failed", e); } try { ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), 0); ZipFile zf = new ZipFile(ai.sourceDir); ZipEntry ze = zf.getEntry("classes.dex"); long time = ze.getTime(); String buildDate = "BuildDate : " + SimpleDateFormat.getDateTimeInstance().format(new java.util.Date(time)); ((TextView) findViewById(R.id.buildDate)).setText(buildDate); } catch (Exception e) { Logger.w("getBuildDate failed", e); } } }