Skip to content

Commit a073b43

Browse files
committed
update string, add sample
1 parent f97470d commit a073b43

File tree

16 files changed

+90
-65
lines changed

16 files changed

+90
-65
lines changed

libCompiler/src/main/assets/code_sample/android_location/test_get_location_data.pas

Lines changed: 0 additions & 20 deletions
This file was deleted.

libCompiler/src/main/assets/code_sample/android_location/test_get_location_data2.pas

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{declare library aLocation}
2+
uses
3+
aLocation, crt;
4+
5+
{declare type java}
6+
type
7+
map = java_util_Map;{https://docs.oracle.com/javase/7/docs/api/java/util/Map.html}
8+
list = java_util_List; {https://docs.oracle.com/javase/7/docs/api/java/util/List.html}
9+
obj = java_lang_Object;
10+
loc = android_location_Location;
11+
{https://developer.android.com/reference/android/location/Location.html}
12+
var
13+
i: Integer;
14+
data: map; {Location data will be saved here}
15+
16+
{This method will be print data to console,
17+
include latitude, longitude,....}
18+
procedure printData(data: map);
19+
var
20+
providers: list;
21+
i: Integer;
22+
name: obj; //the name of provider
23+
info: loc; //store data of location
24+
begin
25+
{Each provider has a set of criteria under
26+
which it may be used; for example, some providers
27+
require GPS hardware and visibility to a number
28+
of satellites; others require the use of the
29+
cellular radio, or access to a specific carrier's
30+
network, or to the internet.}
31+
32+
{Returns available providers on the phone}
33+
providers := locationProviders();
34+
35+
for i := 0 to providers.size() - 1 do
36+
begin
37+
name := providers.get(i); //get name of provider in position i
38+
39+
if (data.get(name) <> null) then //if the data of provider is exist
40+
begin
41+
cast(info, data.get(name));
42+
//print long,lat to console
43+
writeln('Latitude = ', info.getLatitude());
44+
writeln('Longitude = ', info.getLongitude());
45+
end;
46+
end;
47+
writeln('...');
48+
end;
49+
50+
51+
begin
52+
{Starts collecting location data.
53+
The first parameter is minimum time between updates in milliseconds
54+
The second parameter is minimum distance between updates in meters}
55+
startLocating(100, 10);
56+
57+
//wait for 60 second
58+
for i := 1 to 60 do
59+
begingi
60+
delay(1000); //wait for collect info
61+
data := readLocation(); //read data
62+
printData(data); //print data to console
63+
end;
64+
65+
//stop collect data
66+
stopLocating();
67+
end.

libCompiler/src/main/res/values-cs/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,6 @@
188188
<string name="select_mode">Select mode</string>
189189
<string name="select_token">Select mode</string>
190190
<string name="insert">Insert</string>
191+
<string name="enable_ime_keyboard">Enable IME keyboard</string>
191192
</resources>
192193

libCompiler/src/main/res/values-es/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
<string name="select_mode">Select mode</string>
190190
<string name="select_token">Select mode</string>
191191
<string name="insert">Insert</string>
192+
<string name="enable_ime_keyboard">Enable IME keyboard</string>
192193
</resources>
193194

194195

libCompiler/src/main/res/values-ro/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,5 @@
197197
<string name="select_mode">Select mode</string>
198198
<string name="select_token">Select mode</string>
199199
<string name="insert">Insert</string>
200+
<string name="enable_ime_keyboard">Enable IME keyboard</string>
200201
</resources>

libCompiler/src/main/res/values-ru/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,5 @@
187187
<string name="select_mode">Select mode</string>
188188
<string name="select_token">Select mode</string>
189189
<string name="insert">Insert</string>
190+
<string name="enable_ime_keyboard">Enable IME keyboard</string>
190191
</resources>

libCompiler/src/main/res/values-sk/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,7 @@
188188
<string name="select_token">Select mode</string>
189189
<string name="select_mode">Select mode</string>
190190
<string name="insert">Insert</string>
191+
<string name="enable_ime_keyboard">Enable IME keyboard</string>
192+
<string name="key_ime_keyboard"></string>
191193
</resources>
192194

libCompiler/src/main/res/values-vi/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,5 @@
186186
<string name="insert">Insert</string>
187187
<string name="select_mode">Select mode</string>
188188
<string name="select_token">Select mode</string>
189+
<string name="enable_ime_keyboard">Enable IME keyboard</string>
189190
</resources>

libCompiler/src/main/res/values-zh-rCN/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,6 @@
190190
<string name="select_token">Select mode</string>
191191
<string name="select_mode">Select mode</string>
192192
<string name="insert">Insert</string>
193+
<string name="enable_ime_keyboard">Enable IME keyboard</string>
193194
</resources>
194195

0 commit comments

Comments
 (0)