Thursday, September 27, 2018

The web browser can replace many resource-heavy smartphone apps

In a reply on a heavily-commented Slashdot article.

A web browser can supplant individual apps, because I suspect, that each such large-scale app simply comes equipped with its own WebKit/Blink rendering engine to support all the functionality that the default rendering engine might not have on an Android phone due to it being more outdated than the latest version of app.



A browser with an adblocker, or a Gecko-based browser with NoScript is also one of the solutions in fending off big apps and script-heavy sites. Many large services also have lite versions of their social (Facebook) and e-mail (GMail, Yahoo, AOL) front-ends; and on desktop, YouTube has a "lite" version with the ?disable_polymer=1 URL parameter.



In fact, Flash was a much better solution for older computers, because HTML5 playback is baked into the browser process in Firefox, and HTML5 playback was always interfered with even through simply resizing the browser window. Because Flash was out-of-process in plugin-container.exe, I could elevate its priority a notch using Process Explorer in Windows. That essentially guaranteed hiccup-free playback with Flash 18 and Firefox 39.0. This was probably an unintended, or accidental feature that software developers created, but welcome nevertheless.



The trouble starts with very interactive functionality in comms apps, where video and audio are required. Resource-intensive games are in a category of their own, as they have always been on desktop.

The case for open source flashlight apps

There is really no need to download flashlight apps off the Google Play Store, because many of them want access to one's contacts and maybe other privileged information. The solution is to get an open-source flashlight app that is much more light-weight, and won't ask for too many permissions.
Initialy written as a reply comment on YouTube.

If your Android phone is relatively basic, and does not have a built-in flashlight, then the F-Droid store of free and open-source (FOSS) software offers many small-sized flashlight apps that do not require access to contacts.

This does require (temporarily) enabling third-party installs, but the open-source flashlight apps' much smaller size removes the requirement for Play Store-based apps that want access to data that they should have no right to have access to.

In some cases, a phone may have a built-in flashlight, but no OS-level functionality to turn it on. This applies to older versions of Android, which I've seen with Android 4.0 ICS (Ice Cream Sandwich), but may as well apply to any Android 4.x version. That's why an app is still required. Some flashlight apps available on F-Droid do require camera access to control the hardware flashlight.

In the F-Droid store app, search using the 'flash' and 'torch' terms, which will match anything that contains these patterns. I've chosen MrWhite, which is only 21 KiB in size.

Depending on version, Samsung smartphones' TouchWiz UI allows adding an "Assistive Light" widget for phones that have a built-in hardware flashlight.

Android-native flashlight functionality is accessible via Google Now in Android 5.0 Lollipop. I don't know, if the function is accessible by other means. Android 6.0 and 7.0 should have the flashlight functionality built-in — check the expanded notification area.

Wednesday, September 26, 2018

Moore's law works, but not the law about efficient coding in the consumer area

Posted as an anonymous reply on slashdot

A major reason why users do not perceive performance advantages, is, that they now use a web browser almost all the time, and most people do so without adblockers, and without NoScript (in Firefox), or some other ad/scriptblocker elsewhere, such as uBlock Origin, or uMatrix (to each their own).



These tools are some of the most basic ways of optimising resource usage in a browser, and go a long way in making websites and browsers more reponsive, thereby improving speed and user experience.



Alas, most people don't have that, and advertisers are reaping great benefits thereof.



On top of that, there's the transformation of simple web pages into resource-heavy webapps. There used to be a time, when I could still use Firefox 1.0 on an older computer without having to worry too much about not getting a connection to where needed, since many sites were carefully designed to match the relatively basic abilities of their target audience. Anything fancier used Flash. But that was when desktops and notebooks were not particularly powerful as a class.



Now, though, a newer browser is a must both due to security implications, and because of video providers using newer codecs in order to increase video resolution size (4K and up), and to simultaneously seek to have a lesser load on the network in the face of more and more users gradually getting to see all that fancy 4K video on their 4K screens. Soon-to-be 8K. While most simply contend with 1080p as some sort of a standard.



