Share My Creation CardShark Spades

This is the free version of CardShark Spades. The final version will have many playing levels and styles, but this version only plays at the expert level. It has many features for learning to play like an expert which can be seen in the options window in the 2nd screen shot below. The app includes a large documentation file.

Click here to download version 1.5. October 21, 2011

The app runs on a 1.5 scale (e.g.: 800x480) phone or any size/resolution tablet. The download file is a zip file which contains the apk file because for some reason, I could not get the apk file to download in a browser.

This has not been uploaded to distributors yet because I hope to get some feedback from people on here.

I am not uploading the code because it is over 10,000 lines, most of which are algorithms for bidding and playing Spades, thus not of use to anyone not writing a Spades game. A previous upload, Card Game Shell, contains the code for shuffling, dealing, and displaying hands of cards. Any other routines of general use are either in the Wiki or in the forums. A big "thank you" to Erel and all who have helped me on these forums.

endofgame.png


optionsmenu.png
 

Attachments

  • shark220x220.jpg
    shark220x220.jpg
    17.3 KB · Views: 14,099
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Looks great!

Erel - I tried to attach smaller screen shots, but I could not get any down anywhere close to 19k (and still be legible).
If you have any way of doing it to the above screen shots, I would appreciate it.
Maybe upload some logo? or an image of a card or two?

A big "thank you" to Erel and all who have helped me on these forums.
I would like to thank you for updating and maintaining our wiki: Main Page - Basic4android Wiki
It became a very good programming resource. I hope that more authors will join with your effort in the future.
 

NJDude

Expert
Licensed User
Longtime User
Cool game and very nice graphics!!!

A few things I've noticed:

1- Screen shots 1 thru 4, this is how it looks on my EVO 4G (800x480 scale 1.5)

2- Screen shot #5, this error occurs after I open the game more than one time, meaning, I installed it, it ran fine, I close it, I open it again, error occurs, however, the error goes away if prior to run it I "Clear Data" via the Settings -> Applications -> Manage applications on the phone or I force close it, but I will have to do it everytime I want to play this game. This is only happening on the EVO.

3- Installed the game on a LG phone (scale 1) and I got a message stating that this app will not run on a phone with a 480x320 resolution, however, it runs anyway (instead of just finishing) after clicking ok on the message box, I get several Java errors.

I tested it also on my cheap tablet (1024x600 scale 1.0) and it looks GOOD!!!, and no errors.
 

Attachments

  • Screen1.jpg
    Screen1.jpg
    40.7 KB · Views: 320
  • Screen2.jpg
    Screen2.jpg
    37 KB · Views: 307
  • Screen3.jpg
    Screen3.jpg
    36.6 KB · Views: 287
  • Screen4.jpg
    Screen4.jpg
    29.3 KB · Views: 325
  • Screen5.jpg
    Screen5.jpg
    20.7 KB · Views: 324
Last edited:

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Thanks for the report. I'm working on fixing things now. Meanwhile, people who don't have a tablet should hold off downloading the app.

I have 7" and 10.1" tablets, but no Android phone, so I haven't spent nearly as much time running it on the phone emulator. I did test it before uploading and didn't get these problems on my emulator for some reason. Ah, well, back to work...
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
1- Screen shots 1 thru 4, this is how it looks on my EVO 4G (800x480 scale 1.5)

Screen 1 is a real glitch-o-rama. Long story short -- I adjusted things to fit better, but the "Optio" button seems to have been a B4A or Android or Designer glitch. Also, in Designer, the emulator is said to have a density of 1.5, but in B4A, Density reads as 1.0, which is screwing up some stuff.

2- Screen shot #5, this error occurs after I open the game more than one time, meaning, I installed it, it ran fine, I close it, I open it again, error occurs, however, the error goes away if prior to run it I "Clear Data" via the Settings -> Applications -> Manage applications on the phone or I force close it, but I will have to do it everytime I want to play this game. This is only happening on the EVO.

The error appears to be in the sub where it's reading the game data which is saved to the device. It must not be a problem accessing the file because it apparently is saving it without error. Since this is only happening on your EVO, I can't troubleshoot it, but I put a Try-Catch in the Sub with a MsgBox if it glitches.

3- Installed the game on a LG phone (scale 1) and I got a message stating that this app will not run on a phone with a 480x320 resolution, however, it runs anyway (instead of just finishing)

Dang. Meant to put an Activity.Finish in there and forgot.

I tested it also on my cheap tablet (1024x600 scale 1.0) and it looks GOOD!!!, and no errors.

Glad to hear it. Thanks again for the feedback. I could send you the source code if you want to try to single-step the ReadOptions sub to see where it's choking on the EVO.

I'm off to the Bugs forum to see what's going on with some other stuff.
 
Last edited:

NJDude

Expert
Licensed User
Longtime User
No problem, if you fixed some of the issues I'll download the APK again and test it, if you want to send the source code, send me a PM to make the arrangements.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I've uploaded a new zip/apk file to the link in the original post. Since I restarted B4A, I think it solved some of the problems, mainly I was not seeing the 1.5 scale layout when I ran the app.
 

