Hex Artifact Content
Not logged in

Artifact 3be731d6a729c1ac5aac22aabd1500765876d5cd:


0000: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0010: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0020: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0030: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0040: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0050: 0d 0a 41 6e 64 72 6f 57 69 73 68 20 2d 20 54 63  ..AndroWish - Tc
0060: 6c 2f 54 6b 20 38 2e 36 20 70 6f 72 74 20 66 6f  l/Tk 8.6 port fo
0070: 72 20 41 6e 64 72 6f 69 64 0d 0a 3d 3d 3d 3d 3d  r Android..=====
0080: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0090: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
00a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
00b0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
00c0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0d 0a 0d 0a 52  ===========....R
00d0: 65 71 75 69 72 65 6d 65 6e 74 73 3a 0d 0a 0d 0a  equirements:....
00e0: 41 6e 64 72 6f 69 64 20 53 44 4b 20 28 76 65 72  Android SDK (ver
00f0: 73 69 6f 6e 20 31 32 20 6f 72 20 6c 61 74 65 72  sion 12 or later
0100: 29 0d 0a 68 74 74 70 3a 2f 2f 64 65 76 65 6c 6f  )..http://develo
0110: 70 65 72 2e 61 6e 64 72 6f 69 64 2e 63 6f 6d 2f  per.android.com/
0120: 73 64 6b 2f 69 6e 64 65 78 2e 68 74 6d 6c 0d 0a  sdk/index.html..
0130: 0d 0a 41 6e 64 72 6f 69 64 20 4e 44 4b 20 72 37  ..Android NDK r7
0140: 20 6f 72 20 6c 61 74 65 72 0d 0a 68 74 74 70 3a   or later..http:
0150: 2f 2f 64 65 76 65 6c 6f 70 65 72 2e 61 6e 64 72  //developer.andr
0160: 6f 69 64 2e 63 6f 6d 2f 74 6f 6f 6c 73 2f 73 64  oid.com/tools/sd
0170: 6b 2f 6e 64 6b 2f 69 6e 64 65 78 2e 68 74 6d 6c  k/ndk/index.html
0180: 0d 0a 0d 0a 4d 69 6e 69 6d 75 6d 20 41 50 49 20  ....Minimum API 
0190: 6c 65 76 65 6c 20 73 75 70 70 6f 72 74 65 64 20  level supported 
01a0: 62 79 20 53 44 4c 3a 20 31 30 20 28 41 6e 64 72  by SDL: 10 (Andr
01b0: 6f 69 64 20 32 2e 33 2e 33 29 0d 0a 52 65 71 75  oid 2.3.3)..Requ
01c0: 65 73 74 65 64 20 41 50 49 20 6c 65 76 65 6c 20  ested API level 
01d0: 66 72 6f 6d 20 70 72 6f 6a 65 63 74 2e 70 72 6f  from project.pro
01e0: 70 65 72 74 69 65 73 3a 20 31 34 20 28 41 6e 64  perties: 14 (And
01f0: 72 6f 69 64 20 34 2e 30 29 0d 0a 43 50 55 73 20  roid 4.0)..CPUs 
0200: 73 75 70 70 6f 72 74 65 64 20 66 6f 72 20 6e 61  supported for na
0210: 74 69 76 65 20 73 68 61 72 65 64 20 6c 69 62 72  tive shared libr
0220: 61 72 69 65 73 20 28 6a 6e 69 2f 41 70 70 6c 69  aries (jni/Appli
0230: 63 61 74 69 6f 6e 2e 6d 6b 29 3a 20 61 72 6d 65  cation.mk): arme
0240: 61 62 69 20 78 38 36 0d 0a 4a 6f 79 73 74 69 63  abi x86..Joystic
0250: 6b 20 73 75 70 70 6f 72 74 20 69 73 20 61 76 61  k support is ava
0260: 69 6c 61 62 6c 65 20 66 6f 72 20 41 50 49 20 6c  ilable for API l
0270: 65 76 65 6c 20 3e 3d 31 32 20 64 65 76 69 63 65  evel >=12 device
0280: 73 2e 0d 0a 0d 0a 42 75 69 6c 64 69 6e 67 20 66  s.....Building f
0290: 72 6f 6d 20 73 63 72 61 74 63 68 20 72 65 71 75  rom scratch requ
02a0: 69 72 65 73 20 6d 6f 72 65 20 74 68 61 6e 20 38  ires more than 8
02b0: 30 30 20 4d 42 20 64 69 73 6b 20 73 70 61 63 65  00 MB disk space
02c0: 20 6f 6e 20 4c 69 6e 75 78 2e 0d 0a 0d 0a 3d 3d   on Linux.....==
02d0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
02e0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
02f0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0300: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0310: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0d 0a  ==============..
0320: 20 48 6f 77 20 74 68 65 20 70 6f 72 74 20 77 6f   How the port wo
0330: 72 6b 73 0d 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  rks..===========
0340: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0350: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0360: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0370: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0380: 3d 3d 3d 3d 3d 0d 0a 0d 0a 2d 20 41 6e 64 72 6f  =====....- Andro
0390: 69 64 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20  id applications 
03a0: 61 72 65 20 4a 61 76 61 2d 62 61 73 65 64 2c 20  are Java-based, 
03b0: 6f 70 74 69 6f 6e 61 6c 6c 79 20 77 69 74 68 20  optionally with 
03c0: 70 61 72 74 73 20 77 72 69 74 74 65 6e 20 69 6e  parts written in
03d0: 20 43 0d 0a 2d 20 41 73 20 54 63 6c 2f 54 6b 20   C..- As Tcl/Tk 
03e0: 69 73 20 43 2d 62 61 73 65 64 2c 20 61 20 6c 61  is C-based, a la
03f0: 79 65 72 20 75 73 69 6e 67 20 4a 4e 49 20 69 73  yer using JNI is
0400: 20 75 73 65 64 20 74 6f 20 69 6e 74 65 72 66 61   used to interfa
0410: 63 65 20 74 6f 20 74 68 65 20 4a 61 76 61 0d 0a  ce to the Java..
0420: 20 20 75 6e 69 76 65 72 73 65 0d 0a 2d 20 54 68    universe..- Th
0430: 69 73 20 6d 65 61 6e 73 20 74 68 61 74 20 43 20  is means that C 
0440: 63 6f 64 65 20 69 73 20 70 6c 61 63 65 64 20 69  code is placed i
0450: 6e 73 69 64 65 20 61 6e 20 41 6e 64 72 6f 69 64  nside an Android
0460: 20 4a 61 76 61 20 70 72 6f 6a 65 63 74 2c 20 61   Java project, a
0470: 6c 6f 6e 67 0d 0a 20 20 77 69 74 68 20 73 6f 6d  long..  with som
0480: 65 20 43 20 73 75 70 70 6f 72 74 20 63 6f 64 65  e C support code
0490: 20 74 68 61 74 20 63 6f 6d 6d 75 6e 69 63 61 74   that communicat
04a0: 65 73 20 77 69 74 68 20 4a 61 76 61 0d 0a 2d 20  es with Java..- 
04b0: 54 68 65 20 64 72 61 77 69 6e 67 20 6f 6e 20 73  The drawing on s
04c0: 63 72 65 65 6e 20 61 6e 64 20 65 76 65 6e 74 20  creen and event 
04d0: 68 61 6e 64 6c 69 6e 67 20 69 73 20 70 65 72 66  handling is perf
04e0: 6f 72 6d 65 64 20 75 73 69 6e 67 20 53 44 4c 20  ormed using SDL 
04f0: 28 69 6e 63 6c 75 64 65 64 29 2c 0d 0a 20 20 41  (included),..  A
0500: 47 47 20 28 69 6e 63 6c 75 64 65 64 29 2c 20 61  GG (included), a
0510: 6e 64 20 46 72 65 65 74 79 70 65 20 28 69 6e 63  nd Freetype (inc
0520: 6c 75 64 65 64 29 0d 0a 2d 20 54 68 69 73 20 65  luded)..- This e
0530: 76 65 6e 74 75 61 6c 6c 79 20 70 72 6f 64 75 63  ventually produc
0540: 65 73 20 61 20 73 74 61 6e 64 61 72 64 20 41 6e  es a standard An
0550: 64 72 6f 69 64 20 2e 61 70 6b 20 70 61 63 6b 61  droid .apk packa
0560: 67 65 0d 0a 0d 0a 54 68 65 20 41 6e 64 72 6f 69  ge....The Androi
0570: 64 20 4a 61 76 61 20 63 6f 64 65 20 69 6d 70 6c  d Java code impl
0580: 65 6d 65 6e 74 73 20 61 6e 20 22 41 63 74 69 76  ements an "Activ
0590: 69 74 79 22 20 61 6e 64 20 63 61 6e 20 62 65 20  ity" and can be 
05a0: 66 6f 75 6e 64 20 69 6e 3a 0d 0a 0d 0a 73 72 63  found in:....src
05b0: 2f 74 6b 2f 74 63 6c 2f 77 69 73 68 2f 41 6e 64  /tk/tcl/wish/And
05c0: 72 6f 57 69 73 68 2e 6a 61 76 61 0d 0a 73 72 63  roWish.java..src
05d0: 2f 6f 72 67 2f 6c 69 62 73 64 6c 2f 61 70 70 2f  /org/libsdl/app/
05e0: 53 44 4c 41 63 74 69 76 69 74 79 2e 6a 61 76 61  SDLActivity.java
05f0: 0d 0a 0d 0a 54 68 65 20 4a 61 76 61 20 63 6f 64  ....The Java cod
0600: 65 20 6c 6f 61 64 73 20 76 61 72 69 6f 75 73 20  e loads various 
0610: 73 68 61 72 65 64 20 6c 69 62 72 61 72 69 65 73  shared libraries
0620: 20 28 74 63 6c 2c 20 74 6b 2c 20 53 44 4c 2c 20   (tcl, tk, SDL, 
0630: 65 74 63 2e 29 20 61 6e 64 0d 0a 64 69 73 70 61  etc.) and..dispa
0640: 74 63 68 65 73 20 74 6f 20 6e 61 74 69 76 65 20  tches to native 
0650: 66 75 6e 63 74 69 6f 6e 73 20 69 6d 70 6c 65 6d  functions implem
0660: 65 6e 74 65 64 20 69 6e 20 74 68 65 20 53 44 4c  ented in the SDL
0670: 20 6c 69 62 72 61 72 79 3a 0d 0a 0d 0a 6a 6e 69   library:....jni
0680: 2f 53 44 4c 32 2f 73 72 63 2f 63 6f 72 65 2f 61  /SDL2/src/core/a
0690: 6e 64 72 6f 69 64 2f 53 44 4c 5f 61 6e 64 72 6f  ndroid/SDL_andro
06a0: 69 64 2e 63 0d 0a 0d 0a 57 68 69 63 68 20 64 69  id.c....Which di
06b0: 73 70 61 74 63 68 65 73 20 74 6f 20 54 6b 5f 41  spatches to Tk_A
06c0: 70 70 49 6e 69 74 2e 63 20 69 6e 0d 0a 0d 0a 6a  ppInit.c in....j
06d0: 6e 69 2f 73 72 63 2f 74 6b 41 70 70 49 6e 69 74  ni/src/tkAppInit
06e0: 2e 63 0d 0a 0d 0a 54 68 65 20 69 6e 74 65 72 66  .c....The interf
06f0: 61 63 65 20 66 72 6f 6d 20 54 63 6c 2f 54 6b 20  ace from Tcl/Tk 
0700: 74 6f 20 41 6e 64 72 6f 69 64 20 69 73 20 6d 61  to Android is ma
0710: 69 6e 6c 79 20 63 6f 6e 74 61 69 6e 65 64 20 69  inly contained i
0720: 6e 20 74 68 65 20 66 69 6c 65 73 0d 0a 0d 0a 6a  n the files....j
0730: 6e 69 2f 73 72 63 2f 74 6b 42 6f 72 67 2e 63 0d  ni/src/tkBorg.c.
0740: 0a 6a 6e 69 2f 73 72 63 2f 74 63 6c 52 66 63 6f  .jni/src/tclRfco
0750: 6d 6d 2e 63 0d 0a 6a 6e 69 2f 73 72 63 2f 74 63  mm.c..jni/src/tc
0760: 6c 55 73 62 73 65 72 69 61 6c 2e 63 0d 0a 0d 0a  lUsbserial.c....
0770: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0780: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0790: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
07a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
07b0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
07c0: 0d 0a 20 42 75 69 6c 64 69 6e 67 20 61 6e 64 20  .. Building and 
07d0: 72 75 6e 6e 69 6e 67 20 41 6e 64 72 6f 57 69 73  running AndroWis
07e0: 68 0d 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  h..=============
07f0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0800: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0810: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0820: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0830: 3d 3d 3d 0d 0a 0d 0a 31 2e 20 52 65 66 72 65 73  ===....1. Refres
0840: 68 20 74 68 65 20 70 72 6f 6a 65 63 74 20 73 65  h the project se
0850: 74 74 69 6e 67 73 20 75 73 69 6e 67 20 74 68 65  ttings using the
0860: 20 61 6e 64 72 6f 69 64 20 63 6f 6d 6d 61 6e 64   android command
0870: 20 66 72 6f 6d 20 41 6e 64 72 6f 69 64 20 53 44   from Android SD
0880: 4b 3a 0d 0a 0d 0a 20 20 20 61 6e 64 72 6f 69 64  K:....   android
0890: 20 75 70 64 61 74 65 20 70 72 6f 6a 65 63 74 0d   update project.
08a0: 0a 0d 0a 32 2e 20 52 65 76 69 65 77 20 6c 6f 63  ...2. Review loc
08b0: 61 6c 2e 70 72 6f 70 65 72 74 69 65 73 20 74 6f  al.properties to
08c0: 20 70 6f 69 6e 74 20 74 6f 20 74 68 65 20 64 69   point to the di
08d0: 72 65 63 74 6f 72 79 20 77 68 65 72 65 20 41 6e  rectory where An
08e0: 64 72 6f 69 64 20 53 44 4b 20 72 65 73 69 64 65  droid SDK reside
08f0: 73 0d 0a 0d 0a 33 2e 20 55 73 65 20 61 6e 74 20  s....3. Use ant 
0900: 74 6f 20 62 75 69 6c 64 20 41 6e 64 72 6f 57 69  to build AndroWi
0910: 73 68 20 66 72 6f 6d 20 73 63 72 61 74 63 68 20  sh from scratch 
0920: 28 63 75 72 72 65 6e 74 6c 79 20 6f 6e 6c 79 20  (currently only 
0930: 64 65 62 75 67 20 76 65 72 73 69 6f 6e 29 3a 0d  debug version):.
0940: 0a 0d 0a 20 20 20 61 6e 74 20 64 65 62 75 67 0d  ...   ant debug.
0950: 0a 0d 0a 20 20 20 54 68 69 73 20 69 6e 63 6c 75  ...   This inclu
0960: 64 65 73 20 62 75 69 6c 64 69 6e 67 20 74 68 65  des building the
0970: 20 43 20 6c 69 62 72 61 72 69 65 73 20 75 73 69   C libraries usi
0980: 6e 67 20 41 6e 64 72 6f 69 64 20 4e 44 4b 2e 20  ng Android NDK. 
0990: 54 68 61 74 20 73 74 65 70 0d 0a 20 20 20 63 61  That step..   ca
09a0: 6e 20 62 65 20 70 65 72 66 6f 72 6d 65 64 20 73  n be performed s
09b0: 65 70 61 72 61 74 65 6c 79 20 62 79 20 72 75 6e  eparately by run
09c0: 6e 69 6e 67 20 6e 64 6b 2d 62 75 69 6c 64 20 69  ning ndk-build i
09d0: 6e 20 74 68 65 20 6a 6e 69 20 64 69 72 65 63 74  n the jni direct
09e0: 6f 72 79 2c 0d 0a 20 20 20 6f 72 20 62 79 20 69  ory,..   or by i
09f0: 6e 76 6f 6b 69 6e 67 20 22 61 6e 74 20 6e 64 6b  nvoking "ant ndk
0a00: 2d 62 75 69 6c 64 22 2e 0d 0a 20 20 20 54 68 65  -build"...   The
0a10: 20 43 20 6c 69 62 72 61 72 69 65 73 20 61 72 65   C libraries are
0a20: 20 62 75 69 6c 64 20 66 6f 72 20 41 52 4d 20 61   build for ARM a
0a30: 6e 64 20 78 38 36 20 28 41 74 6f 6d 29 20 70 72  nd x86 (Atom) pr
0a40: 6f 63 65 73 73 6f 72 73 20 77 68 69 63 68 20 63  ocessors which c
0a50: 61 6e 0d 0a 20 20 20 62 65 20 63 68 61 6e 67 65  an..   be change
0a60: 64 20 69 6e 20 6a 6e 69 2f 41 70 70 6c 69 63 61  d in jni/Applica
0a70: 74 69 6f 6e 2e 6d 6b 0d 0a 0d 0a 34 2e 20 49 6e  tion.mk....4. In
0a80: 73 74 61 6c 6c 20 41 6e 64 72 6f 57 69 73 68 20  stall AndroWish 
0a90: 6f 6e 20 65 6d 75 6c 61 74 6f 72 20 6f 72 20 64  on emulator or d
0aa0: 65 76 69 63 65 3a 0d 0a 0d 0a 20 20 20 61 64 62  evice:....   adb
0ab0: 20 69 6e 73 74 61 6c 6c 20 2d 72 20 62 69 6e 2f   install -r bin/
0ac0: 41 6e 64 72 6f 57 69 73 68 2d 64 65 62 75 67 2e  AndroWish-debug.
0ad0: 61 70 6b 0d 0a 0d 0a 35 2e 20 53 74 61 72 74 20  apk....5. Start 
0ae0: 41 6e 64 72 6f 57 69 73 68 20 6f 6e 20 65 6d 75  AndroWish on emu
0af0: 6c 61 74 6f 72 20 6f 72 20 64 65 76 69 63 65 20  lator or device 
0b00: 75 73 69 6e 67 20 61 64 62 20 66 72 6f 6d 20 64  using adb from d
0b10: 65 76 65 6c 6f 70 6d 65 6e 74 20 73 79 73 74 65  evelopment syste
0b20: 6d 3a 0d 0a 0d 0a 20 20 20 61 64 62 20 73 68 65  m:....   adb she
0b30: 6c 6c 20 61 6d 20 73 74 61 72 74 20 74 6b 2e 74  ll am start tk.t
0b40: 63 6c 2e 77 69 73 68 2f 2e 41 6e 64 72 6f 57 69  cl.wish/.AndroWi
0b50: 73 68 4c 61 75 6e 63 68 65 72 0d 0a 0d 0a 36 2e  shLauncher....6.
0b60: 20 43 6c 65 61 6e 20 74 68 65 20 62 75 69 6c 64   Clean the build
0b70: 20 74 72 65 65 3a 0d 0a 0d 0a 20 20 20 61 6e 74   tree:....   ant
0b80: 20 63 6c 65 61 6e 0d 0a 0d 0a                     clean....