PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile (earlier versions)
→
[WM20] Y-a-t'il moyen de récupérer la date de compilation de l'APK ?
[WM20] Y-a-t'il moyen de récupérer la date de compilation de l'APK ?
Started by Tan Trung, Nov., 20 2017 11:00 AM - 2 replies
Connect yourself…
Tan Trung
#1
Registered member
104 messages
Popularité : +1 (1 vote)
Posted on November, 20 2017 - 11:00 AM
Bonjour,
Existe-t'il sous WM20 une fonction qui retourne la date de compilation/génération de l'APK ?
Merci d'avance
--
NGUYEN Tan Trung
B. Rekencentra NV
Report
0
0
Philippe Pasquali
#2
Registered member
945 messages
Popularité : +102 (110 votes)
Posted on November, 23 2017 - 3:16 PM
Bonjour
Ce code devrait vous aider
import android.content.Context;
import java.util.zip.ZipFile;
import java.util.zip.ZipEntry;
public static String getAppTimeStamp()
{
String s = "";
try{
Context context = getContexteApplication();
ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), 0);
ZipFile zf = new ZipFile(ai.sourceDir);
ZipEntry ze = zf.getEntry("META-INF/MANIFEST.MF");
long time = ze.getTime();
SimpleDateFormat formatter = (SimpleDateFormat) SimpleDateFormat.getInstance();
formatter.setTimeZone(TimeZone.getTimeZone("gmt"));
s = formatter.format(new java.util.Date(time));
zf.close();
}catch(Exception e){
return s;
}
return s;
}
Report
1
0
Tan Trung
#3
Registered member
104 messages
Popularité : +1 (1 vote)
Posted on November, 24 2017 - 8:33 AM
Merci beaucoup Philippe, je vais essayer ça tout de suite.
--
NGUYEN Tan Trung
B. Rekencentra NV
Report
0
0
→ Go back to WINDEV Mobile (earlier versions)
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
WEBDEV (earlier versions)
WINDEV Mobile (earlier versions)
Reports & Queries
Off-topic
Tools
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text