My R&D World

All Things R&D

User Guidelines for OI WebIntents

Hi there,

This blog presents a summary of user interface for current OI WebIntents. Now the app supports both tablets and handsets.

This is the main page with an introduction section, a service registration section, a service invocation section and a link to home page of webintents.org.

There are five action items in the action bar: backward, forward, reload, goHome and applicaiton management.

When a new application is found, a notification message is shown. The user can enter into application management interface by click on the notification or the menu item.

There are three tabs in the Web application management interface: New Found, My App and Trash, each with its own menu items. The sign “+” here means add the checked Web apps in New Found tab to My App, while “-” means removing them to trash. Since in current version, the agent no longer marked visited applications and ignore them in future visits, I put a trash tab here for recycling instead of deleting unused applications forever.

When entering the simple share web page on webintents.org and click on the share button, a chooser dialog appears (with or without web apps).

Now you can use Web application like Twitter or Android application like Gmail to complete your action.

When running the share sample app now, the chooser dialog appears in its own context now.

The interface for handsets is similar.

The biggest difference is displaying Web applications and their web intents. Still, in the intents detail interface, a user can make same menu operations as its parent. Since back button shows different results from in tablets, I added a navigation up support for the application icon to return to the home page.

GSoC 2012 Weekly Report on OI WebIntents Agent (Aug 14-Aug 20)

Hi there,

This is the last report for GSoC 2012.

Overview

Now OI WebIntents can do three major tasks as specified in the application proposal:

  1. Invoke both Web applications and Android Applications from a Web page
  2. Invoke both Web applications and Android Applications from an external Android application
  3. Web application management

Device Models

Now OI WebIntents can work well on both handsets and tablets with different screen design.

User Guidelines

Another blog post describe the user guidelines to use OI WebIntents Agent with screenshots.

Data Structure and Class Implementation

1. Main activities

There are two activity classes which are important for this part:

  • WebIntentsAgentActivity
  • WebAppManagementActivity

WebIntentsAgentActivity is the main activity for this application and launched when the app takes off.  It creates the navigation menu items and if necessary starts off the WebAppManagementActivity for Web application management.

2. Data Storage and Content Provider

Two classes are important for this part:

  • WebIntentsDatabase
  • WebIntentsProvider

Each database table is represented by an internal class of WebIntentsProvider with its column fields and  CONTENT_URI. For example, the database table ‘web_intents’ is represented by WebIntentsProvider.WebIntents.

3. Web page parsing, revising and loading

CustomWebView is a customized subclass of WebView for parsing, revising and loading a Web page. Its loadUrl() method has been overwritten to inject Javascript code for Web Intents support before loading a Web page. Generally, a Web page consists of a main frame and several sub frames or iframes.  Since the loading of iframes is counted as resources loading in Android Webkit, sub pages parsing and Javscript injection for them is placed in the shouldInterceptRequest() method of WebViewClient. The procedures are similar, using Jsoup to parse pages and inject Javascript support for Web Intents.

In the other hand, the native Java Code support for the injected Javascript code is implemented by an internal class of WebIntentsAgentActivity, i.e. WebIntentsAgentActivity.Navigator. It implements the interfaces which are used in the injected Javascript code.

4. Web application Registration

Since most available Web applications for Web Intents are implemented as Chrome Extensions. I modified four sample applications and included them in this application. They are:

  • Web Intents Debugger
  • Share Link to Twitter
  • Shorten with Goo.gl
  • Chromerly URL-shortener

As a result, a procedure (FileReaderThread) for registering and loading local applications was also developed. However, this application also support online app registration. webintents.org now supports some online applications. Our project is applicable for the following online application:

They can be discovered by browsing the following Web pages:

5. Web application management

The following classes are important for this part:

  • WebAppManagementActivity
  • WebAppListFragment
  • WebIntentsByAppListFragment
  • WebIntentsByAppActivity

WebAppListFragment is for displaying a list of Web application and WebIntentsByAppListFragment shows web intents for a specific web application. For a tablet, both WebAppListFragment and WebIntentsByAppListFragment will be added into  WebAppManagementActivity. However, for a handset, WebAppListFragment is contained in WebAppManagementActivity while WebIntentsByAppListFragment is loaded into WebIntentsByAppActivity. The purpose is for supporting multiple screens.

6. Invoke Web applications from external Android apps

A helper class named WebIntentsHelper is for this requirement. Any external Android application can invoke Web applications by the following step:

Install OI WebIntents Agent -> Import webintents-helper.jar into libs -> Create a application chooser by invoke WebIntentsHelper.createChooserWithWebActivities()

This method will create a chooser dialog in the context of the calling application now.

Use Cases

