Specifications

29
1.21 Application Launch
User application can launch the applications that are installed in V-T500/V-N500.
To launch the applications, Package name is required.
Package name has been mentioned in the list of installed applications shown at the beginning of
each chapter after "2 Standard Accessories". Also you can get package name by
"PackageManager" in Android standard library.
The following is a summary of how to launch application. Please refer to the official web site
"Android Developers" for details.
Getting Activity
We can get the Acntivity name of application by using “PackageManager” from the package
name.
"Activity" can launch only one that "android.intent.action.MAIN"
"android.intent.category.LAUNCHER" in AndroidManifest.xml is defined.
We need to get the name of the activity that corresponds to this condition.
Intent ifind = new Intent();
ifind.setAction(Intent.ACTION_MAIN);
ifind.addCategory(Intent.CATEGORY_LAUNCHER);
ifind.setPackage("jp.casio.vx.util.memo.text"); //Package name
PackageManager pm = this.getPackageManager();
list<ResolveInfo> list = pm.queryIntentActivities(ifind, 0);
if( list != null ) {
ResolveInfo item = list.get(0);
String myClass = item.activityInfo.name; //Activity Class
}
In the above example, the name of the activity enters the myClass.
Launch Activity
When you get an activity, you can launch, as the example below.
Intent irun = new Intent();
irun.setClassName("jp.casio.vx.util.memo.text", myClass);
startActivity(irun);
In addition, if the application that has the intent argument, it is also possible to specify "putExtra"
as follows.
Intent irun = new Intent();
irun.setClassName("jp.casio.vx.util.memo.text", myClass);
irun.putExtra( "FILEPATH", "/mnt/sdcard/xxx.txt" );
startActivity(irun);