Security is also a thing, and a faster rig or farm is able to break ciphers faster, too. A major gaming rig with several cores has the power comparable to any supercomputer of the days of yore, but is not necessarily faster in terms of user experience, because the software is awful (Windows 10), or a badly-coded website with terrible fonts and CSS, or a site that mines coins without the user noticing, but then complaining, that 'their computer is slow.'



Or simply lots of sites without being active on several tabs at any one time, without the browser having adblockers on. Firefox mostly has a remedy for that, and I think, Google Chrome -- despite its awful recent flaws -- is coming up (or has come up) with a suspend feature for inactive tabs.

Wednesday, July 18, 2018

2G is not dead — or the many ways of phasing it out.

This was written in reply to a post on Slashdot about the possibility of future 2G phaseouts around the world.

Developing economies, like Venezuela, are very unlikely to shut down 2G and 3G networks even in the long term. Venezuela in particular is also unlikely to introduce 5G within the next five years.

Venezuela was once a rich economy pursuant to its extensive oil wealth, but unfortunately, did not become an advanced economy, as the country did not diversify its economy, and let the generation of any form of local produce atrophy. Calling the country's sad state a 'developing economy' is at best generous, or aspirational.

wrt 2G and 3G, Africa and South Asia are just as unlikely to phase these technologies out; though 5G is likely to be introduced in some markets, after 5G implementations in Northern Europe will be rated stable. 5G was launched on 27 June 2018 in Finland and Estonia.

The situation with mobile tech adoption in India is mixed. On one hand, Reliance have switched 2G off, and their subsidiary Jio has 4G from the outset. On the other hand, Airtel have not shut their 2G network down, and I can imagine, that there may be smaller mobile providers that still offer 2G service.

Countries with large 2G-only and 3G-only userbases are unlikely to shut these networks off anytime soon, and will opt for a gradual migration.

Some of the reasons in favour of gradual migration:

* Late adoption of new technologies owing to reasons economic, or geographical: 3G was never implemented until very recently; so, the entire mobile network is based on 2G (GSM), and a large amount (if not most) people have 2G-only phones. Wealthier subscribers may have phones that support 3G, but are unable to use the technology because of non-existent infrastructure;
* 2G and 3G have become plain utilities akin to landline phones, and can therefore be harder to phase out for their entrenched status, since:

* many of their subscribers might not be able to afford anything else;
* upgrading would increase the rate of planned obsolescence (lots of useless handsets); and
* would add to large amounts of electronic waste
— despite being labeled a legacy technology.

* Countries, where the 2G/3G adoption ratio per population is small (percentage-wise), can afford to upgrade faster.

* Countries, where 2G/3G adoption is perhaps in single digits, can choose to:
** adopt 2G/3G either to quickly get more subscribers for less;
** or where there is no 2G/3G in the first place, said countries can leapfrog existing standards, and implement 4G from the outset, but with the downside, that not all people will be able to afford mobile telephony until the market is reasonably saturated, as newer technologies are also more expensive. Nepal is one of those.
* Operators in very large and very wealthy economies have both monetary and security incentives to upgrade, and most of their userbase is probably using 3G devices at the very least (think lots of iPhones with at least iPhone 3G). The United States and Australia are examples of this upgrade model.

A historical example with the quick phaseout of 1G in favour of the 2G GSM:
In Estonia, the 1G NMT (Nordic Mobile Telephone) network was launched in 1991, and sunset in December 2000. In a country of 1.3 million, the greatest amount of NMT subscribers at EMT (then a major operator; now Telia) was about 19,000. By early 2000, the number of subscribers was 9600. And by December 2000, there were only 351 hold-outs left, after EMT announced in May that year, that they were going to shut the NMT network down in that same month of December. NMT was then still working in Finland, Sweden, and Russia.[Source: Ärileht, 11.12.2000]

Reasons for the shutdown of NMT in Estonia were the overall low and declining subscriber numbers, and the legacy status of the analogue 1G NMT network, which, compared to GSM, was not secure.

In time, 2G/GSM has in Estonia become an entrenched technology, relied on by people who choose to have a featurephone because of its high reliability, or because they're unable to afford a smartphone (pensioners). In 2016, Telia (then Elion) turned off WAP. The status of 2G in Estonia is similar to the rest of Europe: Despite the reasonably early adoption of 3G, GSM remains widespread, is in some ways entrenched, and operators have chosen a softly-softly approach with gradual migration.

