MatPlus.Net

 Website founded by
Milan Velimirović
in 2006

19:07 CET
 
  Forum
 
 
 
 

Username:

Password:

Remember me

 
Forgot your
password?
Click here!
SIGN IN
to create your account if you don't already have one.
Rating List
1st October
2018

B P C F





 
 
MatPlus.Net Forum Internet and Computing Popeye on Android (and possibly other mobile OS)
 
You can only view this page!
Page: [Previous] [Next] 1 2
(1) Posted by Dmitri Turevski [Sunday, Dec 4, 2016 10:32]

Popeye on Android (and possibly other mobile OS)


This started out of curiosity, but turned out to be quite functional mobile app for chess composers.

So, to install and run popeye 4.76 on your android device, w/o need to be connected to internet:

1. Download this HTML page to your computer: http://www.yacpdb.org/olive.html (~1.3M)
2. Connect your android device, copy olive.html somewhere to the internal storage SD-card, disconnect device
3. Open Chrome on your device, type this URL: file:///sdcard/ (note 3 slashes after "file:")
4. Navigate to olive.html, open with long tap -> "Open in new tab" (this is to guarantee it will open in Chrome, not some other application associated with .html)
5. Bookmark

Now to run, simply open this bookmark in chrome. The page is optimized for touch, to navigate between screens use swipe-left and swipe-right.
To stop popeye, or when something stops working - reload the page (swipe-down) - the position setup is persistent.
No need to be connected to internet, compiled popeye is embedded in the html file (test with airplane mode!).

Feel free to experiment with other browser/os. In theory it should work in any browser that supports javascript.

How this works:
https://en.wikipedia.org/wiki/Asm.js

The source code, for those interested, can be found at github.
 
(Read Only)pid=15092
(2) Posted by shankar ram [Sunday, Dec 4, 2016 18:17]

Great work, Dmitri!
Working on my handset.
But...
1. How to rotate the pieces?
2. In my handset the pieces are misaligned with respect to the squares
3. The output screen shows only 16 MB memory is used
 
(Read Only)pid=15094
(3) Posted by shankar ram [Sunday, Dec 4, 2016 18:17]; edited by shankar ram [16-12-04]

Duplicate post
 
 
(Read Only)pid=15095
(4) Posted by Dmitri Turevski [Sunday, Dec 4, 2016 19:02]

Thank you!

Let me answer your questions

Some general words first. Popeye is a program that manipulates text input/output only. The olive.html includes popeye and a very simple shell (dubbed olive.js) that allows user to set-up position with orthodox pieces.

1. To setup fairy pieces / conditions you have to go to the input screen and type them. They work ok, but no graphical interface at this point. The reason is https://en.wikipedia.org/wiki/Release_early,_release_often.

2. OS/Browser? I've experienced misalignment with iOS/Safary, but not with chrome.

3. Yes. The popeye is compiled to use 32MB total and 16MB for the transposition tables. It is something to be solved, because unlike the Windows/Linux popeye, this has to be defined at compile-time, not run-time.
There's an option to allow app to grab more memory in the runtime, but that'll result in that it can not be optimized by browser and will run as a common javascript (=slow). Which kind of kills the idea of the hash tables, that optimize search :) Which trade-off is trading less is something yet to discover.
 
   
(Read Only)pid=15096
(5) Posted by shankar ram [Sunday, Dec 4, 2016 20:36]

I tried entering the position directly in the 2nd screen. But after selecting the "run popeye" button, it's taking the position as setup in the 1st screen. It's ignoring the position in the 2nd screen.
Re: pieces misalignment, i have android version 4.3 and chrome version 34.0.1847.114.
 
 
(Read Only)pid=15097
(6) Posted by shankar ram [Sunday, Dec 4, 2016 20:36]; edited by shankar ram [16-12-04]

duplicate post
 
 
(Read Only)pid=15098
(7) Posted by seetharaman kalyan [Sunday, Dec 4, 2016 21:29]

Great work.! Raju said that even with his minimum computer skill he could instal and use.
 
 
(Read Only)pid=15099
(8) Posted by Dmitri Turevski [Monday, Dec 5, 2016 09:25]

