Commit graph

10459 commits

Author SHA1 Message Date
Eric House
4a3133924a name change for clarity 2017-11-11 09:14:35 -08:00
Eric House
0831bd8022 talk to relay.py/kill, first web api use from android
And it seems to work!
2017-11-11 08:22:52 -08:00
Eric House
31123b72ce fix failure to notify relay of half-game deletion
Wasn't detecting as a relay game something registered on relay but not
yet joined by another device, a common case!
2017-11-11 08:13:29 -08:00
Eric House
da3f6db9e4 fix failure to notify relay of half-game deletion
Wasn't detecting as a relay game something registered on relay but not
yet joined by another device, a common case!
2017-11-11 08:10:48 -08:00
Eric House
acf668ae8a add new prefs controlling web api usage
Add, but don't use yet, prefs giving relay.py path and checkbox whether
to use the new APIs.
2017-11-10 22:16:15 -08:00
Eric House
f2c4c82129 a shot at no-conn connecting
Ideally the comms module wouldn't go through its connecting routine in
order to join a game. To that end I added a join() method to relay.py
and code to call it. Joins happen (pairing games, starting new ones,
etc.), but after that communication doesn't. First part of fixing that
would be to make cookieID persistent and transmit it back with the rest
of what join sends (since it's used by all the messages currently sent
in a connected state), but I suspect there's more to be done, and even
that requires a fair number of changes on the relay side. So all that's
wrapped in #ifdef RELAY_VIA_HTTP (and turned off.)
2017-11-10 21:34:02 -08:00
Eric House
ecc247d56d fix a couple of obvious bugs 2017-11-10 20:30:25 -08:00
Eric House
d1e6a0d1d3 fix seed comparison: ints vs strings
Was coming in as a string when called via curl. This may be a problem
for other ints if I go with lots of params instead of a json, which is
looking less likely.
2017-11-09 06:47:33 -08:00
Eric House
d0dd7a2c02 new columns required by relay.py's join() 2017-11-08 08:07:47 -08:00
Eric House
205adf0d0f add prototype of join()
join's how devices will create or join existing games. It more
compilicated than I'd like but seems to work except that once a slot's
assigned it's unavailable to anybody else even if the other fails ever
to respond (i.e. needs the ACK function of the c++ relay.)
2017-11-08 08:04:57 -08:00
Eric House
6c8b9d5277 fix query syntax: % operator bad 2017-11-07 07:34:06 -08:00
Eric House
c661c8a74e basic join() (inserting/updating game records) works 2017-11-07 07:33:04 -08:00
Eric House
e6acd0fbcc beginnings of new relay: shows persistence
Mostly comments, it's where I'll start to think about the API for a
web-app version of the relay. The server itself ought to exist
already.
2017-11-05 19:24:41 -08:00
Eric House
02f05dc867 fix to compile with UDP packet logged
to match up with delivery on client
2017-11-04 09:27:33 -07:00
Eric House
7efcdf0cb8 script for tracking message delivery
The http-based comms flow is stalling. This will help figure out why.
2017-11-04 09:27:33 -07:00
Eric House
1648c9b3e3 tweak to start GTK games and run a long time
I'm trying to fix game-start-time right now....
2017-11-04 09:27:33 -07:00
Eric House
3a2953427a combine adjacent QUERY tasks
Trying to reduce the size of the queue. Eventually the lists of relayIDs
will need to be merged.
2017-11-04 09:27:33 -07:00
Eric House
c4312a2158 new files that may replace GSList in relaycon
If I want to move relaycon into common so Android can use it (assuming
the jni code starts including json-c and libcurl so it can handle
networking) I'll need a replacement for GSList. This is a start.
2017-11-04 09:27:33 -07:00
Eric House
9f5f5da29c add more required debs 2017-11-03 18:07:12 -07:00
Eric House
24171d8317 log more about tasks 2017-11-02 07:16:51 -07:00
Eric House
3dfd419ec7 relay returning NOTHING is a thing; deal with it 2017-11-02 07:16:11 -07:00
Eric House
55f5b500e3 cleanup: method names and logging 2017-11-02 06:19:35 -07:00
Eric House
66d6240ece better git revision fallback 2017-11-01 06:12:04 -07:00
Eric House
220918e5cd fix to compile with gdk3.2 (latest Debian) 2017-11-01 05:16:32 -07:00
Eric House
61937ac2d0 use float consistently
timeout of 0 was not making the relay.py script happy
2017-10-31 20:07:12 -07:00
Eric House
a1433e5f3d add kill to relay.py; call from test script using curl
It'll eventually get called from Android and maybe linux, but for now
it's cool to have games disappear from the showinplay display when
they're done.
2017-10-31 20:05:07 -07:00
Eric House
8aeba861cf fix script to move db files again 2017-10-31 06:38:32 -07:00
Eric House
23f0d54f63 tweaks: add comment; show only pending messages 2017-10-30 19:07:13 -07:00
Eric House
d2897d6dc8 fix to match format of empty return case 2017-10-30 19:06:38 -07:00
Eric House
8ee17493ac log length of task lifetime
Need to figure out where the delays are.
2017-10-30 07:12:34 -07:00
Eric House
3d3a986dbd log count of tasks abandoned in queue on shutdown
This confirms that I need to process outgoing messages more quickly,
likely by combining them.
2017-10-29 09:46:51 -07:00
Eric House
1373d0b1db make min-run configurable
With the new http stuff, at least for now, it takes longer to get things
communicated and so killing games after 2 seconds of runtime meant no
moves ever got made. Making it configurable, and passing 10 (seconds)
means nearly all games in a large test run complete reasonably quickly.
2017-10-29 09:26:07 -07:00
Eric House
7b50c90aac pass timeoutSeconds
ACK doesn't need to wait 2 seconds for a reply, and when it does so the
next send waits too. Eventually we'll want to combine messages already
in the queue into a single send. For now, this makes things better.
2017-10-28 20:12:05 -07:00
Eric House
7c22d1fdf8 fix failure of http apps to ack relay
Change how acks are handled by adding ability to look up connname by
combination of hid and token. It's a bit of a hack, but it's already
there in the protocol and enough to find the game.
2017-10-28 16:29:04 -07:00
Eric House
3e9381d946 use a single timer and a queue for received data
using g_add_idle() for each piece of data received on the (background)
curl-query thread wasn't working. They were getting starved, and I think
some were considered duplicates and never scheduled. So add a single
timer proc called every 50 ms and a queue that it checks and into which
the network thread can put stuff.
2017-10-28 16:13:11 -07:00
Eric House
7d4fb1cc5d get rid of last [] from map access 2017-10-28 15:36:33 -07:00
Eric House
3215affd68 tweaks to test script 2017-10-28 15:31:17 -07:00
Eric House
e3b2a0e4e1 fix misbehavior by new in-memory map
I don't know why what I was doing didn't work, but removing access via
[] and using iterators passes all the asserts I could throw at it.
2017-10-28 15:01:31 -07:00
Eric House
952272172a always log bytes sent 2017-10-27 05:58:35 -07:00
Eric House
a8f06b53e2 test script; log threadid 2017-10-27 05:57:40 -07:00
Eric House
3645331061 pass hid in to db function getting per-dev info
Somehow I've been failing to treat this column as an array for some
time. I don't have any test cases that failed but it was clearly
wrong. Test cases still pass....
2017-10-25 20:33:25 -07:00
Eric House
051b6a7220 change resign-ratio to resign-pct
To match the way other pct stuff works, in part because it seemed it
didn't.
2017-10-25 20:00:55 -07:00
Eric House
6e06fdea07 stop storing cid in database
It's a runtime-only thing, explicitly removed from db on boot. So add a
map from connname->cid to the dbmgr class and modify that rather than a
column. Passes discon_ok2.sh tests as long as use-http stuff isn't on.
2017-10-25 19:56:56 -07:00
Eric House
14d9063ad0 add --room to error message/hint 2017-10-25 06:43:10 -07:00
Eric House
81df91c4db add commandline option to spec log dir location 2017-10-25 06:34:55 -07:00
Eric House
d05a67ed4b switch to milliseconds 2017-10-25 06:15:46 -07:00
Eric House
cc54621e45 store message first, remove on ack 2017-10-25 05:51:45 -07:00
Eric House
c68a067009 add option to not check moves except manually 2017-10-24 19:18:19 -07:00
Eric House
6ff13e6e23 move 'check moves' menu to main window 2017-10-24 19:14:23 -07:00
Eric House
342d229be1 refactor 2017-10-24 07:07:22 -07:00
Eric House
28bec6d456 implement checkForMoves menu again 2017-10-24 06:20:08 -07:00
Eric House
2cfac68f91 leave out entries without relayIDs
SQL is the easiest place to filter
2017-10-23 21:08:14 -07:00
Eric House
c3887b9c77 use a single thread and a protected queue
I don't want race conditions between threads talking to the server.
2017-10-23 21:07:05 -07:00
Eric House
6787fe1406 fix length byte 2017-10-22 21:29:16 -07:00
Eric House
4583b5d88d use ! with struct instead of ntohs 2017-10-22 15:47:01 -07:00
Eric House
4c15723f90 add http option to test script 2017-10-22 11:43:56 -07:00
Eric House
16ee3e9439 rename and make self-initing 2017-10-22 10:05:36 -07:00
Eric House
523fd26eee make relay hostname configurable 2017-10-22 09:58:01 -07:00
Eric House
f49c81462c wip: received messages dispatched to games 2017-10-22 09:29:15 -07:00
Eric House
43ffb156fc wip: successfully get list of moves 2017-10-22 07:30:14 -07:00
Eric House
47a048d553 fetch relayIDs from db 2017-10-21 16:05:54 -07:00
Eric House
a65af79953 add check for being on main thread 2017-10-21 15:23:46 -07:00
Eric House
ec7fde3b62 add relayID to DB and to table 2017-10-21 14:59:10 -07:00
Eric House
a6602fabe0 hide menuitem when not in http mode 2017-10-21 14:24:38 -07:00
Eric House
284888df44 add timeoutSecs param 2017-10-21 12:13:19 -07:00
Eric House
37162e0471 fix curses commit; refactor & cleanup 2017-10-21 12:11:26 -07:00
Eric House
816df4336c run post in thread since it takes time 2017-10-20 06:26:46 -07:00
Eric House
3045697d31 wip: process moves received 2017-10-19 21:20:14 -07:00
Eric House
5223ccabe1 add option to run forever 2017-10-19 20:50:33 -07:00
Allan Nordhøy
ebe594ed1d Added translation using Weblate (Norwegian Bokmål) 2017-10-19 11:48:34 +02:00
Eric House
4a1e51b54a call query from C
Very rough code that fetches messages and does nothing with them.
2017-10-18 22:03:14 -07:00
Eric House
7414e0eeae param should be json array as string 2017-10-18 22:02:14 -07:00
Eric House
9b486d77fb shrink column to shrink display 2017-10-18 21:19:42 -07:00
Eric House
3ffef37d77 don't require myKey.py 2017-10-18 21:19:09 -07:00
Eric House
fbaa1f139e add test method and implement query() endpoint 2017-10-18 21:18:30 -07:00
Eric House
e6e93c09ab oops: use the right length 2017-10-18 07:19:43 -07:00
Eric House
c08be98fda wip: include multiple packets in reponse json 2017-10-18 07:09:05 -07:00
Eric House
b86ffeb2b9 wip: data gets to relay and response handled
A device registers and a game can start. But we don't get to being
able to make a move yet.
2017-10-18 06:53:15 -07:00
Eric House
2dc80ac93f talk to new python script to interface with relay
So far uses curl and json-c to send b64-encoded data to new script
which is able to echo the data. Next that script will need to open a
UDP socket to the relay and return results that appear before timeout.
2017-10-17 21:32:11 -07:00
Andreas Kleinert
b7c72dd1e6 Translated using Weblate (German)
Currently translated at 8.4% (62 of 738 strings)
2017-10-17 20:45:54 +02:00
Eric House
6b0fe35c8f use readFully() rather than read()
readFully() blocks; read() can return with less than you expect.
2017-10-16 22:12:35 -07:00
Eric House
927c4f12a0 make tap on thumbnail select/deselect
Working around there being a border around the game-type image area.
With this change long-tapping works only on the right 2/3 of the
region. There might be a fix, but it's still better than there being
a hole (the border) in the thing where behavior's different.
2017-10-14 14:31:41 -07:00
Eric House
fd3220c1c2 Merge branch 'android_branch' of github.com:eehouse/xwords into android_branch 2017-10-12 21:15:08 -07:00
Eric House
1e38069b94 update script seen by those without the app installed 2017-10-12 21:14:07 -07:00
Eric House
c7f0090e15 fix script that makes the db
I've had it wrong all these years. Thanks Dave!
2017-10-10 20:36:36 -07:00
Eric House
37ecd81c04 change param names
about to introduce a second. This will make things clearer. No code
change here though.
2017-10-10 20:17:36 -07:00
Eric House
0a774625a1 cleanup 2017-10-10 20:17:36 -07:00
Eric House
4717308c4d make new installs easier
Add make target and script option to install debs
2017-10-10 19:56:22 -07:00
Eric House
36aef059c1 remove assertion: deviceID can change
Hit this nuking the devices table mid-game. Games recover with the
assertion removed (and storing the new/non-matching deviceID)
2017-10-07 10:47:44 -07:00
Eric House
3e8839636e preserve hid when recreating games
When a device reconnects and there's no record for its
game (e.g. because an ISP's screwed up and the db and its host are
lost), recreate but keep the device's hid (position in the arrays
indicating mostly whether it's the inviter or invitee.) Tested by
running the linux scripts and deleting the games table mid-way
through, but not yet tested with android devices.
2017-10-07 10:14:27 -07:00
Eric House
2cabf2332c fix compiler-found (but trivial) error
debian's new compiler rocks. Effected only test code I never use, but
still nice to fix.
2017-10-07 08:03:18 -07:00
Eric House
c9a86a23e0 remove GCM-related receiver from shared manifest
Duh. The .java file was removed, but the declaration that all apps can
handle an intent (that requires WakeLock they no longer all have) was
not. Should fix crashes I'm seeing.
2017-09-28 20:02:05 -07:00
Eric House
bbffe4caf1 Add assert prior to removing dead (?) code
There should no longer be a need for curThis(), but let's confim by
asserting for a while.
2017-09-28 06:51:59 -07:00
Eric House
a3bf942004 fix assertion by not handling Action
Was wrong to assert that unexpected Actions never arrived.
2017-09-28 06:51:24 -07:00
Eric House
79e852a9eb change ID of duplicate menu
Board and Games List were using same menuid which meant that even when
chosen from Board's menu it would up getting handled by GamesList (in
dual-pane mode.)
2017-09-28 06:50:16 -07:00
Eric House
d3b9a98518 fix to serve the oldest release newer than current
Removing hard-coded list of release .apks in favor of picking them from
the file system based on version code reported by aapt.
2017-09-27 20:39:58 -07:00
Eric House
7b691dfd2f offer to hide buttons when invoked from action bar 2017-09-26 07:34:54 -07:00
Eric House
604119f99b stub out GCMIntentService for d variant
Somehow the d variant was crashing without the WAKELOCK permission, the
OS having invokes something GCM-related. This should ensure nothing
GCM-related can ever happen.
2017-09-26 07:01:55 -07:00
Eric House
6fa01eb971 move GCM-related permissions into new manifest
Create an AndroidManifest.xml specific for the xw4 variant, and move the
GCM-related permissions (including WakeLock) into it.
2017-09-25 06:17:44 -07:00
Eric House
fd7f564e11 add debug menu to copy git info to clipboard
Makes it easier to find out what the diffs were.
2017-09-24 14:40:31 -07:00
Eric House
096aa3bd0f make GCM_SENDER_ID empty for xw4d variant build
This seems to fix that app, when built by me where GCM_SENDER_ID's set
in the environment, being a battery hog. Apparently google's code
doesn't handle being passed the wrong senderID very well.
2017-09-24 14:30:59 -07:00
Eric House
9bdf43a89e remove duplicated BuildConfig entry 2017-09-22 06:55:02 -07:00
Eric House
5dc9327d31 record current git-diff in assets 2017-09-22 06:46:19 -07:00
Eric House
618ee89add fix crash drawing game timer
It's outside the normal begin_/end_draw flow and so cairo wasn't set up
as expected.
2017-09-20 07:26:26 -07:00
Eric House
592a6429d4 up changelog and version strings 2017-09-20 06:40:42 -07:00
Eric House
39efbaa7f5 fix timer-draw NPE due to race condition
use runOnUiThread()....
2017-09-19 22:09:57 -07:00
Eric House
a328221b63 up version codes for new release
I somehow screwed up the last release, but google got the apk so
requires me to change the version number.
2017-09-19 07:46:17 -07:00
Eric House
dc29321b28 change strings for new release 2017-09-13 08:06:08 -07:00
Eric House
e98c25a81a fix crash by removing assert I didn't need
Looks like what I was worried about wasn't an issue.
2017-09-13 07:39:07 -07:00
Eric House
baf549189c add compile-time option for forcing square board
Disabled. Needed it for a test.
2017-09-13 07:38:22 -07:00
Eric House
ae25c6e014 fix list item breakage: no inputType for TextView
I'd added inputType="text" everywhere I added maxLines="1" but it turns
out that breaks touches being handled at least on some devices. And it
makes no sense to have an inputType for something user can't put into.
2017-09-12 07:56:40 -07:00
Eric House
058d3a7828 try to fix travis: copy over .enc file 2017-09-11 06:47:59 -07:00
Eric House
8efd608ac2 fold in (as diff, not merge) travis config 2017-09-11 06:16:47 -07:00
Eric House
54997f6db2 more EditText fixing 2017-09-07 07:51:57 -07:00
Eric House
2de54a2535 fix script for a gradle world 2017-09-07 07:45:33 -07:00
Eric House
d87a1ca7a8 fix EditText so monkey can't abuse it
Several EditText fields are configured so monkey breaks things, e.g. by
entering too much text in the default player name config. Fix. This
probably won't impact users but it lets the monkey tests move on to
other things that might.
2017-09-07 07:36:16 -07:00
Eric House
f161de2977 make menu consistent 2017-09-07 06:15:17 -07:00
Eric House
1ee5afd5cf add inputType=text to singleline EditTexts
Turns out the maxLine="1" thing needs this accompaniment or it'll let
you add carriage returns, as adb monkey found.
2017-09-07 06:13:14 -07:00
Weblate
11368df086 Merge remote-tracking branch 'origin/android_translate' into android_translate 2017-09-06 11:49:19 +02:00
Eric House
6866887438 include last commit in change notes 2017-09-05 19:23:21 -07:00
Eric House
8971837d22 fix crash on Samsung Galaxy Note 3 running 4.4
Can't repro on Nexus emulator running 4.4 nor on Samsung running 4.4.4,
but the reporter says this fixes it. And from reading it appears
expecting older devices to load Material themes without an AppCompat
library is wrong.
2017-09-05 19:17:02 -07:00
Eric House
f5e66463f9 up release strings for new version 2017-09-03 14:15:43 -07:00
naofum
406ffca333 Translated using Weblate (Japanese)
Currently translated at 73.8% (545 of 738 strings)
2017-09-03 14:15:26 -07:00
Eric House
51ca1777e2 make the have-chat icon green 2017-09-03 13:28:37 -07:00
Eric House
4549c397ae cleanup
don't check standalone games for chat messages
2017-09-03 10:38:54 -07:00
Eric House
2735144515 mark games with unread chat 2017-09-02 12:12:39 -07:00
Eric House
2616891608 remove/replace deprecated singleLine element 2017-09-02 12:12:39 -07:00
Eric House
a10dd6a314 make game sort order clearer and easier to modify
For the ORDER BY clause that governs how games are displayed within a
group, use a static string built from a list of clauses that are then
easy to move up and down. Add clause that moves games with unread chat
to the top. Another commit will modify the display so it's clear why
it's there.
2017-09-02 12:12:39 -07:00
Eric House
5ed9d2c6aa remove dead code 2017-09-02 11:24:58 -07:00
Eric House
1c3b5564b5 use same red/green for expiry as for net status
Slightly less glaring; slightly more consistency.
2017-09-01 08:12:38 -07:00
Eric House
e97dd26e6f fix missing "game in room NNNN" in games list
Looks like sometimes the TextField was GONE
2017-08-31 21:21:54 -07:00
Bernard Massot
e24f7bdba8 Translated using Weblate (French)
Currently translated at 91.1% (673 of 738 strings)
2017-08-31 21:21:54 -07:00
Eric House
a6d8708abc sort unconnected games to top of list 2017-08-31 20:07:40 -07:00
naofum
ecbfcb674c Translated using Weblate (Japanese)
Currently translated at 73.8% (545 of 738 strings)
2017-08-31 03:46:35 +02:00
Eric House
586899891d Merge remote-tracking branch 'weblate/android_translate' into android_translate 2017-08-30 07:22:36 -07:00
Eric House
79b0d38c0c tweak changelog 2017-08-30 06:30:25 -07:00
Eric House
8489d1401f only try to put up Wait/Invite alert once
Bring back the test for being null, and add an additional one via a new
boolean iVar that we haven't tried posting it already. On some devices
there's enough of a lag that the is-null test passes several times
before the first makeDialog() call, leading to a cascade of attempts to
create that hangs the UI. The test's needed, but only once should be
start the process.
2017-08-29 07:33:15 -07:00
Eric House
077159b8c4 save commitID in instanceState
When the back stack is restored commit() is not called, so the fragment
needs to save it. Without this 0 is passed to popBackStack() and
everything's dismissed, not just the one fragment.
2017-08-29 07:31:37 -07:00
Eric House
741dbf2bed fix finish() to close a specific fragment
Rather than just pop whatever's on top of the back stack, which might be
the alert whose listener called finish(), use saved commit() ids to pop
down to the fragment itself. This feels like a risky change, and it's
tested only by back-button-dismissing the Wait alert in an unconnected
game in BoardDelegate, so needs some bake time.
2017-08-29 07:10:04 -07:00
Eric House
bb4c5502c8 save commit id in fragment 2017-08-29 07:03:52 -07:00
Eric House
270df00692 use new API to offer to hide buttons
When SDK >= 19 there's an API to tell if a listview is full enough to
require scrolling. So use that, rather than the raw count of games, to
decide whether to offer new users to hide the new game buttons.
2017-08-28 07:12:10 -07:00
Eric House
db658edc67 don't add to queue once it's stopped
No point in adding something if we're not going to process it.
2017-08-28 07:06:57 -07:00
Eric House
671d345377 remove most of xw4dbg's AndroidManifest.xml
What's here is merged with the main one, so no point in duplicating and
it's just a pain to maintain. Remove as much as possible that's not
unique to the debug variant (crashlytics and wifidirect, basically.)
2017-08-27 15:55:31 -07:00
Eric House
58f828c187 up version strings and changelog 2017-08-27 15:49:57 -07:00
Eric House
54be99b635 remove logging 2017-08-27 15:49:35 -07:00
Eric House
5914ad8a1d include ActionPair in serialization of DlgState
Oops. Debug build assertion showed I was leaving an infrequently used
field out of serialization, adn then required that that object be
Serializable and implement equals() to pass more tests.
2017-08-27 11:40:26 -07:00
Eric House
9231224eea explicitly use Theme.Material as app theme
Fixed Samsung having made a white actionbar default and so my menubar
icons becoming invisible.
2017-08-27 10:12:37 -07:00
Bernard Massot
2e73a4277b Translated using Weblate (French)
Currently translated at 91.1% (673 of 738 strings)
2017-08-27 12:45:42 +02:00
Eric House
ff415640fd sync variants' AndroidManifest.xml files 2017-08-26 11:02:27 -07:00
Eric House
24a38c8f46 cleanup connection status display text
Get rid of treating 0 as a legit date (1970 being illegit). Tweak
formatting. It's not perfect, but few people see it so we'll see how it
goes during development.
2017-08-24 06:58:53 -07:00
Eric House
1a36f3286b ignore generated files 2017-08-22 07:52:15 -07:00
Eric House
33f80fbefd up version strings for new release 2017-08-16 07:34:03 -07:00
Eric House
f7d4d6b637 sort by versionCode, then by file age
revert a bit, dropping use of git revision and repo to provide an
order. Instead use aapt (which is an ubuntu package now) to pull the
version code and appID from .apk files, order by versionCode, and
secondarily by file mod time.
2017-08-16 07:29:17 -07:00
Eric House
19c7543eb3 make finding most recent apk based on git revision
Auto-update was based on my manually setting what the newest is. Better
to use the git revision stored in the .apk, or failing that (later) in
the file name, to determine "age". This is all based on forcing a linear
order on git commits, but at least at the granularity of releases that
should be ok.
2017-08-14 22:40:07 -07:00
Eric House
bb846060e9 always add "self" choice to invite-by-relay-id list
Poorly integrated: you can delete it only to have it come back, but
send-to-self is just a debugging thing anyway.
2017-08-14 07:52:18 -07:00
Eric House
f795ae6de6 use same string for both download menuitems
Mistake was putting "download more languages" at the bottom of list of
wordlists in one language. Having separate strings is a bigger change,
and in context just "Download more" works in both cases. Change name of
string so translators will notice.
2017-08-14 07:18:16 -07:00
Eric House
eb34294679 fix failure to create game after downloading dict
Wasn't setting the necessary iVar...
2017-08-14 06:49:05 -07:00
Eric House
af48fb850d update strings for new release 2017-08-13 19:37:29 -07:00
Eric House
2f6c6b0644 fix ClassCastException: 0 isn't a long; 0L is 2017-08-13 12:59:58 -07:00
Eric House
ae86378bcd don't assert on DEBUG: too frequent
I need to fix this, but crashing all the time isn't the answer.
2017-08-11 06:25:25 -07:00
Eric House
ddfa3a567f Merge remote-tracking branch 'weblate/android_translate' into android_branch 2017-08-08 21:57:04 -07:00
Eric House
ba8a5ceeb6 up version for new release 2017-08-07 21:48:50 -07:00
Eric House
635fbed719 catch and drop illegal state exception
By inspection based on report to Play store.
2017-08-06 14:08:33 -07:00
Eric House
93a8aa77bf fix NPE
It might make sense to have default value of m_params be 0-length
array....
2017-08-03 07:13:32 -07:00
Eric House
6cee0c5bca check that all params are serializable
DEBUG builds only.
2017-08-02 07:20:48 -07:00
Eric House
455b6e79f0 use TextUtils.equals in new equals() overrides 2017-08-02 07:09:38 -07:00
Eric House
4ec930d53c fix array out-of-bounds exception 2017-08-01 22:22:44 -07:00
Eric House
bb367acab3 don't pass unserializable in params[]
Was, in rarely seen case, passing an object that couldn't be
serialized. Instead pass a few of its constituents than can, and
reconstitute using them.
2017-08-01 22:21:47 -07:00
Eric House
62dd6c12f7 remove unnecessary parameter 2017-08-01 22:03:47 -07:00
Eric House
c927dbef54 fix equals() implementation 2017-08-01 21:37:02 -07:00
Eric House
9a394b2541 comment out code with RELAYINVITE_SUPPORTED
Relay-invite code may never be released, so wrap it in compile-time test
that'll get it stripped.
2017-08-01 07:33:37 -07:00
Eric House
101c2ff8f2 fix problems with params[] serialization
Was passing through DlgState params a number of classes that weren't
serializable or that didn't have equals() methods required for DEBUG
assertions to pass. Added versions of equals() that just call super in
non-DEBUG case since it's a lot of code and isn't required except for
testing. (Serialization of course is.)
2017-08-01 07:28:17 -07:00
Eric House
d55d9573e4 fix some bundling/serialization problems
Now that params[] are being bundled all objects passed that way must be
serializeable. And as long as I'm asserting bundle success using
equals() the objects being serialized must implement it.
2017-07-29 20:59:00 -07:00
Eric House
80cc12fc79 up version strings and change list for new release 2017-07-29 20:21:23 -07:00
Eric House
e2c46963d8 fix crash (by inspection) with complete parcel save
I wasn't saving/restoring params[] Object array with DlgState, and under
circumstances I can't reproduce that could cause a null object
dereference I was via the Play store. So added a test case that failed
for DlgState instances that have non-null params arrays, and fixed that.
2017-07-28 07:37:57 -07:00
Dener Luiz da Silva
af7cf8edc0 Translated using Weblate (Portuguese)
Currently translated at 53.7% (396 of 737 strings)
2017-07-26 21:46:17 +02:00
Eric House
ca93f808f3 change invite alert track/dismiss logic
Attempt to fix invite alert sticking around after game connection
finishes, which resulted from the variable pointing to the alert having
been set to null. So stop setting it in onDismiss listener. I think
trying to track it via an iVar is a mistake, that dismiss by tag or
somesuch is the right way to go. But my dialog fragment code isn't up to
that yet.
2017-07-26 07:21:27 -07:00
Eric House
c6a72b63ee make relay invite record editable 2017-07-25 07:48:54 -07:00
Eric House
32c6a5e114 don't enable remove button when nothing's checked
Copy from SMS inviter code. Really should be moving that into the
superclass.
2017-07-23 17:50:47 -07:00
Eric House
a71d60db63 implement deletion; save with new serialization util
Add new Utils methods that turn Serializable objects into B64-encoded
Strings, and vice versa. Use in place of existing code, and use anew to
store the array of DeviceID records. Implement the "Delete checked" button.
2017-07-23 17:31:59 -07:00
Eric House
7eb9458a78 get invite-by-relayid working again
In Dbg version only (with enabling boolean moved to BuildConfig.)
Currently crashes when first used, and recipient can't always connect to
relay until app rebooted. And of course there are still open questions
like how to populate the list -- how user learns the deviceID of an
opponent.
2017-07-23 16:45:14 -07:00
Eric House
bd250cfe1e log before asserting 2017-07-19 07:16:18 -07:00
Eric House
41529a584c add recent changes to changelog 2017-07-19 06:35:26 -07:00
Eric House
d057de0fd3 add comment reminder of proguard problem 2017-07-19 06:27:56 -07:00
Eric House
72c624b251 track resends for each comms type
Was previously a "global" so that a resend over SMS might delay a resend
for relay games. Since communication problems tend to be
comms-type-specific that's dumb.
2017-07-19 06:26:11 -07:00
Eric House
52a1ccd4dc tweak comments 2017-07-19 06:16:22 -07:00
Eric House
64014944f3 finish: using java's base64 en/decoder from java
Added a wrapper function since for compatibility with the jni's encoding
the flags matter and need to be the same everywhere. Or at least there
should be no chance of their getting changed.
2017-07-13 07:40:28 -07:00
Eric House
94dca807ef use a singlton rather than one Time per object
De-serializing a Time formatter wasn't going well post-proguard, but it
was a dumb way to do it anyway when only one object is needed.
2017-07-13 07:20:24 -07:00
Eric House
fb91ba8608 fix (by inspection) store-reported NPE 2017-07-12 08:14:42 -07:00
Eric House
4f989c7a3e start using built-in base64 stuff
As a first step, use mine and android's and assert results are the
same. Note using built-in Base64 class requires moving the min android
version from 7 to 8.
2017-07-12 08:02:52 -07:00
Eric House
589929b3b2 enable proguard for debug builds
Copy config file into the right place, turn it on for debug builds, and
fix compile-time complaints by adding -keep clauses. Resulting builds
seem to work (after a few minutes in emulator only) except that net
status icon taps crash at first (eventually recovering somehow) likely
because of problems with base64 en/decoding which goes through jni.
2017-07-12 07:16:57 -07:00
Eric House
75488aefc0 use same SMS resend backoff for debug as release 2017-07-10 06:51:45 -07:00
Eric House
c8beefaafe tweak network status icon
Get rid of black background of center icon, instead running the green or
red all the way to the middle. For better contrast make the green and
red darker and the non-active arrows white.
2017-07-10 06:49:02 -07:00
Eric House
924dc1b37f remove assert
Looks like my theory was right. Logging is more than enough.
2017-07-05 07:53:41 -07:00
Eric House
15f50dc82a fix game config for rotation and connvia changes
The debug-only settings for disabling individual conn types weren't
kept in sync with which types were enabled, and that set of types was
lost on rotation. Fixed (including keeping the disableds across rotations.)
2017-06-30 06:34:24 -07:00
Eric House
b9d6b05d87 tweak logging 2017-06-29 07:28:15 -07:00
Eric House
d6bbccb773 let caller deal with result of message resend
Use a new interface to let caller of resendAllIf() know how many
messages were resent. If none, a new timer might not be called for.
2017-06-28 08:24:33 -07:00
Eric House
bdc1f5ff51 when game full drop message but don't assert
I'm seeing assertions when a game gets into a state I don't fully
understand: host receives messages that need a channelNo assigned but
the game's full. With luck they're duplicates and can be ignored,
because that's all I can do.
2017-06-28 07:04:15 -07:00
Eric House
33838e6a14 don't crash when crashlytics didn't get built in correctly 2017-06-27 07:34:04 -07:00
Eric House
d454ffb3e8 up changelog/strings for release 2017-06-22 07:12:51 -07:00
Eric House
4e101862a6 get rid of old standin for missing contact name
Since it's now possible to add a name for an SMS contact added manually,
don't assuming a missing name means it was added manually. Just leave
blank if not provided.
2017-06-21 07:59:22 -07:00
Eric House
e3e7add5a9 fix (I hope) script for harvesting jni sigs
I made these changes a while ago then stashed them. They worked when I
needed them then, and seem to work now, but I haven't verified now so
don't trust 'em too far. :-)
2017-06-20 22:05:39 -07:00
Eric House
a16cc8e648 replace Crittercism with Crashlytics, suckily
Crittercism is dropping free support of FOSS apps, so I'm dropping
it. Unfortunatly integration isn't as clean: so far at least I haven't
figured out how to make it possible for others to build the 'd' variant,
which includes Crashlytics, without their having a Fabric API key.
2017-06-20 21:48:40 -07:00
Eric House
6de5d307b3 add name field to manual sms contacts entry 2017-06-20 19:35:38 -07:00
Eric House
b33df6b222 reset SMSResend timer on new data only
Resetting it on every ACK etc meant it happened forever at the most
frequent interval, at least on devices that have both sides of a game,
which is my usual test setup.
2017-06-20 19:19:03 -07:00
Eric House
e6454070a6 remove an oft-firing assert
It's definitely happening, and disruptive though debug-only. So remove
to be tracked down eventually.
2017-06-20 19:17:23 -07:00
Eric House
e3a8bef3cb add new param
It's not the case that forcing send and showing UI go together.
2017-06-20 07:49:01 -07:00
Eric House
0b2920102b tweak chat layout; use better timestamp format 2017-06-20 07:47:32 -07:00
Eric House
3aefa3a566 don't make sound/notify on standalone game moves
I'm finding the robot move beeps annoying. If others aren't maybe a
preference would be better. We'll see.
2017-06-16 19:24:04 -07:00
Eric House
7f48267397 save non-destructive changes on "Play game" button
In game config, when the play game button's hit and the changes pending don't
"matter" (require reset), apply them. The motiviation is to allow
setting the "disableds" and immediately launching a game via the button,
but I think it's the right thing to do anyway. Needs testing.
2017-06-16 19:18:30 -07:00
Eric House
7bae112077 add timer to resend sms data messages
Deal with occasional droppage of SMS data messages by running a
timer (via AlarmManager) with backoff that resends any pending moves for
games connected via SMS. Successful receipt of SMS data resets the backoff.
2017-06-16 18:56:22 -07:00
Eric House
0b0a50bd5c add timestamp to chat messages, db and display
On send, add current seconds to message. Store and display in android
code. Display layout needs work.
2017-06-10 11:36:45 -07:00
Eric House
6f0fb66a0d fix three-year-old huuuuge memory leak
Hadn't run Valgrind in a while. There's another too, but much smaller
and harder to track down.
2017-06-07 08:07:42 -07:00
Eric House
f06e7bdd98 don't drop duplicate reconnect
When Android client is backgrounded with a game playing (BoardActivity
on top) then brought to front again it fails to reconnect to relay
because it didn't disconnect and the relay thinks it's still there. The
right fix is in making the java code do the right thing (complete
disconnect), but it seems harmless to just honor the reconnect in this
case. Doesn't even cause leaks, per valgrind.
2017-06-06 06:27:58 -07:00
Eric House
59285aa9f4 cleanup 2017-06-06 05:46:27 -07:00
Eric House
f85f7c41be add cmdline options to generate single-abi .so
Part of getting split builds going. I think.
2017-06-06 05:45:31 -07:00
Eric House
41683f95a7 improve activity lifecycle logging 2017-06-05 07:36:47 -07:00
Eric House
5c893127de remove constants from build.gradle
cleanup, iterating over built-in data rather than my hard-coded VARIANTS
and BUILDS arrays, which now go away. Renamed obj- and libs- directories
to better fit the variables the system provides.
2017-06-01 07:41:51 -07:00
Eric House
f49aac71cf get rid of <a> -- sucks in webview 2017-05-31 20:22:13 -07:00
Eric House
c53616fd82 wrap code in if(DEBUG) 2017-05-27 13:26:57 -07:00
Eric House
9644f40659 add ui for disabling comms send and receive
Add DEBUG-builds-only UI at the bottom of GameConfig for turning on the
comms feature dropping outgoing or incoming messages. The idea's to use
this to reproduce and fix stalls. There's a noticable slowdown opening
the GameConfig fragment, but it should all be no-op in a release build.
2017-05-26 07:49:38 -07:00
Eric House
95ec573169 save disabled booleans in comms state
I want them persisted since the GTK UI doesn't make sense and they
should effect background sends and receives too.
2017-05-26 07:30:42 -07:00
Eric House
a815c466c9 up strings for new release 2017-05-25 20:13:00 -07:00
Eric House
7164ab92f6 make FirstRunDialog a DialogFragment
It was disappearing when the device rotated. Using the same
XWDialogFragment mechanism as everything else fixes that.
2017-05-25 19:58:04 -07:00
Eric House
b6665a15c4 double-check to avoid crash (by observation)
Chasing a rare play-store-reported JNI crash: test for a null ptr in C
and assert/test in Java.
2017-05-25 07:10:49 -07:00
Eric House
d584c30a43 fix (by inspection) three Play store crashes
One race condition between BT threads; two edge cases around dialog
fragments, where I've left DEBUG build asserts in place.
2017-05-24 21:27:18 -07:00
Eric House
935932f440 don't try to upgrade fdroid builds
Add BuildConfig boolean that's true when a gradle property is passed in
from the fdroid metadata/build file. Test when putting together upgrade
state and omit app info when it's true, same as if from Play store.
2017-05-24 20:16:07 -07:00
Eric House
d58c601bf3 include git revision in assets/ dir (.gitignore it)
Makes it easier to see what's been built into an apk if the file's name
has changed.
2017-05-24 07:09:11 -07:00
Eric House
340a559eb7 don't report fdroid builds as dirty
F-droid build system modifies git-controlled files so no build will ever
be clean. So look for a -P property and if that's set don't use the
--dirty flag when capturing the git revision. Requires a change to the
fdroid metadata to pass that property.
2017-05-24 06:49:09 -07:00
Eric House
222655ba58 get rid of background for expander buttons
In the gameslist view the expander buttons had a visible rectangular
background. Now that's transparent so they look like the rest.
2017-05-23 19:03:29 -07:00
Eric House
3c650ce762 fix xw4d build (shortening more xw4dbg) 2017-05-23 19:03:29 -07:00
Eric House
acf7097fda sign release apks outside of gradle
My sign-inside-gradle is an uncommon trick and unnecessary. Better to
follow the old convention of using jarsigner and zipalign.
2017-05-23 19:03:19 -07:00
Eric House
ef2da21bbe xw4dbg -> xw4d: tired of typing the extra letters
Rename the debug variant and make it work. appID stays the same and so
no longer matches. Gradle allows that.
2017-05-23 06:37:31 -07:00
Eric House
4ad7e171f6 keep db open throughout
Years back what I read said you opened and closed the database around
every query. Now I'm reading differently, that the OS will close it for
you on app shutdown and that it's ok to just leave it open. Trying
that after a few minutes on one device looks ok. Will need to test the
heck out of it, especially on older OS versions, before ship.
2017-05-18 21:20:21 -07:00
Eric House
8a4563e8ee up version strings 2017-05-18 06:53:03 -07:00
Eric House
a834a8170a catch IllegalStateException
Play store reports crashes but stack crawl doesn't tell me where
from. So try catching the exception and on debug builds logging what
dialog is responsible.
2017-05-18 06:37:58 -07:00
Eric House
7f4d8b1a44 remove firing assertion (per Play store)
Looks like clock skew or maybe even a timezone issue (I'm not doing
enough research :-) is causing an assert. Just drop the notification
instead.
2017-05-18 06:19:25 -07:00
Eric House
098de83b04 fix assertion: don't pass bundle as alert param
it's not serializable, and more's the point is already being saved
across rotations in the delegate, so just use that.
2017-05-09 07:02:12 -07:00
Eric House
a6d5f409cb include translations in changelog 2017-05-08 20:47:08 -07:00
Eric House
055f54611d catch NPE Play console reports thrown by OS
No clue why this might be happening, but perhaps catching and dropping
will prevent a bad user experience?
2017-05-07 17:06:26 -07:00
Eric House
c3bfbfb956 up version strings and changelog for release 2017-05-07 16:27:40 -07:00
Eric House
f8077785bc cleanup: remove comments and unnecessary ivar 2017-05-07 16:25:18 -07:00
Eric House
9b88279212 remove need for file
app_name.xml's contents are in generated file, so just use that. Saves a
change on each release.
2017-05-07 16:05:36 -07:00
Eric House
c637fd1eee remove not-again explanation for public rooms
When those became an advanced feature I added a warning for upgrading
players who'd miss them. That was long ago, and the warning was only
supposed to last a release or two.
2017-05-06 21:05:42 -07:00
Eric House
579a7ae5cb change emacs compile-command for java files (generated) 2017-05-06 20:59:17 -07:00
Eric House
3c2d36c5d4 Merge branch 'android_branch' into android_translate 2017-05-05 07:20:36 -07:00
Eric House
309622b592 put back a couple of words -- not dirty! 2017-05-05 06:48:52 -07:00
Eric House
252db56bba update English wordlists to bowdlerized 2017-05-04 22:48:15 -07:00
Eric House
8752432de3 add ability to filter out "dirty" words
If a Makefile defines a dirty word list then a new python script is
invoked to filter for and remove those words as the dict is being
built. So far I have for English only, which makes sense because only
English wordlists are built-in on Android and Google's rating system
cares only about what's built in.
2017-05-04 22:45:27 -07:00
Eric House
ed781b36b5 remove dismissDialog() and removeDialog()
One's a no-op the one place it was used, and the other's not used at all
2017-05-03 07:10:26 -07:00