intents.ini reference

Overview

With Map2Geo, you can define your own format for the transmission intent of geographic information (Ver 4.00 or later).

With the definition file “intents.ini”, it is possible to add its original support to applications other than the transmission target that Map2Geo supports as standard.

intents.ini

User’s own additional format definition file.

Structure of file contents

[section1] ;comment key=value  :  : [section2] ;comment key=value  :  : 

Example

[0] ;Activate Google Maps with always zoom level 20 and place name as "Example". data=geo:{lat},{lng}?q={lat},{lng}(Example)&z=20 package=com.google.android.apps.maps 

You can try this by copying to a text file and placing it as <Internal shared storage>/map2geo/intents.ini.

Process of file parse

Parsed by the following rule:

Key

The list of keys is as follows:

data

The syntax details are described below.

package

class

identifier

iconactivity

action

label


URI Template Syntax

The syntax of the data, identifier entry of intents.ini is as follows:

Basic syntax

Element

The elements of the template are as follows:

Example:

geo:{lat},{lng}[zoom:&z={zoom}] 

Value

The list of values is as follows:

Conditional phrase

Substring that begins with “[Condition:” or “[Condition!” and ends with”]”.

Do not put spaces between “[“, Condition, “:” “!”.

Example:

[zoom:zoom exists] :If the zoom level exists, evaluated to the string “zoom exists”, otherwise evaluated to the empty string.

[zoom!zoom not exists] :If the zoom level not exists, evaluated to the string “zoom not exists”, otherwise evaluated to the empty string.

[zoom:[label:zoom and label exist]] If the zoom level and label exist, evaluated to the string “zoom and label exist”, otherwise evaluated to the empty string.

The list of conditions is as follows:

Example

geo:{lat},{lng} 

geo:35.660411,139.729265 , expanded as.

geo:{lat},{lng}[zoom:?z=zoom] 

geo:35.660411,139.729265 or geo:35.660411,139.729265?z=18.0 , expanded as.

geo:{lat},{lng}[label:?q={lat},{lng}({label})[zoom:&z={zoom}]][label![zoom:?z={zoom}]] 

It is expanded as follows:

geo:35.660411,139.729265

geo:35.660411,139.729265?q=35.660411,139.729265(google)

geo:35.660411,139.729265?q=35.660411,139.729265(google)&z=18.0

geo:35.660411,139.729265?z=18.0

Remarks

Route transfer feature of Map2Geo can not be handled with this definition file.

This definition file is not referred to in route transfer processing.

Tips

Standard geo URI format transmitted by Map2Geo

It is as follows (at Ver4.00):

geo:{lat},{lng}[?z={zoomint}] 

Issuing intents other than geo intent

Intent that can be issued is not limited to geo intent.

Launch browser

For example, Google Maps for the browser opens with the following definition:

data=https://www.google.com/maps/@{lat},{lng},{zoom}z 

You can try this by making this line a text file and putting it as <Internal shared storage>/map2geo/intents.ini.

Section description is not required (parsed as a section of the empty name).

Share text

By specifying action=android.intent.action.SEND it is also possible to transfer text to memo apps etc.

In the case of action=android.intent.action.SEND, Map2Geo packs the string generated by data into Extra of Intent.EXTRA_TEXT, and sends it by generating an intent with type=”text/plain”.

data={label}{\n}https://www.google.com/maps/@{lat},{lng},{zoom}z action=android.intent.action.SEND 

With the above definition,

Google

https://www.google.com/maps/@35.660411,139.729265,16.0z

Text such as above will be shared with mailers and others.

However, in this example all the android.intent.action.SEND compatible applications are listed, and the sections after this that use android.intent.action.SEND are masked.

It is advisable to specify a specific application by appending description like package=com.google.android.gm.