openMSX Android Problem

By eimaster

Master (218)

eimaster's picture

25-02-2018, 22:59

Hi
I have an Android mobile and I have installed openMSX and it's working fine but... when I open any ROM or a DSK or a tape "cas" file, my Android opens it by a hexadecimal editor because the file extension is not registered to be opened by openMSX and it is considered as unknown file type! I want openMSX to be associated with those file types. So, I tried to register those file extensions by choosing "open as" and my Android displayed a list of registered installed applications which I can choose one of them and check "use as the default app" but the problem is -unfortunately- there is no openMSX among all of the applications in the list! As if openMSX is installed but is not registered as others!
How can I solve this problem?!
Another thing, how can I attach a ROM or a DISK or a TAPE icons to be displayed in front of the associated file?!
Thank you in advance.

Login or register to post comments

By N.I

Master (133)

N.I's picture

26-02-2018, 02:51

The init.tcl in the scripts directory in the user directory will be executed when openMSX starts. It may help you.
For example, if you generate the following text in /sdcard/openMSX/share/scripts/init.tcl, openMSX will open game.dsk at startup.
diska /dsk_directory/game.dsk

By eimaster

Master (218)

eimaster's picture

26-02-2018, 22:28

N.I wrote:

The init.tcl in the scripts directory in the user directory will be executed when openMSX starts. It may help you.
For example, if you generate the following text in /sdcard/openMSX/share/scripts/init.tcl, openMSX will open game.dsk at startup.
diska /dsk_directory/game.dsk

Thank you for replying but that's not what I want!
I have openMSX, MSX.Emu, and fMSX (free version) installed in my Android mobile phone. When I open my phone file manager "ES File Explorer" and if I touch any text file, a menu full of all the installed text editors and viewers appears so I can select one of then to open that file with. The same thing happens when I touch "let's say" an mp3 or wav file, a menu full of installed players appears so I can select one of them to play the touched file. But when I touch a ROM or a DSK or a CAS file, the MSX.Emu automatically starts and open that file. How can I make openMSX with MSX.Emu or why no menu of all the emulators appears so I can select one to run the file whether I select openMSX or MSX.Emu or fMSX?!

By N.I

Master (133)

N.I's picture

27-02-2018, 08:10

Only the applications that have the services of the action are displayed on the menu.
It seems that openMSX for Android does not have a service to start with specifying any files.

I recommend you to start openMSX from a shell script like the following.

echo "machine Panasonic_FS-A1ST" > /sdcard/openMSX/share/scripts/init.tcl
echo "diska /sdcard/dsk_files/game.dsk" >> /sdcard/openMSX/share/scripts/init.tcl
am start org.openmsx.android.openmsx/org.openmsx.android.openmsx.MainActivity

I confirmed that this script works properly with Terminal Shortcut.

By Vampier

Prophet (2226)

Vampier's picture

27-02-2018, 10:46

What is wrong with using the on screen menu?

By tfh

Paragon (1653)

tfh's picture

27-02-2018, 11:20

Vampier wrote:

What is wrong with using the on screen menu?

Well, I can understand what he means.
When I have a .PDF file in front of me, I want to open it by tapping the .PDF. Not by going to the main screen, swiping to the screen where the PDF viewer is located, starting it, going to the menu, start browsing and opening the file.

By Manuel

Ascended (14667)

Manuel's picture

27-02-2018, 23:49

I guess the openMSX app doesn't have the file associations in its manifest, or whatever it's called. I don't know enough about Android development at this moment to know how to do change that.

By FiXato

Scribe (1500)

FiXato's picture

28-02-2018, 02:10

By eimaster

Master (218)

eimaster's picture

02-03-2018, 05:22

Thanks for your replies friends.
I have never made an application for Android but it should be part of any compiler to define file extensions list which the application being compiled would be associated with.
Some example (imaginary compiler directive which defines app associated files):

if i'm writing an audio player, then my source should contain something like:

$FileType = 'wav,mp3,mpa,xm,mod,mid,aud,ogg,mp2'   <--- a compiler directive listing all audio file my app can open
$FileDesc = 'Audio file'   <--- a short description of file(s) listed above
$FileIcon = 'path/iconfile.png'   <--- an icon to be displayed for the above listed file(s)

if i'm writing a text viewer and/or editor, then my source should contain something like:

$FileType = 'txt,cpp,me,bat,xml,htm,html,bak,shtml'
$FileDesc = 'text file'
$FileIcon = 'path/iconfile.png'

As for openMSX source, it should contain something like:

$FileTyp = 'rom,dsk,cas,wav,mp3,zip'
$FileDesc = 'openMSX file'
$FileIcon = 'path/iconfile.png'

Or separating them like:

$FileType = 'rom'
$FileDesc = 'MSX ROM Cartridge image file'
$FileIcon = 'path/romicon.png'
$FileType = 'dsk'
$FileDesc = 'MSX disk image file'
$FileIcon = 'path/diskicon.png'
$FileTypes = 'cas'
$FileDesc = 'MSX cassette tape image file'
$FileIcon = 'path/tapeicon.png'

then the compiler automatically links a short machine code routine which register defined file types to be associated with my app according to selected platform my app should be working in.

By eimaster

Master (218)

eimaster's picture

02-03-2018, 05:20

I don't think openMSX developing team cannot implement file types self-registering. MSX.Emu did it so it is possible. I hope it would be added in the next release of openMSX for Android.

My MSX profile