It is a pity that OI WenIntents now only support the http://webintents.org/share and http://webintents.org/shorten action. More action supports will be added in the future.

Failure method to report

We was trying to use Javascript and it events to support Web Intents directly. However, it seems not to work on Android. The Javascript event DOMContentLoaded or load can not be triggered in time in our early experiments and this cost us some time. The feature of slow network connection of mobile devices dooms direction of Javascript support on Android.

Cheers

GSoC 2012 Weekly Report on OI WebIntents Agent (Aug 6-Aug 13)

Hi there,

Last week I designed a new logo for OI WebIntents Agent together with Friedger, as in Fig 1.

Fig 1. OI WebIntents logo

It will appear in the following versions.

In the former versions, the external Android application which calls the createChooserWithWebActivities method will let the system start an empty Activity which creates a dialog for application selection. Now the dialog will be created in the context of the activity which calls the method, as in Fig 2.

Fig 2. Application chooser dialog

The dialog layout is created from Java code and I tried to use Android internal layout resources, so now the invoking methods is still the same as the former version.

Now when new applications are found, a notification message on the status bar will appear. It may refer the user to the application management UI directly, like in Fig 3.

Fig 3. New application found notification

For the application management UI, the selection mode is enabled when the user enters the activity. I also added checkboxes for item selection instead of the former long click action, as in Fig 4.

Fig 4 New application management UI

Last week, I also added handset supports. Now the application management UI also looks better on small screen devices, like in Fig 5 and 6.

Fig 5. Web Application list

Fig 6. Web Intents by application

This week is the last week before hard ‘pencil down’. A lot of document work and revisions are waiting for me so it will be very busy.

Any feedback is welcome.

Cheers

GSoC 2012 Weekly Report on OI WebIntents Agent (July 30-Aug 5)

Hi there,

Happy Civic Day!

This week I added some comments to the code. Hope that they are helpful. If any part of the code is obscure to you, please leave a message and I will add more comments specific for you.

It’s a pleasure that webintent.org  made some online services available besides those in Chrome. Now when you use our app to browse some online pages you can find new applications from them. Those applications include Kinlan’s Image Share, Kinlan’s Link Share and Kinlan’s Link Shortener. Up to now, our app is totally compatible with these apps except a small flaw for image sharing. But this problem also exists when you use Android’s default browser so I think it might be generic to Android Webkit.

Now the app is working better on tablet with large screens.  Next step I will test it on normal devices like phones and add necessary revisions.

Since the pencil down date is approaching, I have many small function revisions to make in the next few days and I think it must be very busy.

Work done last week

  1. Add online service registration
  2. Add an address bar
  3. Format the code according to openintents developer’s code style instructions like use tab instead of spaces for indentation

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.

GSoC 2012 Weekly Report on OI WebIntents Agent (July 16-22)

Hi there,

Last week I added two URL shorten apps which now you can have an experience.

Since calling the new two apps will be blocked by the same-origin policy of Javascript, I added a new table named “local_service_domain” which is used for keeping and loading domains  for local services.

The onSuccess callback of startActivity specified in the Spec was implemented last week. Since the interface between WebView and Javascript is so limited, the implementation of this callback is tricky and may need to be revised in the future.  I am trying to keep the interfaces the same as specified in the Spec, so if you find some code a little weird, please let me know.

Currently you can feel the onSuccess callback by calling the Shorten with Goo.gl app. Following I will show some screenshots from my tablet.

Fig1. Shorten URL example

Fig 1 is the shorten example page from webintents.org. When you click and choose Shorten with Goo.gl, you can get this screenshot.

Fig 2. Shorten with Goo.gl

When you click the return button, you can return to the former page with change on the bottom line.

Fig 3. Result

Another issue:

When you share picture and calling the Web Intents Debugger, it may show like the following picture:

Fig 4. Share picture by the Web Intents Debugger

This is because Android uses content providers to locate and load files which no file extension can be found in the path. So the resulting data have no data type included. If you try to use the app in Chrome to share a image file with no extension or extension other than any image type like (.pdf, .doc, you can change it), the same thing will happen.

This week’s work

This week I will implement calling web intents from an Android app. The main idea now is to provide a customized Activity which any Android app can use to calling web intents.

 

GSoC 2012 Weekly Report on OI WebIntents Agent (July 9-15)

Hi there,

Now I’ve done roughly with the major functions of application management. The new update has  been published. Here I am gonna present some instructions.

I added a registration page for the “Share Link to Twitter” service, so it won’t be added automatically when you install the new app.

When you click the “Application management” menu item, you should see the initially empty page of MY APP as in Fig 1.

Fig 1: Empty MY APP

Now you can go back and visit any of the pages for service registration, then the application management item show new apps are found, as in Fig 2.