NJDude

Expert
Licensed User
Longtime User
Ok, I've installed the new code, these are my findings:

1- Clicking on the "Hint" button brings the cards a little bit too high and block the "Hint" and "Okay" buttons. (Shot1)

2- Note the prompt under the "North" player and the "y" on the Okay button. (Shot2)

3- The buttons on the "Help" screen are a tad small, same thing for the search box. (Shot3).

4- If I attempt to search something, hitting on the "&" button triggers the error on Shot4.

5- The error crashing the app when opened more than once is gone.

I will install the new APK on the LG tomorrow, I don't have it handy right now and I'll let you know.

The above testing was done on my EVO and my tablet.
 

Attachments

  • Shot1.jpg
    Shot1.jpg
    39.1 KB · Views: 269
  • Shot2.jpg
    Shot2.jpg
    40.8 KB · Views: 314
  • Shot3.jpg
    Shot3.jpg
    17.3 KB · Views: 280
  • Shot4.jpg
    Shot4.jpg
    25.2 KB · Views: 297

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
1- Clicking on the "Hint" button brings the cards a little bit too high and block the "Hint" and "Okay" buttons. (Shot1)

Fixed it. Thanks.

2- Note the prompt under the "North" player and the "y" on the Okay button. (Shot2)

When you select View Suit Counts, the little box with "possible # out" shows the possible (not exact) count in each hand based on CSS's analysis of cards bid/played but doesn't say *which* cards are still unplayed, which is what that list under the North cards is. If you turn off View Suit Counts, it will go away.

However, I just noticed that the label isn't wide enough to see the complete listing, so here I go to fix that.

3- The buttons on the "Help" screen are a tad small, same thing for the search box. (Shot3).

The buttons are the same height as the Help and Options butttons. Are they too narrow? Or are the Help and Options buttons too small also?

4- If I attempt to search something, hitting on the "&" button triggers the error on Shot4.

I added a new screen shot to the docs and forgot to add it to the code that copies the files over for searches. (If interested, that routine is explained in the Wiki.)

5- The error crashing the app when opened more than once is gone.

But are you getting the error message saying that it couldn't read the file? If so, I still need to track down that problem.

I haven't uploaded an updated version yet. I'm trying to track down a really obscure problem. (Did I mention 10,000+ lines of code?)
 

NJDude

Expert
Licensed User
Longtime User
Sorry for the delayed reply but thanks to Hurricane Irene we lost power and we just got back to normal recently.

Ok, I have installed the latest update and this is my report:

1- The line under the "North" player still looks funny on my EVO (Shot1)

2- The search function gives some weird results, on the examples, I entered individual words such as "search", then the word "cards" and then "winning" and the results are on Shot2, Shot3 and Shot4, however, other tmes it displays correctly like in Shot5 (I entered the word "winning") but if you keep searching (pressing the "&" key) the word is not being shown on the screen you have to scroll either up or down to find the highlited word, this happens on all my devices.

Like I mentioned on my last post, the error of crashing the app when you open the app more than once is gone, now is working fine, so far, I've found only the issues mentioned above.

EDIT TO ADD:

Quote:
3- The buttons on the "Help" screen are a tad small, same thing for the search box. (Shot3).

The buttons are the same height as the Help and Options butttons. Are they too narrow? Or are the Help and Options buttons too small also?

The buttons are too small in my opinion and they "blend" with the page, to be honest, I missed them the 1st time I ran your app.
 

Attachments

  • Shot1.jpg
    Shot1.jpg
    28.1 KB · Views: 287
  • Shot2.jpg
    Shot2.jpg
    18.7 KB · Views: 267
  • Shot3.jpg
    Shot3.jpg
    17.4 KB · Views: 304
  • Shot4.jpg
    Shot4.jpg
    20.8 KB · Views: 274
  • Shot5.jpg
    Shot5.jpg
    50.9 KB · Views: 293
Last edited:

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Sorry for the delayed reply but thanks to Hurricane Irene we lost power and we just got back to normal recently.

I greatly appreciate your help. Hope Irene didn't hit you too hard.

1- The line under the "North" player still looks funny on my EVO (Shot1)

