📜 ⬆️ ⬇️

Installing java applications on a Samsung phone in Ubuntu


Not so long ago, I completely transferred my home computer and laptop to Ubuntu. And everything would be fine if there was no desire to put a new game on the phone (L320) of his bride.
An "interesting" feature of Samsung phones is a very peculiar software, both on the phone itself and on the computer. It's no secret that computer software exists only for Windows.

Purpose: Install java-application on Samsung phone
Barriers: No Windows for PC Studio (PCS). Like no PCS for Linux
What is: There is a cord, PC Studio for Windows, a laptop with built-in bluetooth, hands and a programmer's head

Ever since the days of Windows, I checked - via bluetooth or by connecting the phone with a cord like a USB flash drive, the application cannot be installed in the phone. The only way, besides downloading via WAP (which we are not interested in, in principle), is to transfer it to the phone using software from the manufacturer - Samsung PC Studio. This method is described in detail in the manual and on the manufacturer's website.
It all started with an attempt to install PCS using Wine. The application was installed and running without any problems.

Samsung PC Studio under wine

It turned out that the standard wine assembly is not able to work natively with USB. Not long after searching in Google, a solution was found. This is a patch to the source code of wine, and very old versions. Something, but I didn’t want to patch a serious application with a patch for older versions and then collect it, because I installed the latest stable release 1.2, and the latest release of the patch is dated August 31 of last year and is directed to version 1.1.28.
This option is no longer available.
Back in 2008, the idea of ​​the need to support bluetooth was held in the wine development community, but as far as I understood, this did not move beyond the idea. The reason for this was supposedly the fact that 2/3 of the applications use their bindings for working with bluetooth and it is almost impossible to implement the API of all drivers for all adapters, i.e. there is no common interface that all applications would use. If I misunderstand something, please correct me in the comments.

Com port
On a laptop, I do not have a COM port, but knowing about the features of * nix systems, that each device is a file (in the / dev / folder), I began to dig. The idea was simple - to redefine one of the available interfaces, usb or bluetooth, to a virtual COM port and teach the wine to use it.

The correct request to the search engine brought me to the topic on the English-language forum, which described not quite a good way to make this connection.
But “not entirely successful,” after all, does not mean bad, right?

I began to thoughtfully repeat the steps looking for possible mistakes or possible alternatives. All actions were performed, but I still could not find a way to make wine to see the dos device — the COM port I created. Yes, and also, there was a problem - I did not find the file device described in the instruction with the mysterious name rfcomm0 . A little later, going to the finish line, I found how to create it, but more on that below.

If someone tells you how to connect such a port to wine, then all manipulations will be simplified to the normal use of PCS under wine with emulation of communication through a COM port.
I have this attempt failed.

Linux way or battle won

Realizing that the native software will not help me, I began to experiment.

Having opened Synaptic, I began to scrutinize the names and descriptions of bluetooth-related packages and look at the packages shown on the search for “wine”.
The package that saved me is called blueman .

sudo apt-get install blueman

The package puts a great app - Blueman - GTK + Bluetooth Manager . This application allows you to work very thinly with the bluetooth adapter and the devices to which it is connected. Screenshots of the program are on the project website.

So, first of all, having climbed the program menu, interesting possibilities were found, for example, “Serial Port Service” . It was this service that made it possible to create the above-mentioned device / dev / rfcomm0 . But as is clear from the above, this method did not bring effective results.

Everything turned out to be much simpler - in the context menu of the device (after a laptop with a Bluetooth enabled phone was found by a laptop) there was a very interesting “ View device ” item. After selecting it, the phone appeared in the list of storage media in Nautilus. At the same time, with the standard security settings in the phone, for each operation on the computer, the phone responded with 1-3 confirmation requests, which was quickly stopped by turning off the corresponding option in the phone menu. Going to a new connected drive (which, by the way, had a mobile phone icon, not flash drives, as is the case with USB connection), I found there is not the contents of the memory card, but the phone's memory! Suspecting that the victory was close, I opened the Other files folder there and copied the jar and jad game files there. And the phone happily offered me to install a new application.


The rescue application turned out to be also very useful for working with a bluetooth mouse. In particular, it allowed to establish a connection with it much faster, if “I didn’t turn it on at boot time” or “took the laptop away, and forgot the mouse” - a trifle, but nice.

Afterword - Fight but not war won
In terms of military terminology - Only this battle is won, but not war. There is still no way to fully interact with the phone from "non-Windows" systems. But the interaction does not end with the transfer of pictures, music or games to the phone or from the phone. Many still need contact synchronization functionality or the ability to send SMS using a computer. Of course, for specific tasks should use the appropriate devices. The phone mentioned at the beginning, the L320, is not more than a means of communication and a primitive music or radio player. But this does not mean that its owner will not have a desire to keep the phone book up to date, synchronizing it with other devices. And it’s not rare that a computer is used as a buffer device (or as backup storage), which is not obliged to use Windows at all. I do not think that the whole thing is in some kind of marketing plot or something similar, no. For me, it says only about who the product is aimed at, how the manufacturer treats its customers. I do not think that the manufacturer could not implement software for other operating systems or at least provide more human capabilities in their devices.
Probably the whole thing in a strange confidence that "the user will be comfortable just like that, and not otherwise."

Upd: The user asm0dey , prompted that there is a Wammu application for working with phone data (the list of supported phones is here ). But for my case - installing the application on the Samsung L320 - the program did not fit. But judging by the descriptions, someone can help make friends with Linux mobile darling.

This post became a ticket for Habr for me. For that special thanks jenyay . If this post after the sandbox is not lost, but I just did not find it ...

Source: https://habr.com/ru/post/100813/

All Articles