@Seetharaman
Thank you!

@Shankar Ram
Fixed the issue with it ignoring the fairy pieces. Also increased memory to 128M - please re-download.
Pieces misalignment in Android 4 and Safari is still an open issue, but should be a bit less misaligned now.
As a workaround you may try different browser, may be? Android stock, or Firefox.
 
   
(Read Only)pid=15101
(9) Posted by shankar ram [Monday, Dec 5, 2016 10:59]

Dmitri:

Pieces misalignment - solved by installing latest version of chrome!

Ignoring edited position: Will check your latest version

Increasing memory: I want to try on Amazon Kindles - which only have 256 or 512 MB RAM. Maybe you can make the memory usage user configurable?
 
   
(Read Only)pid=15103
(10) Posted by shankar ram [Monday, Dec 5, 2016 12:06]

Edits on 2nd screen now work... though, of course, they're not reflected in the 1st screen.

Will try on Kindles now!
 
   
(Read Only)pid=15104
(11) Posted by shankar ram [Monday, Dec 5, 2016 12:57]

No luck with Kindles... :-(
All the 3 screens appear together.. Not able to edit the 2nd screen.. Run button doesn't work..
 
   
(Read Only)pid=15105
(12) Posted by shankar ram [Monday, Dec 5, 2016 14:30]

But... seeing the Popeye output screen on a mobile is a really wonderful sight!
Thank you again, Dmitri!
 
   
(Read Only)pid=15106
(13) Posted by Dmitri Turevski [Monday, Dec 5, 2016 14:54]

Turns out on Android it runs in Firefox about three or four time faster than in Chrome.
 
   
(Read Only)pid=15107
(14) Posted by shankar ram [Monday, Dec 5, 2016 15:48]

Firefox on android.. here I come!
 
   
(Read Only)pid=15108
(15) Posted by shankar ram [Monday, Dec 5, 2016 17:23]; edited by shankar ram [16-12-05]

Dmitri, Will the following options work?
1 protocol(output)
2 movenumber and startmovenumber
 
   
(Read Only)pid=15109
(16) Posted by Dmitri Turevski [Monday, Dec 5, 2016 18:16]

"MoveNumbers" and "StartMoveNumber" work fine.

"Protocol" is complicated. It works, but the filesystem that is available to popeye is not the filesystem of your device, but the virtual filesystem inside the browser, that is accessible only to other scripts that run inside this browser. For example, when you click "Solve", the contents of the input screen is saved to file in this filesystem, and popeye is then invoked with option to read input from this file.

If you are interested, very detailed (although also very technical) documentation of how this works is available here:
https://kripken.github.io/emscripten-site/docs/api_reference/Filesystem-API.html
 
   
(Read Only)pid=15110
(17) Posted by shankar ram [Monday, Dec 5, 2016 18:39]

Thanks, Dmitri.
Maybe in a future update, you can make an option for the users to retrieve this output file.
In the meantime, is there something like a "select all" command for the output window? I tried the browser options but couldn't find anything suitable. You can use the markers to highlight the text and copy it. But moving the marker to the beginning is tricky with a touch screen.
 
   
(Read Only)pid=15111
(18) Posted by Dmitri Turevski [Monday, Dec 5, 2016 18:57]

 QUOTE 
is there something like a "select all" command for the output window?


Er... yes, of course :) Tap into the output screen, that would bring up the keyboard. Now longtap something in the output area. That would open the context menu on the top, among other there are "Select all" and "Copy" icons.
 
   
(Read Only)pid=15112
(19) Posted by shankar ram [Monday, Dec 5, 2016 19:03]

Thanks again and sorry!
It was there right in front of my eyes. I got fooled by its icon, which looked like an option to display files or something!
 
   
(Read Only)pid=15113
(20) Posted by seetharaman kalyan [Tuesday, Dec 6, 2016 19:45]

After the Popeye team, Dmitri you are a gift to the problem world. olive , p2web, yacpdb, now this! Thank you.
 
   
(Read Only)pid=15116

Read more...
Page: [Previous] [Next] 1 2

MatPlus.Net Forum Internet and Computing Popeye on Android (and possibly other mobile OS)