Check-in [6a0066556d]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Location service added
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6a0066556d27dc3f18e7be4c3774f7897acc0a1e
User & Date: bernd 2014-01-10 23:04:17.030
Context
2014-01-11
00:17
negative .deg fixed check-in: fc5488ed40 user: bernd tags: trunk
2014-01-10
23:04
Location service added check-in: 6a0066556d user: bernd tags: trunk
18:38
Removed unused libraries check-in: 3e6683c6bb user: bernd tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to gles2/.libs/libsoil.so.

cannot compute difference between binary files

Changes to gles2/android.fs.
324
325
326
327
328
329
330
331


332
333
334
335
336
337
338
339
340
341
342
	    ELSE  drop  getKeyCode  keycode>keys  unkeys
	    THEN
	THEN
    THEN o> ;

Defer android-touch ( event -- )
' drop IS android-touch



Defer android-location ( location -- )
' drop IS android-location

:noname ( event type -- )
    CASE
	0 OF  android-key       ENDOF
	1 OF  android-touch     ENDOF
	2 OF  android-location  ENDOF
    ENDCASE  drop ; is akey

previous previous set-current








>
>

|






|


324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
	    ELSE  drop  getKeyCode  keycode>keys  unkeys
	    THEN
	THEN
    THEN o> ;

Defer android-touch ( event -- )
' drop IS android-touch

0 Value location

Defer android-location ( location -- )
:noname to location ; IS android-location

:noname ( event type -- )
    CASE
	0 OF  android-key       ENDOF
	1 OF  android-touch     ENDOF
	2 OF  android-location  ENDOF
    nip ENDCASE ; is akey

previous previous set-current
Changes to gles2/jni-helper.fs.
1
2
3
4
5
6
7


8


9
10
11
12
13
14
15
\ show/hide keyboard using jni tools

require jni-tools.fs

also android also jni

app activity @ ANativeActivity-clazz @ dup Value clazz


env tuck JNIEnv-getObjectClass() to jniclass



\ jni-sfield: INPUT_METHOD_SERVICE INPUT_METHOD_SERVICE Ljava/lang/String;
\ jni-sfield: POWER_SERVICE POWER_SERVICE Ljava/lang/String;
: INPUT_METHOD_SERVICE js" input_method" ;
: POWER_SERVICE        js" power" ;
: LOCATION_SERVICE     js" location" ;







|
>
>
|
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
\ show/hide keyboard using jni tools

require jni-tools.fs

also android also jni

app activity @ ANativeActivity-clazz @ Value clazz

: gforth-class: ( -- )
    clazz env tuck JNIEnv-getObjectClass() to jniclass ;

gforth-class:

\ jni-sfield: INPUT_METHOD_SERVICE INPUT_METHOD_SERVICE Ljava/lang/String;
\ jni-sfield: POWER_SERVICE POWER_SERVICE Ljava/lang/String;
: INPUT_METHOD_SERVICE js" input_method" ;
: POWER_SERVICE        js" power" ;
: LOCATION_SERVICE     js" location" ;

40
41
42
43
44
45
46





47
48
49
50
51
52
53
jni-method: getUnicodeChar(I) getUnicodeChar (I)I
jni-method: getUnicodeChar getUnicodeChar ()I
jni-method: getKeyCode getKeyCode ()I
jni-method: getCharacters getCharacters ()Ljava/lang/String;
jni-method: getAction getAction ()I
jni-method: isLongPress isLongPress ()Z






: getUnicodeKey { event -- key }
    event AKeyEvent_getAction event AKeyEvent_getKeyCode newKeyEvent >o
    event AKeyEvent_getMetaState getUnicodeChar(I) o> ;

Variable kbflag

: togglekb ( -- )







>
>
>
>
>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
jni-method: getUnicodeChar(I) getUnicodeChar (I)I
jni-method: getUnicodeChar getUnicodeChar ()I
jni-method: getKeyCode getKeyCode ()I
jni-method: getCharacters getCharacters ()Ljava/lang/String;
jni-method: getAction getAction ()I
jni-method: isLongPress isLongPress ()Z

jni-class: java/util/List

jni-method: l-get get (I)Ljava/lang/Object;
jni-method: l-size size ()I