I think I see what you are talking about now. (It's really small!) It looks like that label is over the "North" label whiuch shows through. I'll fix that somehow. I can put that label lower, but then if you have Explanations turned on, the explanation window will block that label. That shouldn't be a big problem though.

2- The search function gives some weird results... you have to scroll either up or down to find the highlited word, this happens on all my devices.

Originally, when a search down the page was done, the found text would always be on the top line of the browser and often obscured by the search edit box and the three buttons. So I tried setting the search anchor back 1000 characters to force the found text down the page, but that can cause a word that comes within 1000 characters after a screen shot to not show on the screen, so I tried adjusting for that. It seemed to work fine on my tablets, but apparently not on the smaller phones.

So I've changed it back to the top line. Since I had already moved the search box down to the bottom and made the Back and X buttons smaller and moved them to the right, having the found text on the top line wasn't much of a problem any more. It's very hard for me to test this on the emulator because the "keyboard" moves the screen up and then doesn't move it back down, so I can't tell what's going on.

The buttons are too small in my opinion and they "blend" with the page, to be honest, I missed them the 1st time I ran your app.

I've made them larger. I hope it doesn't lead to problems with obscuring the text again.

I've just uploaded this as version 1.2 to the link in the original post. Thanks again.
 

NJDude

Expert
Licensed User
Longtime User
In my area (Northern NJ) the damage wasn't bad, just lots of fallen trees, debris and no power, and some flooding but nothing really bad for what I could see myself.

Ok, back to troubleshooting:

1- The prompt under the "North" player is not overlapping anymore on my EVO (Shot 1).

2- The search is now positioning and displying the highlighted term correctly (Shot 2), but then goes back to the problem mentioned before, I have to either scroll up or zoom out, for example, if you search for "cards" the first 3 or 4 results will display on the top line but then you cannot see it unless you scroll up, that problem seems like a tought one.
 

Attachments

  • Shot1.jpg
    Shot1.jpg
    28.4 KB · Views: 260
  • Shot2.jpg
    Shot2.jpg
    18.9 KB · Views: 280

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
The search is now positioning and displying the highlighted term correctly (Shot 2), but then goes back to the problem mentioned before, I have to either scroll up or zoom out, for example, if you search for "cards" the first 3 or 4 results will display on the top line but then you cannot see it unless you scroll up, that problem seems like a tought one.

I'm on my way out, but quick comment: I'm putting the anchor right next to the word, so there should not be any way that it could NOT be on the screen. I just tried it with my 10" tablet (searching for "cards") and it worked perfectly.

The actual code I'm using is here: Tricks Of The Trade - Basic4android Wiki
 

NJDude

Expert
Licensed User
Longtime User
I'm on my way out, but quick comment: I'm putting the anchor right next to the word, so there should not be any way that it could NOT be on the screen. I just tried it with my 10" tablet (searching for "cards") and it worked perfectly.

On my tablet works fine too, BUT, on the EVO the first 3 results are "on screen" then they are too high and I need to scroll up, it seems that a "word wrap" is needed or something so the text fits the size of the screen, I'm just saying.

See the sequence of searching for "cards" on my EVO on the attached screen shots.
 

Attachments

  • Shot1.jpg
    Shot1.jpg
    17.3 KB · Views: 300
  • Shot2.jpg
    Shot2.jpg
    21.2 KB · Views: 370
  • Shot3.jpg
    Shot3.jpg
    21 KB · Views: 281
  • Shot4.jpg
    Shot4.jpg
    51.9 KB · Views: 293
Last edited:

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I've just realized that there is a potential problem with my webview search code -- it should be set to ignore text which is part of HTML code and it should start the search after the Title line at the top of the file which does not display. However, I don't think this is causing your problem.

it seems that a "word wrap" is needed or something so the text fits the size of the screen

As I said before, the HTML anchor is set right in front of the found text, the file is saved, then it is loaded into the webviewer using the anchor ("temp.htm#SRCHTMP"). My code has no control over this. All I can do is load the file into WebView with the correct HTML and if it screws it up, then I'm stuck.

I took the search code off the Wiki to make a short test app and discovered that a glitch in the Wiki software was keeping some of the code from showing on the page, so I sort of patched that. That was a Wiki problem and had no effect on the code in my app.

I left the screenshots out of the test app to simplify things, and the search works perfectly. (There's also no "&" button; you have to touch the editSearch box again.)

So my conclusion is that the reason it works right on my 1280x800 tablet is because the screen shots are 800x480 so the text is wrapped wider than the screen shots. And it works right on the test app on an 800x480x240 emulator because there are no screen shots. But when the text has to wrap at the screen width and the screen shots are greater than the screen width, it must be confusing the WebView.

Again, I don't see how I can code around that. If I'm right, then the only fix I can see is make the screen shots smaller and load a different help file for each different sized device, but that would take a lot of extra space for at least 3X the number of PNG files.

I've attached the test app if you want to look at it.
 

Attachments

  • WebViewSearchTest.zip
    34.6 KB · Views: 263
Last edited:

NJDude

Expert
Licensed User
Longtime User
Like I said, it seems that issue is going to be a tough one, I'll take a look at the test file.

By the way, there IS a "&" button, look at all the screen shots attached previously, and the one one attached here.
 

Attachments

  • Shot1.jpg
    Shot1.jpg
    19.3 KB · Views: 275

NJDude

Expert
Licensed User
Longtime User
I was saying that the test app from the Wiki doesn't have an "&" button

Oops!, sorry I misunderstood.

Ok, this is what I found out, having pictures on the HTML seems to throw off the anchoring, I came to this conclusion based on what you said regarding the screen shots, using the test code you posted it works PERFECTLY on my EVO if it's only text regardless of orientation (the test code can do portrait and landscape), however, on the test code you need to press enter so, the virtual keyboard shows up and pulls everything up, but as soon I close it I get the results as intended, so, maybe, instead of having the screen shots embedded on the HTML just make links to them, I don't know, it's just an idea.
 
Top