Developing plugins guide

This is available on WMC Manryo Version Code 22 or upper.

How to call plugins

On WMC Manryo, click menu key, tap "more", "External" and "Plugins", and you can see the list of plugins.

Condition of plugin

WMC Manryo recognizes the activity with following action as a plugin.

jp.finds.and.app.action.BROWSE_LOCATION
WMC passes values to the plugin. When plugin finishes, WMC does NOTHING.
jp.finds.and.app.action.PICK_LOCATION
WMC DOES NOT pass values to the plugin. When plugin finishes, WMC recieves values.
jp.finds.and.app.action.INTERACTION_LOCATION
WMC passes values to the plugin. When plugin finishes, WMC recieves values.

Before Version Code 22, Only "jp.finds.and.app.action.BRAWSE_LOCATION" is available (and wrong spelling).

Passed values

Folloing values are passed via extra.

lon
double type. Longitude of specified location.
lat
double type. Latitude of specified location.
zoom
int type. Current zoom level.
azimuth
int type. Current azimuth (0-359).
crs
(Version Code 25 or more) string type. Used coordinate reference system. Currently, "EPSG:4326" or "EPSG:900913" may be passed.

Example

AndroidManifest.xml

    <activity ... >
        ....
        <intent-filter>
            <action android:name="jp.finds.and.app.action.BROWSE_LOCATION" />
        </intent-filter>
    </activity ... >

TestActivity.java

Following code describes the activity receiving "lon" and "lat" and shows them during short time.

public class MoveSunActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        Intent intent = this.getIntent();
        double lon = Double.NaN;
        double lat = Double.NaN;
        if( intent != null ) {
            lon = intent.getDoubleExtra("lon", Double.NaN);
            lat = intent.getDoubleExtra("lat", Double.NaN);
        }
        if( lon >= -180 && lon <<= 180 && lat >= -90 && lat <= 90 ) {
            String message = String.valueOf(lon) + ", " + String.valueOf(lat);
            Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
        }
    }
}

WMC Manryo 0.9.15 (Version Code 23) (28th October, 2012)



© 2011 National Agriculture and Food Research Organization | NARO Official Website

[To TOP]