: getUnicodeKey { event -- key }
    event AKeyEvent_getAction event AKeyEvent_getKeyCode newKeyEvent >o
    event AKeyEvent_getMetaState getUnicodeChar(I) o> ;

Variable kbflag

: togglekb ( -- )
Changes to gles2/jni-location.fs.
1
2


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

25

26


















27















\ location services



also jni

jni-class: android/location/Location

jni-method: getAccuracy getAccuracy ()F
jni-method: getAltitude getAltitude ()D
jni-method: getBearing getBearing ()F
jni-method: getAltitude getAltitude ()D
jni-method: getLatitude getLatitude ()D
jni-method: getLongitude getLongitude ()D
jni-method: getProvider getProvider ()Ljava/lang/String;
jni-method: getSpeed getSpeed ()F
jni-method: getTime getTime ()J

jni-class: android/location/LocationManager

jni-method: getAllProviders getAllProviders ()Ljava/util/List;
jni-method: getProviders getProviders (Z)Ljava/util/List;
jni-method: getProvider getProvider (Ljava/lang/String;)Landroid/location/LocationProvider;
jni-method: requestLocationUpdates requestLocationUpdates (Ljava/lang/String;JFLandroid/location/LocationListener;)V
jni-method: getLastKnownLocation getLastKnownLocation (Ljava/lang/String;)Landroid/location/Location;
jni-method: removeUpdates removeUpdates (Landroid/location/LocationListener;)V






















previous

















>
>





<












|
<

|
>

>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
\ location services

require jni-helper.fs

also jni

jni-class: android/location/Location

jni-method: getAccuracy getAccuracy ()F

jni-method: getBearing getBearing ()F
jni-method: getAltitude getAltitude ()D
jni-method: getLatitude getLatitude ()D
jni-method: getLongitude getLongitude ()D
jni-method: getProvider getProvider ()Ljava/lang/String;
jni-method: getSpeed getSpeed ()F
jni-method: getTime getTime ()J

jni-class: android/location/LocationManager

jni-method: getAllProviders getAllProviders ()Ljava/util/List;
jni-method: getProviders getProviders (Z)Ljava/util/List;
jni-method: lm-getProvider getProvider (Ljava/lang/String;)Landroid/location/LocationProvider;

jni-method: getLastKnownLocation getLastKnownLocation (Ljava/lang/String;)Landroid/location/Location;

jni-class: android/os/Handler

jni-method: post post (Ljava/lang/Runnable;)Z

gforth-class:

jni-field: gforth-handler handler Landroid/os/Handler;
jni-field: startgps startgps Ljava/lang/Runnable;
jni-field: stopgps stopgps Ljava/lang/Runnable;

jni-method: setgps setgps (JF)V

also android

: start-gps ( -- )
    clazz >o gforth-handler o> >o
    clazz >o startgps o> post o> ;

: stop-gps ( -- )
    clazz >o gforth-handler o> >o
    clazz >o stopgps o> post o> ;

previous previous

