app检查更新代码在哪里|ipad软件更新在哪里看

|

⑴ android 怎么检查新版本并且更新

一、准备1.检测当前版本的信息AndroidManifest.xml–>manifest–>android:versionName。2.从服务器获取版本号(版本号存在于xml文件中)并与当前检测到的版本进行匹配,如果不匹配,提示用户进行升级,如果匹配则进入程序主界面。3.当提示用户进行版本升级时,如果用户点击了确定,系统将自动从服务器上下载并进行自动升级,如果点击取消将进入程序主界面。二、效果图三、必要说明服务器端存储apk文件,同时有version.xml文件便于比对更新。<?xml version="1.0" encoding="utf-8"?><info><version>2.0</version><url>http://192.168.1.187:8080/mobilesafe.apk</url><description>检测到最新版本,请及时更新!</description><url_server>http://192.168.1.99/version.xml</url_server></info>通过一个实体类获取上述信息。package com.android;public class UpdataInfo {private String version;private String url;private String description;private String url_server;public String getUrl_server() {return url_server;}public void setUrl_server(String url_server) {this.url_server = url_server;}public String getVersion() {return version;}public void setVersion(String version) {this.version = version;}public String getUrl() {return url;}public void setUrl(String url) {this.url = url;}public String getDescription() {return description;}public void setDescription(String description) {this.description = description;}}apk和版本信息地址都放在服务器端的version.xml里比较方便,当然如果服务器端不变动,apk地址可以放在strings.xml里,不过版本号信息是新的,必须放在服务器端,xml地址放在strings.xml。<?xml version="1.0" encoding="utf-8"?><resources><string name="hello">Hello World, VersionActivity!</string><string name="app_name">Version</string><string name="url_server">http://192.168.1.99/version.xml</string></resources>不知道读者发现没有,笔者犯了个错误,那就是url_server地址必须放在本地,否则怎么读取version.xml,所以url_server不必在实体类和version里添加,毕竟是现需要version地址也就是url_server,才能够读取version。三、代码实现<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical" ><Buttonandroid:id="@+id/btn_getVersion"android:text="检查更新"android:layout_width="wrap_content"android:layout_height="wrap_content"/></LinearLayout>package com.android;import java.io.InputStream;import org.xmlpull.v1.XmlPullParser;import android.util.Xml;public class UpdataInfoParser {public static UpdataInfo getUpdataInfo(InputStream is) throws Exception{XmlPullParser parser = Xml.newPullParser();parser.setInput(is, "utf-8");int type = parser.getEventType();UpdataInfo info = new UpdataInfo();while(type != XmlPullParser.END_DOCUMENT ){switch (type) {case XmlPullParser.START_TAG:if("version".equals(parser.getName())){info.setVersion(parser.nextText());}else if ("url".equals(parser.getName())){info.setUrl(parser.nextText());}else if ("description".equals(parser.getName())){info.setDescription(parser.nextText());}break;}type = parser.next();}return info;}}package com.android;import java.io.File;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import android.app.Activity;import android.app.AlertDialog;import android.app.AlertDialog.Builder;import android.app.ProgressDialog;import android.content.DialogInterface;import android.content.Intent;import android.content.pm.PackageInfo;import android.content.pm.PackageManager;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.os.Handler;import android.os.Message;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;import android.widget.Toast;public class VersionActivity extends Activity {private final String TAG = this.getClass().getName();private final int UPDATA_NONEED = 0;private final int UPDATA_CLIENT = 1;private final int GET_UNDATAINFO_ERROR = 2;private final int SDCARD_NOMOUNTED = 3;private final int DOWN_ERROR = 4;private Button getVersion;private UpdataInfo info;private String localVersion;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);getVersion = (Button) findViewById(R.id.btn_getVersion);getVersion.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {try {localVersion = getVersionName();CheckVersionTask cv = new CheckVersionTask();new Thread(cv).start();} catch (Exception e) {// TODO Auto-generated catch blocke.printStackTrace();}}});}private String getVersionName() throws Exception {//getPackageName()是你当前类的包名,0代表是获取版本信息PackageManager packageManager = getPackageManager();PackageInfo packInfo = packageManager.getPackageInfo(getPackageName(),0);return packInfo.versionName;}public class CheckVersionTask implements Runnable {InputStream is;public void run() {try {String path = getResources().getString(R.string.url_server);URL url = new URL(path);HttpURLConnection conn = (HttpURLConnection) url.openConnection();conn.setConnectTimeout(5000);conn.setRequestMethod("GET");int responseCode = conn.getResponseCode();if (responseCode == 200) {// 从服务器获得一个输入流is = conn.getInputStream();}info = UpdataInfoParser.getUpdataInfo(is);if (info.getVersion().equals(localVersion)) {Log.i(TAG, "版本号相同");Message msg = new Message();msg.what = UPDATA_NONEED;handler.sendMessage(msg);// LoginMain();} else {Log.i(TAG, "版本号不相同 ");Message msg = new Message();msg.what = UPDATA_CLIENT;handler.sendMessage(msg);}} catch (Exception e) {Message msg = new Message();msg.what = GET_UNDATAINFO_ERROR;handler.sendMessage(msg);e.printStackTrace();}}}Handler handler = new Handler() {@Overridepublic void handleMessage(Message msg) {// TODO Auto-generated method stubsuper.handleMessage(msg);switch (msg.what) {case UPDATA_NONEED:Toast.makeText(getApplicationContext(), "不需要更新",Toast.LENGTH_SHORT).show();case UPDATA_CLIENT://对话框通知用户升级程序showUpdataDialog();break;case GET_UNDATAINFO_ERROR://服务器超时Toast.makeText(getApplicationContext(), "获取服务器更新信息失败", 1).show();break;case DOWN_ERROR://下载apk失败Toast.makeText(getApplicationContext(), "下载新版本失败", 1).show();break;}}};/*** 弹出对话框通知用户更新程序** 弹出对话框的步骤:* 1.创建alertDialog的builder.* 2.要给builder设置属性, 对话框的内容,样式,按钮* 3.通过builder 创建一个对话框* 4.对话框show()出来*/protected void showUpdataDialog() {AlertDialog.Builder builer = new Builder(this);builer.setTitle("版本升级");builer.setMessage(info.getDescription());//当点确定按钮时从服务器上下载 新的apk 然后安装 װbuiler.setPositiveButton("确定", new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int which) {Log.i(TAG, "下载apk,更新");downLoadApk();}});builer.setNegativeButton("取消", new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int which) {// TODO Auto-generated method stub//do sth}});AlertDialog dialog = builer.create();dialog.show();}/** 从服务器中下载APK*/protected void downLoadApk() {final ProgressDialog pd; //进度条对话框pd = new ProgressDialog(this);pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);pd.setMessage("正在下载更新");pd.show();new Thread(){@Overridepublic void run() {try {File file = DownLoadManager.getFileFromServer(info.getUrl(), pd);sleep(3000);installApk(file);pd.dismiss(); //结束掉进度条对话框} catch (Exception e) {Message msg = new Message();msg.what = DOWN_ERROR;handler.sendMessage(msg);e.printStackTrace();}}}.start();}//安装apkprotected void installApk(File file) {Intent intent = new Intent();//执行动作intent.setAction(Intent.ACTION_VIEW);//执行的数据类型intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");startActivity(intent);}}package com.android;import java.io.BufferedInputStream;import java.io.File;import java.io.FileOutputStream;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import android.app.ProgressDialog;import android.os.Environment;public class DownLoadManager {public static File getFileFromServer(String path, ProgressDialog pd) throws Exception{//如果相等的话表示当前的sdcard挂载在手机上并且是可用的if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){URL url = new URL(path);HttpURLConnection conn = (HttpURLConnection) url.openConnection();conn.setConnectTimeout(5000);//获取到文件的大小pd.setMax(conn.getContentLength());InputStream is = conn.getInputStream();File file = new File(Environment.getExternalStorageDirectory(), "updata.apk");FileOutputStream fos = new FileOutputStream(file);BufferedInputStream bis = new BufferedInputStream(is);byte[] buffer = new byte[1024];int len ;int total=0;while((len =bis.read(buffer))!=-1){fos.write(buffer, 0, len);total+= len;//获取当前下载量pd.setProgress(total);}fos.close();bis.close();is.close();return file;}else{return null;}}}<uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