Fig 2: New apps are found

When enter the menu item of application management, you will get a similar page like in Fig 3.

Fig 2: New found in application management

Click any entry, the web intents attached to it will display in the right pane. Long click on any entry will trigger the CAB mode like in Fig 4.

Fig 4: CAB mode for new found apps

Click the top-right plus sign will add the two apps to your “MY APP” registry, as in Fig 5.

Fig 5: After adding the web apps

Long click on any entry and you can trigger the CAB mode to delete them. Now when you go back and visit the pages of Intents Invocation, you can find new Web Apps in the suggested list, as in Fig 6.

Fig 6: Suggested apps

The new “Web Intents Debugger” can show what your intents are for debugging purpose, as in Fig 7.

Fig 7: Web Intents Debugger

This is a modified version with some simplifications of the one in Chrome Web Store.

Other work I did last week:

  • Fix the bug of back/forward history action in the action bar
  • GSoC midterm evaluation

 

 

 

GSoC 2012 Weekly Report on OI WebIntents Agent (July 2-8)

Hi there,

I didn’t think the function of “Web Application Management” involves so much work like UI designs and implementation which was my weakness. Anyhow, I still need some days for this work. Now I mainly focus on developing the main functionality to let you get a basic experience of what we are working on, so if you find the code up to now is not good enough please be patient because we will add more improvements and bug-fixes in the future.

I will present some instructions on how to get a tour of some new features here:

Fig 1. Start-up page

Fig 1 illustrates the first page you will meet while running our agent.  The two links in the first section refer you to currently two working pages located on webintents.org. The Web Intents Debugger application is a modified version of the one at http://www.tomgibara.com/webintents/debug/ by Tom Gibara. I think it is very useful for our app, but the original one seems only to be working on Chrome so I made some revisions and simplifications to let it become applicable to our agent.

Fig 2. New Web Intents Registration Tag Discovery

When you open the link of Web Intents Debugger, you should get a page like in Fig 2. See what’s the difference? Yes the menu item for application management has changed because some <intent> tag with new web intents being discovered in this page. The tasks of discovery and notification are run asynchronously under some worker threads so that they will not affect the user’s common browsing activities.

Fig 3. The initial UI design of “Application management”

Fig 3 presents some design ideas of the application management function when you click on its menu item in Fig 2. Two tabs are located in the action bar, one is for the new web apps which await decision making from the user, the other is about the registered apps. This work is still in progress.

Other work I did last week

  • Change to use convertview and viewholder in the class AndroidAppListAdapter for performance purpose
  • Revise the WebIntentsProvider class and relevant database classes to make the code clearer

The plan for this week

  • Continue with the work of app management
  • GSoC2012 midterm evaluation

Cheers

GSoC 2012 Weekly Report on OI WebIntents Agent (June 25-July 1)

Hi there,

Happy Canada Day!

Last week I have done with the preliminary stage of integration work for Web Intents and Android Intents. The new code has been uploaded. Here I am presenting some instructions for how you can get a simple tour of such idea.

Because now it is only implemented for the action “http://webintents.org/share&#8221;, only two pages http://examples.webintents.org/intents/share/share.html and http://examples.webintents.org/usage/startActivity/index.html at webintents.org are working.

1. When you start the app, Fig 1 is shown.

Fig 1. Startup page

2. This page works. Still you can go to Fig 2 by clicking links Example -> Simple Share.

Simple Share

Fig 2. Simple Share

3. “Share an Image” is not taking effect yet because I am working on solving image data transfer between components. But you can click the link share button to get a feel.

Fig 3. Popup selection list

4. A popup selection list of both Web apps and Android apps is shown. (I suggest you install Gmail app at least which may not appear if you run the app in AVD). Then you can choose Twitter Web Intents service or Android apps to complete your action, as in Fig 4 and 5.

Fig 4. Share link to Twitter

Fig 5. Share link by Gmail

Some NOTES:

[1] Since now most of the existing Web Intents services are only effective in Chrome, I plan to modify some of them and attach to this app. So here you can see a local href value of the Web apps.

[2] If your connectivity is too slow, it may need more time to load the pages. So please be patient or try to test it in a better network.

Next Week:

I will implement the function for the registration of a Web intent. Hoping that I can finish it before the mid-term evaluation.

Fglrx begin to abandon chipsets older than HD5000 series

The newest fglrx in Gentoo portage (x11-drivers/ati-drivers–12.6_beta) only supports Radeon Evergreen (HD5000 Series) and newer chipsets, which means the graphic card (Radeon HD 3650) on my Lenovo Thinkpad T500 was abandoned by fglrx.

I have to consider transferring to radeon in the future.