[Vm-dev] New CogDroid alpha: with intent filter.

Dimitry Golubovsky golubovsky at gmail.com
Sun Sep 18 04:54:39 UTC 2011

I have uploaded a new alpha of CogDroid:


Intent filtering has been added to the application. Also application
icon and Java package name (org.golubovsky.cogstack) have been

Intents in Android are messages that an application may pass around to
invoke other applications that subscribe to filtering intents with
some properties.

That is, another application may broadcast an Intent (via
startActivity()) with scheme "file", content-type
"application/x-squeak-image", and path to the image as data. CogDroid
will start right with the image given (provided that it exists)
without scanning the sdcard storage for available image files.

Sample Java code for this:

    public void launchImage(String imgpath) {
            Intent cog = new Intent();
            Uri uri = new Uri.Builder().scheme("file").path(imgpath).build();
            cog.setDataAndType(uri, "application/x-squeak-image");
            try {
            } catch (Exception e) {
                // process the exception: it is raised if no
recipients were found for this intent, e. g. CogDroid is not

Relevant section in CogDroid's AndroidManifest.xml:

                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="file"
                        android:mimeType="application/x-squeak-image" />

I also created a simple launcher for two images (the application when
installed shows an icon for each image). Unfortunately image paths are
hardcoded (but just for illustration this should be OK), and a single
Activity subclass is required for each image file.

See under https://gitorious.org/~golubovsky/cogvm/dmg-blessed/trees/master/platforms/android/utils/imglaunch


Dimitry Golubovsky

Anywhere on the Web

More information about the Vm-dev mailing list