⑵ ipad软件更新在哪里看

1、看到iPad上面的app store常年有个右上角的数字,强迫症的人是不是觉得很难受啊。专其实,我属们可以通过设置自动更新,解决这一烦恼。点击设置,进入设置界面。

⑶ 怎样查看 Android APP 源代码

需要把反编译的apk存放到apktools同级文件夹目录下,然后运行要查看的安装包,具体操作如下:

1、首先把反编译的apk存放到apktools同级文件夹目录下,如下图所示。

⑷ 软件检测更新的文件在哪可以删除吗

这东西没固定格式,只是行业程序员习惯用autoupdate命名dll是动态链接库,真正执行的是exe后缀的文件一般删除没什么影响,主程序和自动更新程序没依赖关系程序就不会出错可以看360安全卫士之类的软件,在服务里面看,一般都有各种软件的更新服务软件只有服务启动了才能运行

⑸ iOS APP如何实现版本检测更新

如果我们要检测app版本的更新,那么我们必须获取当前运行app版本的版本信息和appstore 上发布的最新版本的信息。当前运行版本信息可以通过info.plist文件中的bundle version中获取;要获取当前app store上的最新的版本,有两种方法,一、在某特定的服务器上,发布和存储app最新的版本信息,需要的时候向该服务器请求查询。二、从app store上查询,可以获取到app的作者,连接,版本等。官方相关文档www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.htm具体步骤如下:1,用 POST 方式发送请求:http://itunes.apple.com/search?term=你的应用程序名称&entity=software更加精准的做法是根据 app 的 id 来查找:http://itunes.apple.com/lookup?id=你的应用程序的ID#define APP_URL http://itunes.apple.com/lookup?id=你的应用程序的ID你的应用程序的ID 是 itunes connect里的 Apple ID2,从获得的 response 数据中解析需要的数据。因为从 appstore 查询得到的信息是 jsON 格式的,所以需要经过解析。解析之后得到的原始数据就是如下这个样子的:{ resultCount = 1; results = ( { artistId = 开发者 ID; artistName = 开发者名称; price = 0; isGameCenterEnabled = 0; kind = software; languageCodesISO2A = ( EN ); trackCensoredName = 审查名称; trackContentRating = 评级; trackId = 应用程序 ID; trackName = 应用程序名称"; trackViewUrl = 应用程序介绍网址; userRatingCount = 用户评级; = 1; version = 版本号; wrapperType = software; } ); } 然后从中取得 results 数组即可,具体代码如下所示:NSDictionary *jsonData = [dataPayload JSONValue]; NSArray *infoArray = [jsonData objectForKey:@"results"]; NSDictionary *releaseInfo = [infoArray objectAtIndex:0]; NSString *latestVersion = [releaseInfo objectForKey:@"version"]; NSString *trackViewUrl = [releaseInfo objectForKey:@"trackViewUrl"]; 如果你拷贝 trackViewUrl 的实际地址,然后在浏览器中打开,就会打开你的应用程序在 appstore 中的介绍页面。当然我们也可以在代码中调用 safari 来打开它。UIApplication *application = [UIApplication sharedApplication]; [application openURL:[NSURL URLWithString:trackViewUrl]]; 代码如下:-(void)onCheckVersion{ NSDictionary *infoDic = [[NSBundlemainBundle] infoDictionary]; //CFShow((__bridge CFTypeRef)(infoDic)); NSString *currentVersion = [infoDic objectForKey:@"CFBundleVersion"]; NSString *URL [email protected]"http://itunes.apple.com/lookup?id=你的应用程序的ID"; NSMutableURLRequest *request = [[NSMutableURLRequestalloc] init]; [requestsetURL:[NSURLURLWithString:URL]]; [requestsetHTTPMethod:@"POST"]; NSHTTPURLResponse *urlResponse = nil; NSError *error = nil; NSData *recervedData = [:request returningResponse:&urlResponse error:&error]; NSString *results = [[NSStringalloc] initWithBytes:[recervedDatabytes] length:[recervedDatalength] encoding:NSUTF8StringEncoding]; NSDictionary *dic = [results JSONValue]; NSArray *infoArray = [dic objectForKey:@"results"]; if ([infoArray count]) { NSDictionary *releaseInfo = [infoArray objectAtIndex:0]; NSString *lastVersion = [releaseInfo objectForKey:@"version"]; if (![lastVersion isEqualToString:currentVersion]) { //trackViewURL = [releaseInfo objectForKey:@"trackVireUrl"]; UIAlertView *alert = [[UIAlertViewalloc] initWithTitle:@"更新"message:@"有新的版本更新,是否前往更新?" delegate:self cancelButtonTitle:@"关闭"otherButtonTitles:@"更新",nil]; alert.tag =10000; [alertshow]; } else { UIAlertView *alert = [[UIAlertViewalloc] initWithTitle:@"更新"message:@"此版本为最新版本" delegate:selfcancelButtonTitle:@"确定" otherButtonTitles:nil,nil]; alert.tag =10001; [alertshow]; } }}- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ if (alertView.tag==10000) { if (buttonIndex==1) { NSURL *url = [NSURLURLWithString:@"https://itunes.apple.com"]; [[]openURL:url]; } }}