The approach taken in Pakistan is different to that of India. In Pakistan, 3G and 4G were launched on 23 April 2014, which is quite late compared to China and the Philippines (both 2008). While four years ago may seem like a long time, then it really isn't. This late adoption of 3G and 4G means, that the number of GSM-only subscribers with 2G-only phones is still substantial.

That GSM is entrenched in such a way, is not a bad thing. It could be called 'deep adoption', which means, that the service is essential, widespread, and available to most everyone. Especially, when landlines are scarce. GSM was the first mobile standard adopted worldwide, and joining and using a GSM network is affordable to a very large number of people. GSM is like a well-managed regional bus service: One could use it to travel across the country, but not quickly. Removing it in the absence of viable alternatives would substantially reduce the level of development in the country, and would reduce its inhabitants' quality of life.

3G and 4G are faster: 3G is like inter-city bus service, and 4G like a high-speed express train. Neither is essential, not all territories are covered by it, but they have their uses and customers.

Other parallels: Radio is like 0G; analogue tv = 1G; DVB-T (digital terrestrial tv) = 2G (MPEG-2 or 4, non-HD); DVB-T2 = 3G (with full support for Full-HD broadcasts in MPEG-4); and cable tv (based on IPtv) is like 4G.

Sunday, June 24, 2018

A snippet on using Android 2.3 in 2018.

The text below was written in reply to a comment under one video about using Android 2.3 in 2018.
Pinch-to-zoom can and does work, but several things need to be done beforehand to implement this feature.

If I heard correctly, then the phone in question is a Huawei M865C, aka Ascend II (or Ascend 2). Its 600 MHz CPU is Qualcomm Snapdragon S1, specifically MSM7627, and is based on the ARMv6 architecture.

There is 160 Mb of internal storage available to the user. That's a very small amount, but storage is expandable with a microSD card, and PhoneScoop has it, that a 2 Gb card is included (either in the package, or as installed). I recommend using the incuded 2 Gb card, if it's already been installed and set to act as extended storage for the operating system.

One must update the device's system clock to make sure that some of the certificates are (correctly) rendered invalid, and that others still remain valid. This resolves only some of the certificate issues with the native browser component.

Then, one must let the operating system auto-update Google Play Store and Google Play Services. This happens in the background, and without notifications. These two services have several update cycles each to go through, as one depends on a version of another to update.

The version numbers below are based on what they are in Android 2.3.6.

AFAIK, the most recent Gingerbread version of Google Play Store is version 6.2.0.2, and the latest Google Play Services is v. 10.0.84.

The latest or most modern installable version of Google Play Services may take well over 100 MB of local storage, so a microSD card may be in order for long-term use, if it's not already present. Some Gingerbread devices support formatting a microSD card into an extended system volume, and a bundled card — albeit relatively small at just 2 Gb — may already do just that.

While it would be possible to move the microSD card around to other devices, the phone's operating system will still depend on that card for apps and updates, and in the absence of that card, the operating system might either cease working, or not work as one would expect. If the Android system supports graceful degradation, then only some updates and apps stop working and will appear as unavailable.

Once Google Play Store is accessible, update Google Maps. The most recent version is 6.14.5.

The most recent version of YouTube is 5.5.30. Watching videos and most other activities are possible, except uploading — there, you'll get a 410 error.

If all that doesn't work, install Firefox. Since the example phone, Huawei Ascend II, has a CPU based on the ARMv6 architecture, choose Firefox 31.3esr.

If Firefox is not available at the Play Store, you can download it from the Mozilla archive here. Note, that en-US is for a U.S.-English only package, and multi is for a multilingual package.

Devices with CPUs based on the ARMv7 architecture can have a version of Firefox up to and including v. 47.0.

Firefox has its own certificate store, which is quite a bit more up-to-date.

While these versions are not the latest versions of Firefox, they are still comparably more modern than the default Internet Browser, and so, Firefox will work in Android 2.3.

Note, that while Firefox will work and render modern websites, it's slow to start up as it loads settings and extensions. Since Huawei Ascend II only has 256 Mb of RAM, then Firefox is likely to take up all available RAM memory. You will need an ad-blocker, and you will need NoScript to prevent sites from hogging system resources. Most sites will load nicely and better than the aged default browser.

