Android Open Source - pdsql Application Util






From Project

Back to project page pdsql.

License

The source code is released under:

Apache License

If you think the Android project pdsql listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.piscessera.pdsql.utils;
//from ww w .j a  v  a 2s . c o  m
import android.content.Context;

public class ApplicationUtil {
  public static int getAppVersionCode(Context ctx) {
    int result = -1;

    try {
      String pkg = ctx.getPackageName();
      result = ctx.getPackageManager().getPackageInfo(pkg, 0).versionCode;
    } catch (Exception e) {
      e.printStackTrace();
    }

    return result;
  }

  public static String getAppVersionName(Context ctx) {
    String result = "?";

    try {
      String pkg = ctx.getPackageName();
      result = ctx.getPackageManager().getPackageInfo(pkg, 0).versionName;
    } catch (Exception e) {
      e.printStackTrace();
    }

    return result;
  }
}




Java Source Code List

com.piscessera.pdsql.DatabaseContentValuesUtil.java
com.piscessera.pdsql.DatabaseCore.java
com.piscessera.pdsql.DatabaseCursorUtil.java
com.piscessera.pdsql.Dsql.java
com.piscessera.pdsql.GenericBase.java
com.piscessera.pdsql.utils.ApplicationUtil.java
com.piscessera.pdsql.utils.DateUtil.java
com.piscessera.pdsql.utils.DebugUtil.java
com.piscessera.pdsql.utils.FileUtil.java