In this post you will have to find how to get the all version details and date of creation of particular APK file.
So from that you can access the details of one of your app with other app.Its very easy to do this just follow the following steps.
Step 1) Add your apk(that you want the details) in your sdcard or the folder you want.
Step 2) Add the following code in your activity.
ZipFile zf;
final PackageManager pm = getPackageManager();
//Name of your apk file that you want details
String apkName = "yourappname.apk";
//Give it to the path of your apk file
String fullPath = Environment.getExternalStorageDirectory()
+ "/" + apkName;
PackageInfo info = pm.getPackageArchiveInfo(fullPath, 0);
try {
zf = new ZipFile(fullPath);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ZipEntry ze = zf.getEntry("classes.dex");
long time = ze.getTime();
String s = SimpleDateFormat.getInstance().format(
new java.util.Date(time));
Step 3)Just display your all details.
Toast.makeText(this,"VersionCode : " + info.versionCode + ",
VersionName : " + info.versionName + ",
App Creation Date : " + s,
Toast.LENGTH_LONG).show();
Thanks..Android rocks..:)
So from that you can access the details of one of your app with other app.Its very easy to do this just follow the following steps.
Step 1) Add your apk(that you want the details) in your sdcard or the folder you want.
Step 2) Add the following code in your activity.
ZipFile zf;
final PackageManager pm = getPackageManager();
//Name of your apk file that you want details
String apkName = "yourappname.apk";
//Give it to the path of your apk file
String fullPath = Environment.getExternalStorageDirectory()
+ "/" + apkName;
PackageInfo info = pm.getPackageArchiveInfo(fullPath, 0);
try {
zf = new ZipFile(fullPath);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ZipEntry ze = zf.getEntry("classes.dex");
long time = ze.getTime();
String s = SimpleDateFormat.getInstance().format(
new java.util.Date(time));
Step 3)Just display your all details.
Toast.makeText(this,"VersionCode : " + info.versionCode + ",
VersionName : " + info.versionName + ",
App Creation Date : " + s,
Toast.LENGTH_LONG).show();
Thanks..Android rocks..:)



Great Nilesh!!! Keep it Up!!!
ReplyDelete
ReplyDeleteThis is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
rpa Training in tambaram
blueprism Training in tambaram
automation anywhere training in tambaram
iot Training in tambaram
rpa training in sholinganallur
blue prism training in sholinganallur
automation anywhere training in sholinganallur
iot training in sholinganallur
Awesome post! Thanks for sharing this with us.
ReplyDeleteTally Course in Chennai | Tally Classes in Chennai | Tally Training in Chennai | Tally Course | Learn Tally | Tally Institute in Chennai | Learn Tally ERP 9 | Tally Training | Tally Training Institute in Chennai
Nice Article! Thanks for sharing such an informative blog! It really Inspired me, keep up the work.
ReplyDeletepython-full-stack-developer