Use Firefox to login to the the web-based Google Play Store, where one can also download/install the official Google Maps.

I also recommend updating to Android 2.3.6, as it has some improvements, and slightly newer security certificates. The Android version in the video was certainly v2.3.4 or less.



If there is not enough storage to update Google Play Services:

Back up all your photos and videos, then use the built-in file manager.

In file manager settings, set it to show hidden files, and to show file extensions. Go to approximately where the photos are typically saved to: /sdcard/DCIM/.thumbnails . Files and folders with a leading dot are hidden.

Go into the .thumbnails folder, select all files, and delete them. This should save plenty of space, but note, that the system may re-create the thumbnail database at any time; especially when you view the gallery. Do not delete the DCIM folder, as it's the default folder where photos are saved to. The Camera app can be configured to save to a microSD card, if one is available.

Note, that if one or more thumbnails contain a small-scale image of a valuable deleted photo, you can connect the phone to the computer as a mass storage device, if the computer has access to relevant drivers. You'll need to download and install the phone's drivers from the manufacturer's website.

To reiterate:
You might need a separate microSD card on that phone, and if your particular phone model supports it, you can format or set the microSD card as an extension of system storage. Keep in mind, that that card is then tied to the phone.

Tuesday, April 17, 2018

Eesti kelle spelleri kasutamisest

Hiljuti saatsin tagasisidet ühele ettevõttele, mille ühel leheküljel oli kirjaviga, millest võis järeldada seda, et vigase teksti avaldaja võis olla kasutanud avatud lähtekoodiga / vabatarkvaralist Hunspell spellerit ja selle eesti keele sõnastikku. Siin on tagasiside tekst:

Võib eeldada, et kasutusel oli avatud lähtekoodiga / vabatarkvaraline Hunspell speller koos eesti keele sõnastikuga. Viimane pole täiuslik, kuid see on kasutuses järgmistes levinud tarkvarapakettides, mis tarvitavad õigekirjakontrolliks Hunspell spellerikomponenti:

• avatud lähtekoodiga Mozilla Firefox ja selle derivaadid (Pale Moon, GNU IceCat, Waterfox) või sõsarprojekt (nt. SeaMonkey);
• omanduslik, kuid eri aegadel tasuta jagatud StarOffice;
• avatud lähtekoodiga / vabatarkvaralised OpenOffice.org, Apache OpenOffice või LibreOffice;
• või suuresti omanduslik Google Chrome, mis põhineb avatud lähtekoodiga Chromium projektil. Google Chrome'i lehitseja spellerikomponentide hinge-elu ma väga täpselt ei tea.
※ Saab küll oletada, et omanduslik Google Chrome võib tõenäoliselt kasutada Hunspell spellerit, kuid ei pruugi, sest võib pigem pakkuda Google'i enda spellerikomponenti või -teenust.
※ Hunspell spellerikomponent võib olla Chrome'is siiski kaasas, sest see sisaldub avatud lähtekoodiga Chromiumis.

Ülalpool mainitud kontoripakettidest on StarOffice ja OpenOffice.org mõlemad vananenud ja aegunud, ning Apache OpenOffice'i arendus toppama jäänud ja aeglane.

LibreOffice'i arendus on kõige kiirem, kuid eesti keele sõnastik pole ka siis täiuslik, sest Hunspell spellerikomponenti ja sellele mõeldud eesti keele sõnastikku arendatakse eraldi, ning eesti keele sõnastiku arendamise progress on suurte keelte sõnastike arendusega võrreldes aeglasem.

See kõik tähendab omakorda seda, et kasutajad peavad nimetatud programmides sisalduvate spellerite poolt märgatud ja eesti keele sõnastikule tundmatuna märgitud sõnade juures olema eriti tähelepanelikud, et mitte läbi lasta kirja- või trükivigu sisaldavat teksti.

Sama kehtib muuseas ka Microsofti toodete puhul, ehkki omanduslikus Microsoft Office'is kasutatud õigekirjakontroll on paremini välja töötatud, ning on aastate jooksul olnud motiveeritud arenduses.

