Inspirated

 
 

February 6, 2010

CSV Auto-Responder v1.0 — S60 3rd Edition Compatibility

Filed under: Blog — krkhan @ 3:16 pm

As I finally got my hands on a S60 3rd Edition device last week in form of E71, it was obviously the time to fix my PyS60 scripts for the new version. By using some workarounds to fix some brain-dead compatibility issues which I will detail in a later post, I was able to get CSV Auto-Responder running properly:

csvautoresponder-1.0.zip
CSV Auto-Responder v1.0 Screenshot

Tags: , , , , , , , , ,

November 21, 2009

PyS60 CSV Auto-Responder v0.1

Filed under: Blog — krkhan @ 8:11 pm

The idea is pretty simple actually. You run the application on your cellphone and give it the path of a CSV file. The file contains some data which can be queried. For example, let’s assume that the contents are:

ID,Name,Age,Message
0,The Black Knight,43,”I move for no man”
43,Sir Galahad, 38,”Oh, let me have just a little bit of peril?”
569,John Doe,21,”Hello World”

Next, you choose a keyword; something simple like “Respond”. Then, you put the cellphone aside. It keeps checking the incoming SMS messages and as soon as it receives a message having something similar to … :

Respond 43

… it queries the CSV file and replies to the sender with results of the lookup. In our case, the reply will be:

Received query 43 from +xxxxxxxxxxxx
Found record in database:
> Name: Galahad
> Age: 38
> Message: Oh, let me have just a little bit of peril?

And that is it. The script can be downloaded from this link. Updates in future shall be linked on its specific Inspirated Code page. Here’s the whole thing in action:

PyS60 CSV Auto-Responder

Tags: , , , , , , , , ,

October 31, 2009

HOWTO: Use PyS60’s Bluetooth Console on Fedora/Ubuntu/Debian Linux

Filed under: Blog — krkhan @ 11:03 pm

While developing PyS60 apps is one of the most fun things you could do with your Nokia phone, debugging them isn’t as zippy as one would hope for in a Py development environment. To make up for that, PyS60 gives the developers an option for directly connecting to the interpreter through Bluetooth. Doesn’t sound very appealing? How about this: You connect your laptop with the cellphone, jump in at some place in the code while your app is executing and then use lappy’s big keyboard for exploiting different code and values in the interpreter. Sounds better?

To accomplish this on a Linux distro, you will need the following packages installed on your system:

Name Links
gnome-bluetooth
uucp/cu

After making sure that both are present on your system, install PyS60 on your phone if you haven’t already done so.

Now the fun part:

  1. Switch on Bluetooth in the cellphone.

    PyS60 Bluetooth HOWTO, Mobile screenshot #1

  2. Launch bluetooth-properties and click on “Setup New Device”.

    PyS60 Bluetooth HOWTO, PC screenshot #1

  3. Select your cellphone.

    PyS60 Bluetooth HOWTO, PC screenshot #2

  4. You will be shown a pin.

    PyS60 Bluetooth HOWTO, PC screenshot #3

  5. Enter the pin when queried on the cellphone.

    PyS60 Bluetooth HOWTO, Mobile screenshot #2

  6. The phone should be successfully paired.

    PyS60 Bluetooth HOWTO, PC screenshot #4

  7. Authorize your Linux system to make automatic connections to the phone.

    PyS60 Bluetooth HOWTO, Mobile screenshot #3

  8. As root, run this shell script:
    [root@orthanc ~]# ./rfcomm-listen.sh

    Serial Port service registered
    Waiting for connection on channel 2

  9. Launch PyS60 interpreter and select “Bluetooth Console” from the application menu.

    PyS60 Bluetooth HOWTO, Mobile screenshot #4

  10. Select your Linux machine.

    PyS60 Bluetooth HOWTO, Mobile screenshot #5

    The command you ran in previous step should have new output:

    [root@orthanc ~]# ./rfcomm-listen.sh

    Serial Port service registered
    Waiting for connection on channel 2
    Connection from 00:17:4B:B6:35:31 to /dev/rfcomm0
    Press CTRL-C for hangup

    The cellphone screen should be showing something like this:

    PyS60 Bluetooth HOWTO, Mobile screenshot #6

  11. As root again, open a new terminal and run:
    [root@orthanc ~]# cu -l /dev/rfcomm0

    Connected.

  12. Hit Enter till prompt (>>>) appears, then type:

    >>> import appuifw
    >>> appuifw.query(u'Hello World', 'text')

  13. Viola, you should have an input box on the mobile screen:

    PyS60 Bluetooth HOWTO, Mobile screenshot #7

  14. Enter any text and press the OK key. It should be show up in the terminal you were using to type in code:

    >>> import appuifw
    >>> appuifw.query(u'Hello World', 'text')
    u’Finally’

  15. Exit the interpreter by typing CTRL+D on an empty line:

    >>> import appuifw
    >>> appuifw.query(u'Hello World', 'text')
    u’Finally’
    >>>
    Interactive interpreter finished.
    cu: Got hangup signal

    Disconnected.

Pat yourself on the back. Now, you can use your Bluetooth console to import your modules, execute some stuff and then jump in the middle to test some extra lines or values. In fact, I found it to be a pretty darned good way of learning about PyS60’s API. Res secundae!

Tags: , , , , , , , , , , , , , , , ,

October 11, 2007

Watching the froots

Filed under: Blog — krkhan @ 6:55 pm

“The rat, the mouse, the fox, the rabbet; watch the roots, the lion, the tyger, the horse, the elephant, watch the fruits.” — William Blake

(As far as history tells us, Blake was a n00b in the field of computers and internet. Which adequately explains why he knew as much about browser wars as anyone’s grandma. Certain fiery foxes do watch the (open-source) roots, but I never heard anything about a Radiating Rat, Mercurial Mouse or Rigorous Rabbit.)

Anyone not living under a rock for the past decade knows this pretty well: Firefox is the best web-browser on the face of earth, period — as far as embedded browsing isn’t concerned. For me, and everyone else who actually browses full-blown websites on cell phones, Opera still holds that honor on mobile platforms. Here’s a list of few good reasons why:

  • Page refitting “modes”. You can view the page in its original design or opt for having Opera “fit” it on the mobile screen for you.
  • Inline frames. You can’t log-in in some of the Google services without them (e.g. orkut).
  • Better Javascript support.
  • One reason to rule them all: absence of Firefox on the platform.

And the one reason looks like it’s finally going to be rectified by Mozilla. Gentlemen, everyone’s favorite fox is aiming for mobile platforms.

The bad news? You’re gonna have to wait for about another year before you could actually get your hands on it (the project is as mature right now as Steve Ballmer; and that’s virtually indicative of infancy). Other than that, the details are aplenty and if you do use internet on a hand-held, you should definitely give the announcement link a visit.

Tags: , , , , ,