Android Open Source - foxail_reader Common Util






From Project

Back to project page foxail_reader.

License

The source code is released under:

GNU General Public License

If you think the Android project foxail_reader 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 org.foxail.android.common;
//www .jav  a 2  s .c  om
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;

public class CommonUtil {
  
  public final static String MAIN_PACKAGE_NAME = "org.foxail.android.reader";
  
  /**
   * ????????versionCode
   * 
   * @param context
   * @return
   */
  public static int getVerCode(Context context) {
        int verCode = -1;
        try {
            verCode = context.getPackageManager().getPackageInfo(MAIN_PACKAGE_NAME, 0).versionCode;
        } catch (NameNotFoundException e) {
          e.printStackTrace();
        }
        return verCode;
    }
    
  /**
   * ????????versionName
   * 
   * @param context
   * @return
   */
    public static String getVerName(Context context) {
        String verName = "";
        try {
            verName = context.getPackageManager().getPackageInfo(MAIN_PACKAGE_NAME, 0).versionName;
        } catch (NameNotFoundException e) {
          e.printStackTrace();
        }
        return verName;
    }
}




Java Source Code List

org.foxail.android.common.CommonUtil.java
org.foxail.android.common.http.ConnectionManager.java
org.foxail.android.common.http.HttpConnection.java
org.foxail.android.common.volley.HtmlRequest.java
org.foxail.android.reader.activity.BaseActivity.java
org.foxail.android.reader.activity.FavoritesActivity.java
org.foxail.android.reader.activity.MainActivity.java
org.foxail.android.reader.activity.NewsActivity.java
org.foxail.android.reader.client.ClientFactory.java
org.foxail.android.reader.client.Client.java
org.foxail.android.reader.client.CnBetaClient.java
org.foxail.android.reader.model.News.java