ad728

Friday, September 29, 2017

AIDE Tutorial - 38 Show installed Apps Name

AIDE Tutorial - 38 Show installed Apps Name

List of installed apps
This app will help you to get the list of apps installed in your phone.
Java
package com.kcgroup.showappsname;
import android.app.*;
import android.os.*;
import android.widget.*;
import android.content.pm.*;
import android.content.*;
import java.util.*;
public class MainActivity extends Activity
{
private ListView LV;
private ArrayList results=new ArrayList();
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

LV=(ListView)findViewById(R.id.mainListView);
PackageManager pm=this.getPackageManager();
Intent in=new Intent(Intent.ACTION_MAIN,null);
in.addCategory(Intent.CATEGORY_LAUNCHER);

java.util.List<ResolveInfo>list=pm.queryIntentActivities(in,PackageManager.PERMISSION_GRANTED);
for(ResolveInfo rinfo:list){results.add(rinfo.activityInfo.applicationInfo.loadLabel(pm).toString());

}

LV.setAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1,results));
    }
}
Main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center">
    <TextView
        android:text="Installed apps"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
<ListView
android:id="@+id/mainListView"
android:layout_width="match_parent"
        android:layout_height="match_parent" />
</LinearLayout>
For more watch the video below
Share:

0 comments:

Post a Comment

Total Pageviews

Sponsor

Sponsor

ad300

Blog Archive