: .deg ( degree -- )
    fdup floor fdup f>s 0 .r '°' xemit f-  60e f*
    fdup floor fdup f>s 0 .r ''' xemit f-  60e f*
    f. ;

: .location ( -- )  location >o
    ." Lat: " getLatitude .deg cr
    ." Lon: " getLongitude .deg cr
    ." Alt: " getAltitude f. cr
    ." Spd: " getSpeed f. cr
    ." Dir: " getBearing f. cr
    ." Tme: " getTime d. cr
    ." Acc: " getAccuracy f. cr
    o> ;
Changes to gles2/jni-media.fs.
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
jni-static: cp-get(id) get (II)Landroid/media/CamcorderProfile;

jni-class: android/hardware/Camera$Size

jni-field: height height I
jni-field: width width I

jni-class: java/util/List

jni-method: l-get get (I)Ljava/lang/Object;
jni-method: l-size size ()I

previous

0 Value media-sft

: create-sft ( -- ) media-sft ?EXIT
    media-tex current-tex new-SurfaceTexture to media-sft ;







<
<
<
<
<






99
100
101
102
103
104
105





106
107
108
109
110
111
jni-static: cp-get(id) get (II)Landroid/media/CamcorderProfile;

jni-class: android/hardware/Camera$Size

jni-field: height height I
jni-field: width width I






previous

0 Value media-sft

: create-sft ( -- ) media-sft ?EXIT
    media-tex current-tex new-SurfaceTexture to media-sft ;
Changes to jni-location.fs.
1
2


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

25

26


















27















\ location services



also jni

jni-class: android/location/Location

jni-method: getAccuracy getAccuracy ()F
jni-method: getAltitude getAltitude ()D
jni-method: getBearing getBearing ()F
jni-method: getAltitude getAltitude ()D
jni-method: getLatitude getLatitude ()D
jni-method: getLongitude getLongitude ()D
jni-method: getProvider getProvider ()Ljava/lang/String;
jni-method: getSpeed getSpeed ()F
jni-method: getTime getTime ()J

jni-class: android/location/LocationManager

jni-method: getAllProviders getAllProviders ()Ljava/util/List;
jni-method: getProviders getProviders (Z)Ljava/util/List;
jni-method: getProvider getProvider (Ljava/lang/String;)Landroid/location/LocationProvider;
jni-method: requestLocationUpdates requestLocationUpdates (Ljava/lang/String;JFLandroid/location/LocationListener;)V
jni-method: getLastKnownLocation getLastKnownLocation (Ljava/lang/String;)Landroid/location/Location;
jni-method: removeUpdates removeUpdates (Landroid/location/LocationListener;)V






















previous

















>
>





<












|
<

|
>

>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
\ location services

require jni-helper.fs

also jni

jni-class: android/location/Location

jni-method: getAccuracy getAccuracy ()F

jni-method: getBearing getBearing ()F
jni-method: getAltitude getAltitude ()D
jni-method: getLatitude getLatitude ()D
jni-method: getLongitude getLongitude ()D
jni-method: getProvider getProvider ()Ljava/lang/String;
jni-method: getSpeed getSpeed ()F
jni-method: getTime getTime ()J

jni-class: android/location/LocationManager

jni-method: getAllProviders getAllProviders ()Ljava/util/List;
jni-method: getProviders getProviders (Z)Ljava/util/List;
jni-method: lm-getProvider getProvider (Ljava/lang/String;)Landroid/location/LocationProvider;

jni-method: getLastKnownLocation getLastKnownLocation (Ljava/lang/String;)Landroid/location/Location;

jni-class: android/os/Handler

jni-method: post post (Ljava/lang/Runnable;)Z

gforth-class:

jni-field: gforth-handler handler Landroid/os/Handler;
jni-field: startgps startgps Ljava/lang/Runnable;
jni-field: stopgps stopgps Ljava/lang/Runnable;

jni-method: setgps setgps (JF)V

also android

: start-gps ( -- )
    clazz >o gforth-handler o> >o
    clazz >o startgps o> post o> ;

: stop-gps ( -- )
    clazz >o gforth-handler o> >o
    clazz >o stopgps o> post o> ;

previous previous

: .deg ( degree -- )
    fdup floor fdup f>s 0 .r '°' xemit f-  60e f*
    fdup floor fdup f>s 0 .r ''' xemit f-  60e f*
    f. ;

: .location ( -- )  location >o
    ." Lat: " getLatitude .deg cr
    ." Lon: " getLongitude .deg cr
    ." Alt: " getAltitude f. cr
    ." Spd: " getSpeed f. cr
    ." Dir: " getBearing f. cr
    ." Tme: " getTime d. cr
    ." Acc: " getAccuracy f. cr
    o> ;
Changes to jni-media.fs.
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
jni-static: cp-get(id) get (II)Landroid/media/CamcorderProfile;

jni-class: android/hardware/Camera$Size

jni-field: height height I
jni-field: width width I

jni-class: java/util/List

jni-method: l-get get (I)Ljava/lang/Object;
jni-method: l-size size ()I

previous

0 Value media-sft

: create-sft ( -- ) media-sft ?EXIT
    media-tex current-tex new-SurfaceTexture to media-sft ;







<
<
<
<
<






99
100
101
102
103
104
105





106
107
108
109
110
111
jni-static: cp-get(id) get (II)Landroid/media/CamcorderProfile;

jni-class: android/hardware/Camera$Size

jni-field: height height I
jni-field: width width I






previous

0 Value media-sft

: create-sft ( -- ) media-sft ?EXIT
    media-tex current-tex new-SurfaceTexture to media-sft ;