Android自己主动升级框架

使用

package com.ydl.versionupdate;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.Menu;
import com.ydl.appupdate.NewVersion;

public class MainActivity extends Activity {
	private Context context = this;
	private String downloadPath = "http://192.168.0.116:8080/";
	private String appVsrsion = "android_version.json";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		try {
			 new NewVersion(context, downloadPath,
						appVsrsion).checkUpdateVersion();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {

		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
}

serverjson文件内容


相关文章:

  • 2021-11-22
  • 2021-12-07
  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
  • 2022-02-22
  • 2021-11-27
  • 2022-01-01
猜你喜欢
  • 2022-12-23
  • 2021-11-23
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-07-27
相关资源
相似解决方案