Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.InputStream;

import java.util.Properties;

import android.content.Context;

import android.util.Log;

public class Main {
    private static final String TAG = "Util";

    private static String getVerNameFromAssert(Context context) {

        String versionName = "";
        try {
            Properties pro = new Properties();
            InputStream is = context.getAssets().open("channel.properties");
            pro.load(is);
            String tmpVersionName = pro.getProperty("versionName");

            versionName = new String(tmpVersionName.getBytes("ISO-8859-1"), "UTF-8");

            is.close();
            is = null;
        } catch (Exception e) {
            versionName = "";
            Log.e(TAG, "AppConfig.loadVersion have Exception e = " + e.getMessage());
        }
        return versionName;

    }
}