㈠ 鐜板湪瀹夊崜緋葷粺鎵嬫満涓嬭澆搴旂敤鐨勮蔣浠舵湁鍝浜涳紵
鏈夊緢澶
浣嗘槸鏈瀹炵敤鐨勬垜瑙夊緱灝辨槸搴旂敤瀹濅簡
絎涓鏂歸潰鏄瀹冮噷闈㈣祫婧愬
絎浜屾槸閲岄潰鐨勯栧彂搴旂敤鍜屾父鎴忓氾紝鍙浠ョ涓鏃墮棿涓嬭澆鍒
瀹冮噷闈㈢殑搴旂敤涔熼兘鏄寰堟h勭殑錛屽畨鍏ㄦ棤姣掔殑
闄や簡涓嬭澆搴旂敤鍜屾父鎴忕瓑璧勬簮涔嬪
鐢ㄥ畠榪樺彲浠ョ$悊鎵嬫満搴旂敤鍜岃祫鏂
姣斿傝蔣浠剁殑鏇存柊錛屽嵏杞斤紝鐓х墖鐨勫煎叆瀵煎嚭絳
鐢ㄥ畠榪樺彲浠ュ囦喚璧勬枡錛屼竴閿畆oot鎵嬫満涔嬬被鐨
騫蟲椂鎵嬫満浼氶渶瑕佸埌鐨勪笢瑗垮畠閲岄潰閮芥湁
瀵瑰鉤鏃剁殑鐢熸椿甯鍔╀篃鎸哄ぇ鐨
浣犲彲浠ヤ綋楠屼竴涓
㈡ 如何獲得Android手機的軟體安裝列表
packageManager.getInstalledApplications()返回一個列表都是安裝在設備上的應用程序包。如果我們把 flag GET_UNINSTALLED_PACKAGES設定,一個列表中的所有應用,包括那些設置為dont_delete_data(部分已安裝的應用程序的數據目錄)將返回。
你可以看到附件中的截圖,我們將創建一個列表顯示所有已安裝的應用程序。
snippet_list_row.xml--------------------這個布局是由ListView適配器用於表示應用程序的細節。它顯示應用程序圖標、應用程序名稱和應用程序包。
<?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="wrap_content" > <ImageView android:id="@+id/app_icon" android:layout_width="50dp" android:layout_height="50dp" android:padding="3dp" android:scaleType="centerCrop" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:orientation="vertical" android:paddingLeft="5dp" > <TextView android:id="@+id/app_name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:textStyle="bold" /> <TextView android:id="@+id/app_paackage" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_vertical" /> </LinearLayout></LinearLayout>
AllAppsActivity.java ##這是用於初始化和列表已安裝的應用程序的主要應用程序類。從packagemanage得到應用細節列表是一個耗時的任務,我們將在AsyncTask裡面做。同時,類使用自定義適配器「自定義listview applicationadapter」。 package com.javatechig.listapps;import java.util.ArrayList;import java.util.List;import android.app.AlertDialog;import android.app.ListActivity;import android.app.ProgressDialog;import android.content.ActivityNotFoundException;import android.content.DialogInterface;import android.content.Intent;import android.content.pm.ApplicationInfo;import android.content.pm.PackageManager;import android.net.Uri;import android.os.AsyncTask;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View;import android.widget.ListView;import android.widget.Toast;public class AllAppsActivity extends ListActivity { private PackageManager packageManager = null; private List<ApplicationInfo> applist = null; private ApplicationAdapter listadaptor = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); packageManager = getPackageManager(); new LoadApplications().execute(); } public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } public boolean onOptionsItemSelected(MenuItem item) { boolean result = true; switch (item.getItemId()) { case R.id.menu_about: { displayAboutDialog(); break; } default: { result = super.onOptionsItemSelected(item); break; } } return result; } private void displayAboutDialog() { final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.about_title)); builder.setMessage(getString(R.string.about_desc)); builder.setPositiveButton("Know More", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://stacktips.com")); startActivity(browserIntent); dialog.cancel(); } }); builder.setNegativeButton("No Thanks!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); ApplicationInfo app = applist.get(position); try { Intent intent = packageManager .getLaunchIntentForPackage(app.packageName); if (null != intent) { startActivity(intent); } } catch (ActivityNotFoundException e) { Toast.makeText(AllAppsActivity.this, e.getMessage(), Toast.LENGTH_LONG).show(); } catch (Exception e) { Toast.makeText(AllAppsActivity.this, e.getMessage(), Toast.LENGTH_LONG).show(); } } private List<ApplicationInfo> checkForLaunchIntent(List<ApplicationInfo> list) { ArrayList<ApplicationInfo> applist = new ArrayList<ApplicationInfo>(); for (ApplicationInfo info : list) { try { if (null != packageManager.getLaunchIntentForPackage(info.packageName)) { applist.add(info); } } catch (Exception e) { e.printStackTrace(); } } return applist; } private class LoadApplications extends AsyncTask<Void, Void, Void> { private ProgressDialog progress = null; @Override protected Void doInBackground(Void... params) { applist = checkForLaunchIntent(packageManager.getInstalledApplications(PackageManager.GET_META_DATA)); listadaptor = new ApplicationAdapter(AllAppsActivity.this, R.layout.snippet_list_row, applist); return null; } @Override protected void onCancelled() { super.onCancelled(); } @Override protected void onPostExecute(Void result) { setListAdapter(listadaptor); progress.dismiss(); super.onPostExecute(result); } @Override protected void onPreExecute() { progress = ProgressDialog.show(AllAppsActivity.this, null, "Loading application info..."); super.onPreExecute(); } @Override protected void onProgressUpdate(Void... values) { super.onProgressUpdate(values); } }}
package com.javatechig.listapps;import java.util.List;import android.content.Context;import android.content.pm.ApplicationInfo;import android.content.pm.PackageManager;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.TextView;public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> { private List<ApplicationInfo> appsList = null; private Context context; private PackageManager packageManager; public ApplicationAdapter(Context context, int textViewResourceId, List<ApplicationInfo> appsList) { super(context, textViewResourceId, appsList); this.context = context; this.appsList = appsList; packageManager = context.getPackageManager(); } @Override public int getCount() { return ((null != appsList) ? appsList.size() : 0); } @Override public ApplicationInfo getItem(int position) { return ((null != appsList) ? appsList.get(position) : null); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; if (null == view) { LayoutInflater layoutInflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = layoutInflater.inflate(R.layout.snippet_list_row, null); } ApplicationInfo applicationInfo = appsList.get(position); if (null != applicationInfo) { TextView appName = (TextView) view.findViewById(R.id.app_name); TextView packageName = (TextView) view.findViewById(R.id.app_paackage); ImageView iconview = (ImageView) view.findViewById(R.id.app_icon); appName.setText(applicationInfo.loadLabel(packageManager)); packageName.setText(applicationInfo.packageName); iconview.setImageDrawable(applicationInfo.loadIcon(packageManager)); } return view; }};
㈢ 如何在安卓手機里查找下載的應用程序
第一步、在手機上找到文件管理並點擊進入文件管理。
㈣ 現在安卓系統手機下載應用的軟體有哪些
你好,安卓手機可以在應用寶中下載,
應用寶是騰訊出品的安卓應用下載市場,可以下載海量的安卓應用和游戲,
應用寶是一個專門針對智能手機開發的一款多功能優化軟體,
擁有海量的游戲、辦公軟體、電子書籍、音樂、電影等,
㈤ 安卓智能手機如何下載軟體
1.點擊安卓(安智)市場→搜索→輸入需要下載的軟體名稱→點擊所需下載的軟體→點擊下載→安裝。2.如手機不帶安卓(安智)市場,可點擊互聯網→網路搜索→安卓(安智)市場→官方下載安裝至桌面。客服46為你解答。貴州地區用戶關注中國電信貴州客服公眾號可微信繳費,一鍵查話費充值,流量、積分、賬單、詳單均可自助操作,方便快捷。