Saturday, April 7, 2018

Delfi Flash-põhine video, Firefox ja privaatne lehitsemine

Niisiis tekkis hiljuti vajadus vaadata Delfis artikli juurde käivat videot, aga video kohe tööle ei läinud.

Tingimused olid järgmised:
* Inteli integreeritud videoadapteriga (videokaardiga) sülearvuti, mis ei toeta OpenGL-i seda versiooni, kus Firefoxis mängiks HTML5 video;
* Windows XP SP3;
* Mozilla Firefox 38.8 (eestikeelne);
* VLC Media Player (see osutub hiljem oluliseks);
* Flash Player, mida selle vanema versiooni tõttu automaatselt ei aktiveerita;
* Firefoxi privaatse lehitsemise režiim;
* Samuti annab Firefox veebilehtedele teada, et jälitamist ei soovita (küpsised jne.).

Video mitte-esinemisel osutusid peamisteks põhjusteks teatud Delfi jt. domeenidel pluginate ja küpsiste õigused, ehk nende puudumine.

Protsessi kirjeldus


Kuna HTML5 video mängimine ei tööta videoadapteri draiveris OpenGL 2.0 toetuse puudumisel, langeb Delfi pleier tagasi Flashile, mille põhjal hakkab tööle JWPlayer.

Firefox kuni versioonini 43.x (k.a.) toetab küpsiste salvestamise kohta küsimist, kuid see süsteem ei tööta privaatse veebilehitsemise režiimis, ning eeldatavasti ka siis, kui Firefox annab veebilehtedele teada, et jälitamist ei soovita. Viimane võib tähendada, et ei võeta vastu küpsiseid, aga selle protsessi hingeelu ma täpselt ei tunne.

Lahendus


Kuna aga videomängijat ei tulnud ette, selgus lähemal uurimisel, et Flash ja küpsised oleksid teatud domeenidel lubatud.

Muuhulgas asub Flashil põhinev JWPlayer näiteks g3.nh.ee domeenil.

Küpsiste ja pluginate õiguste muutmiseks tuleb teha järgmist:
  • Mine aadressile

    http://g1.nh.ee/ct/ej/arrow_250.png

    Ette tuleb PNG-formaadis olev noolepilt, ning väljaspoolt pilti tee lehitseja (musta värvi) vaatealale paremklikk ja vali hüpikmenüüst "Vaata veebilehe teavet".
  • Uues aknas "Veebilehe teave" mine vahekaardile Õigused, ning erinevate õiguste nimekirjas tee järgmised muudatused:
    • Sektsioonis Pluginate aktiveerimine vali raadionupp "Lubatud" igal real, kus on "VLC Web", sh. ka see VLC rida, kus võib olla kirjas "Plugin võib sisaldada turvaauku!" Seletuseks niipalju, et peale VLC installimist on Flash-plugin märgitud mingil põhjusel VLC-ks.
    • Keri nimekirjas alla, kuni jõuad eraldiseni Küpsiste salvestamine.
      Seal vali "Lubatud" või "Lubatud selleks seansiks".
    • Korda sama asja järgmistel aadressidel:
      • Delfi koduleht (www.delfi.ee) või vajadusel mõni muu Delfi alamleht, mille artiklis näidatakse videot, nagu näiteks Delfi Publik (publik.delfi.ee)
      • Delfit toetavad domeenid:
        • http://g1.nh.ee/ct/ej/arrow_250.png
        • http://g3.nh.ee/m/dd/nupp.png
      • JWPlayeri domeen:
        https://ssl.p.jwpcdn.com/6/12/logo.png
      • Video lähtedomeen aadressil eeds.babahhcdn.com või mõni muu babahhcdn.com alamdomeen:
        http://eeds.babahhcdn.com/crossdomain.xml
  • Videot sisaldav artikli lehekülg tuli uuesti laadida.
Suurema osa näitefailide asukohad sain kätte klikkides näiteks Delfi artiklil "Vaata veebilehe teavet" ja siis selle akna sektsioonist "Meedia". Ülejäänud asukohad sain teada Firefoxi veebiarendaja Network tööriista ja Internetiotsinguga. (Nii või teisiti olid failide asukohtad avalikult kättesaadavad.)