⑹ 苹果手机app更新在哪设置

操作方法:以iPhone11为例,打开手机,找到AppStore图标,点击进入,点击页面底部的“更新”按钮,可以进入更新页面,选择需要更新的APP,点击更新即可,软件会自动下载安装包,会自动进行安装。手机使用技巧:1、iPhone11可以搜索APP,打开AppStore,点击页面底部的搜索按钮,之后搜索APP即可。2、iPhone11可以获取APP的详细信息,打开AppStore,点击需要查看详细信息的APP,在弹出页面即可看到APP更新内容、版本号等信息。3、iPhone11具有自动更新功能,可以自动下载安装包,打开手机,点击齿轮图标,打开系统设置页面,点击“通用”——“软件更新”——“自动更新”,将“自动更新”开启即可。资料拓展:iOS13重新设计了系统自带的提醒事项App,除了设计上更现代化和好看之外,提醒事项最明显的变化就是在应用上方增加了今天、计划、全部,在功能方面,iOS13中的提醒事项增加了对于自然语义识别的支持。更多关于苹果手机app更新在哪里设置,进入:https://www.abcgonglue.com/ask/8c25741616091957.html?zd查看更多内容

⑺ 华为手机app更新在哪里

在华为手机的“应用市场”app中。当然你也可以直接打开手机的APP,然后找到它的设置—关于,里面会有一个“版本更新检查”选项。个别软件在打开后,只要联网会自动检测新版本,并对你进行提示。

⑻ 华为手机更新app在哪里更新

你好当手机来安装的应用需源要更新时,手机自带的应用市场图标右上角就会出现红色数字标识,这是提醒用户需要进行更新,我们点击进入,然后进行更新即可。关闭手机应用自动更新和安装的方法如下:1.解锁手机,点击“华为应用市场”进入主页,然后点击页面右下角“我的”选项。2.进入我的页面后,点击“设置”选项,然后关闭“WLAN闲时自动更新”功能,接着点击“WLAN自动安装”选项,之后关闭这个功能。3.这样应用就不会进行自动更新了,而且也不会提示用户进行更新。用户只能手动进入应用市场然后检查进行更新软件。如果是手机的操作系统需要进行升级了,那我们最好是进行升级,但是在升级之前最好是备份手机数据,并且确保手机已连接到网络,而且还要保证手机电量在30%以上。然后我们点击手机“设置”应用,接着点击“系统更新”选项,之后点击“检查更新”选项,检测是否有新的版本。如果有就点击最新版本并下载升级包,然后就是等待着系统更新即可。望采纳祝你好运

⑼ app更新在哪里

点击【设置】-【iTunes Store与App Store】;将【应用】和【更新】的开关滑动即可开启或关闭。如果查看应用更新,打开App Store,点击【头像】图标;在帐户界面下方,就能看到应用更新详情。具体介绍如下:

1、如果是打开或关闭应用更新,点击【设置】-【iTunes Store与App Store】,然后将【应用】和【更新】后面的开关滑动即可;

2、若要查看应用更新详情,在桌面上打开App Store,点击屏幕顶部【头像】图标,然后在帐户界面的下方,就能看到应用更新详情。并且有【全新更新】和【更新】选项可选;

3、在帐户中还可以查看到曾经下载过的App,点击【已购项目】就可以找到。


赞 (0)