All Things R&D
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:
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.
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.