Skip to main content

Ralsina.Me — Roberto Alsina's website

I'm a nerd, but I Have a Cheap Phone

I just got a new phone be­cause my old one dis­ap­peared. I got a Sam­sung Star, which is not a smart­phone, but what they call a fea­ture­phone, which seems to mean "it does a lot of things but is cheap, can on­ly be cod­ed in Ja­va and does­n't run an­droid".

Here's some of the fea­tures of this baby:

  • Touch­screen, 400x240

  • Fake GPS (gives you a 400 me­ters ra­dius of your lo­­ca­­tion. Good enough for me in the city)

  • We­bkit-based brows­er that works sur­pris­ing­­ly well (it comes with the LGPL as a doc­u­­ment and you can't delete it :-)

  • Ac­celerom­e­ter

  • FM ra­­dio

  • A 2GB mi­cro-SD card

  • 3.2MP cam­era (takes video at 320x240).

The cam­era can take de­cent pho­tos in good con­di­tion­s:


And it even has some "ad­vanced" fea­tures (by which I mean: things my cheap ded­i­cat­ed cam­era does­n't do), like smile shut­ter and panoram­ic shot­s:


Oth­er that that... well, it's a phone, what can I say. It was "cheap­", which means "it costs more than I want to pay for it, but less than the al­ter­na­tives".

So, how am I tak­ing ad­van­tage of it...

First: I have not had a de­cent pock­et-­sized ebook read­er since my last Clie died. So, I looked for soft­ware to do that.

It turns out that the world of Mi­dlet­s, as fea­ture phone apps are of­ten called, is aweird place, where things are quite hard to find for the unini­ti­at­ed.

There is a sort of "app shop" at http://get­jar.­com but it's by no means com­pre­hen­sive, and of­ten things are quite hard to find.

Af­ter lots of look­ing, I found a good (I may even say very good) pro­gram called Fo­liant. Here's their home page, rus­sian on­ly ... it's weird, my favourite Palm ebook read­er, Palm Fic­tion al­so has a rus­sian-on­ly site!

Of course, the fonts sucked (way too large) but it turns out you can con­vert TTF fonts us­ing this tool so I am now back to the love­ly Droid Sans I am used to.

An­oth­er nice thing about the new phone is that it can ac­tu­al­ly play me­dia (yes, my pre­vi­ous phone was so crap­py it did­n't even play mp3). But... not ev­ery kind of me­di­a. For au­dio, just use mp3. For video... it's a bit more com­pli­cat­ed.

Here's the short ver­sion:

  1. Con­vert us­ing Hand­Brake, ffm­peg MP4 video, AAC au­­dio.

  2. Al­ways use the .m­p4 ex­ten­­sion, the phone is not smart enough to know what a .m4v is.

  3. Don't make the video larg­er than 320x240.

Num­ber 3 is a prob­lem. For ex­am­ple, you may have a video in a wide screen for­mat, like 640x272, which is a 2.35:1 ra­tio.

The ob­vi­ous thing is to cap the width to 320, and that would give you a 320x136 video.

Well, that's wrong. What you should do is find the right height, keep­ing as­pect ra­tio, for a 400px width. In this case, that would be a 400x170.

But you can't use a 400x170 video! which is why you will use 320x170, and on play­back tell the phone to stretch it and ig­nore as­pect ra­tio. And voila, 400x170 and the cor­rect as­pect ra­tio.

The dif­fer­ence? 320x130 has on­ly 41600 pix­el­s, while 320*170 has 54400, which means you get a 30% bet­ter pic­ture.

Yes, it's tiny (3 inch­es) but it looks pret­ty sharp, and de­pend­ing on the kind of ma­te­ri­al you are watch­ing, it work­s.

UP­DATE: Fo­liant is bet­ter than I thought, once you get the Sam­sung-spe­cif­ic ver­sion. It's fullscreen (no sil­ly soft but­ton­s) and the screen ro­tates au­to­mat­i­cal­ly us­ing the ac­celerom­e­ter. It's a plea­sure to use, and the UI is very nice.

Spain is much bigger than you think!

On the news to­day (the news­pa­per is Tiem­po Ar­genti­no, sor­ry about the un­read­able pho­to):


It says "In Spain it amounts to less than 340 thou­sand cus­tomers a mon­th, or 0.006% of the to­tal".

This is talk­ing about cell­phone user­s. Now, how many cell phone users are there in Spain?

Ac­cord­ing to this news­pa­per, 340000 are 0.006% of the to­tal, so... 5 666 666 667 (aprox­.), there­fore, Spain has rough­ly one cell phone for each man, wom­an and child in the world.

Things I learned publishing a magazine

To­day at 00:00:00 GMT-3 PET: Python en­tre to­dos was in­deed launched, in time (ar­bi­trary but forced) and in bud­get ($0).

So, what did I learn? I learned a lot!

  • The on­­ly thing you need to pub­­lish an e-­­mag is time and con­­ten­t.

  • Time can be con­vert­ed in­­­to con­­ten­t, but if you write ev­ery­thing your­­self it's a blog, not a mag­a­zine. Luck­­i­­ly, PET found great con­trib­u­­tors.

  • If you want util­i­­tar­i­an de­sign, rst2pdf can do the job

  • In fac­t, it can do it bet­ter than oth­­er tools in some ways

    • I can push a fixed ver­­­sion of the PDFs in 5 min­utes for all lay­out­s. How much would it take me us­ing Scribus or oth­­­er DT­P? In a mag­a­zine where cor­rec­t­­­ness mat­ter­s, that's a big deal.

    • TOCs are bet­ter than in most am­a­­­teur PDF mag­a­zines I've seen. The in­­­-­­­con­­ten­t-­­­TOC is click­­­able, and the PDF TOC is per­fec­t.

    • Page num­bers in the PDF TOC make sense (no, the cov­­­er is not page 1)

    • I am pro­­­duc­ing 6 PDF ver­­­sion­s: A4(b­w, colour), A5(b­w,­­­colour), Book­let(b­w, colour) and I could add any oth­­­er I want in a few min­utes.

  • I learned about PDF im­po­si­­tion!

Let's ex­plain the last one:

Sup­pose you want to print a small book­let, and you have 32 pages of con­tent. How do you do that?

The eas­i­est way is to print it 2-up dou­ble-sid­ed in A4 pa­per so that you can stack the pages, fold them down the mid­dle, sta­ple them, and get a nice A5 book­let.

The prob­lem is that the page or­der­ing is hard to get right. For ex­am­ple, for a 4-­page book­let, you need to print one A4 page with pages 4-1 on one side and 2-3 on the oth­er. For an 8 page book­let it's 8-1,2-7,3-6,4-5.

Lucklily there's a way to get this done au­to­mat­i­cal­ly:

1. In­stall pod­ofo 3. Get book­let-A4.­plan (see be­low) 2. Run this:

podofoimpose my-A5-pages.pdf my-booklet.pdf booklet-A4.plan lua

book­let-A4.­plan is this:

---Generic Booklet (A4)
---It is said generic as it will try to determine
---automatically how to fit the booklet onto A4
---paper sheets, scaling pages if necessary.
---it is well suited for office documents for
---which you do not care too much about resulting
---imposition artefacts since it manages to save
-- print("Booklet")
-- We output an A4 booklet
PageWidth = 595.27559
PageHeight = 841.88976


-- We assume that H > W
-- Argh, we now can do better since we have "if" ;-)
-- Scale = PageHeight / (2*SourceWidth)
if(SourceWidth <= SourceHeight)
--  If you A5 pages are not really A5, uncomment the next line
--  Scale = PageHeight / (2*SourceWidth)
    Scale = 1
    rot = 90
        xof = SourceHeight
        yofRA = 0
        yofRB = SourceWidth
        yofVA = 0
        yofVB = SourceWidth
--  If you A5 pages are not really A5, uncomment the next line
--  Scale = PageHeight / (2*SourceHeight)
    Scale = 1
    rot = 0
        xof = 0;
        yofRA = 0
        yofRB = SourceHeight
        yofVA = SourceHeight
        yofVB = 0

    rest = PageCount % 4
    totp = PageCount
    if rest ~= 0
        totp = totp + ( 4 - rest)
    inc = 0
    count = 0
    imax = totp/4
    while count < imax
--          We assume that podofoimpose will discard invalid records
--          such as those with source page greater than PageCount
--          print(totp, inc, rot, xof,yofRA, yofRA, yofVA, yofVB)
-- Recto
        PushRecord(totp - inc , inc + 1 , rot, xof , yofRA)
        PushRecord(inc + 1 , inc + 1 , rot, xof , yofRB)
-- Verso
        PushRecord(inc + 2 , inc + 2 , rot, xof , yofVA)
        PushRecord(totp-(inc + 1) , inc + 2 , rot, xof, yofVB)

        count = count + 1
        inc = inc + 2

That code is tak­en from here: http://www.oep-h.­com/im­pose/

And voilá, you get a scram­bled PDF with the pages in ex­act­ly the right or­der (and emp­ty pages added as need­ed).

Contents © 2000-2020 Roberto Alsina