My R&D World

All Things R&D

GSoC 2012 Weekly Report on OI WebIntents Agent (July 23-29)

Hi there,

Last week, I implemented the function of invoking web intents from an Android app. Any Android app developer can invoke web intents through the following steps:

  1. Make sure the latest version of OI WebIntents Agent has been installed.
  2.  Add the library webintents-helper.jar to the project build path.
  3. Create an WebIntentsHelper object.
  4. Call the method WebIntentsHelper.createChooserWithWebActivities() and send an intent to it.

For example:

Intent intent = new Intent(android.content.Intent.ACTION_SEND);
intent.setType("text/uri-list");
intent.putExtra(android.content.Intent.EXTRA_TEXT, "http://www.openintents.org");

WebIntentsHelper helper = new WebIntentsHelper(YourActivity.this);

helper.createChooserWithWebActivities(intent);

The intent object here is the same as what you usually do in Android apps.

I’ve created a sample app and uploaded it to github. The following are some screenshots.

Fig1. Sample share app

Fig2. Selection list of Web apps and Android apps

For different Android intents, data may be placed in different fields. Some are located by uri while others placed in the extra fields of an intent object. However, for web intents, data is universally placed in the “data” field. Now I’ve created a table which is used for processing such issue. Yet not fully completed. This is one of which I need to do next week.

I am going to add comments and adapt the format of code to make it comply with openintents code style.

Any feedback and suggestions are welcome.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: