Showing posts with label Symbian. Show all posts
Showing posts with label Symbian. Show all posts

Tuesday, December 8, 2009

Go on with pyS60

I got a very good feedback from my previous post: "How to simulate PyS60 in your PC". As the request of opentechlab readers, I am attempting to write a brief beginner level tutorial on pyS60 emulator.

Once you are successful in installing and setting up the environment (If you didn't set up yet, click here), it is the time to go on.

Start the emulator program from:

Start->All programs -> S60 Developer tools -> 3rd edition FP2 SDK -> v1.1 -> Emulator

You probably need to wait for a couple of seconds to load it if your system is slow. Then a medium sized window with a full fledged mobile phone appears on the screen.

Now you need to open python. Just do as in your mobile phone. it's in Menu -> Installations -> python.

Now it's ready and do what you want.

Hacking python script

Select options -> Run script ->ball.py

You can move the ball anwhere in the screen. It's a physics simulation example in python. You can see the actual python script by opening ball.py file using any editor (notepad is not recommended. programmers notepad is good). The file is stored in :

C:\S60\devices\S60_3rd_FP2_SDK_v1.1\epoc32\winscw\c\python

Search for the word 'blobsize'. Then you can find a line like:

blobsize = 16

Change the value of blobsize into 25 and save it. Then open ball.py in emulator. Did you notice any change? Similarly you can change acceleration, gravity (what about changing gravity into -0.01 ?) etc.

Developing your own programs

I am just starting with a hello world. Here is the program.

1)Simple hello world

print "Hello World!"

2)Say, hello world

from audio import*

say("Hello World!")

3)graphical hello world!

import appuifw
appuifw.note(u"Hello World!", "info")

It is good practice to make a short cut of python on the mobile desktop by changing options in settings.

Monday, December 7, 2009

How to simulate PyS60 in your PC

You can do your experiments in PyS60 without touching your mobile phone. The experimentation is easy while you set up everything in your PC. Here I am explaining how to set up the PyS60 environment in WinXP platform. I didn't try this attempt on my Linux yet. I will surely post about it if I get some good mobile stuff on Linux. This will be a boon for python developers in Nokia S60 mobile phones. But rarely it can be seen that some python scripts works neatly on simulator may cause strange responses on your real world system. I would like to here about it if you get any funny experience on your S60 device.
Download the required things:

1)Download S60_3rd_Edition_SDK_Feature_Pack_2_v1_1_en.zipfrom the following link:
http://www.forum.nokia.com/info/sw.nokia.com/id/807ec36d-0a8e-4bda-8e10-4d5e5bb4764a/S60_3rd_Edition_SDK_Feature_Pack_2_v1_1_en.zip.html


2)You can find ActivePerl 5.6.1 build 635 here:
http://downloads.activestate.com/Act...SWin32-x86.msi

3)Download PythonForS60 _1_4_5_SDK_3rdEdFP1.zip from http://sourceforge.net/projects/pys60/files/

First install ActivePerl because S60 SDK requires it.
Then install S60 SDK. Please note to install it in C:\ drive to avoid confusion.
Extract PythonForS60_1_4_5_SDK_3rdEdFP1.zip. Then you get another archived file sdk_files.zip.
Extract it again and you get a directory named 'epoc32'.
Copy this directory into "C:\S60\devices\S60_3rd_FP2_SDK_v1.1"
Then probably Windows XP asks to replace the already existing folder 'epoc32'. Click yes.
You have done. Cheers!

Monday, August 31, 2009

Bluetooth interactive console using pyS60

Nowadays, text messages via mobile phones are shortening to small, but difficult to understand language. I don't think whether the major reason behind this shortening is economic, but most people feel tedious to type text through a 4*3 panel. Typing a program like, C or python in correct syntax is again a tedious work. You can use bluetooth console, in order to avoid this problem effectively. Here I describe how to setup bluetooth consloe communcation in your MS Windows XP platform. For beginners, this procedure may feel ambigous. So I tried my maximum to describe it with screenshots.

If you are not aware of pyS60 please read this.

You can find some other tutorials here:
s60python
nokia wiki
pys60 Library Referance
Yet another tutorial
Lecture

The above links were extremely useful to me. The procedure is repeated here, but I tried to describe it in rather simple way. If you feel any difficulties, please inform me.

Setting up bluetooth interactive console in winXP

step1: Plug your bluetooth device into your PC (any USB port). Then Run your bluetooth driver program which you installed from the CD/DVD when you buy your bluetooth dongle.
Then automatically a serial port is assigned for it. In my PC, it is COM6. You can do step 5 in case you don't know the COM port your PC supported.

step2: Run command 'hypertrm' in your run window. Run window can be opened by clicking Run option from the start menu.

step3:You will get hyperterminal opened like this:

Enter any valid name for your connection and select a suitable icon and forward.

step4:Then you will get another box like this:

Type any 3 digit area code and phone number.Your country or region may be automatically filled. If not, do it manually. Select COM6 from 'connection using' lineEdit tab. It may be changed. You will get which COM port your computer assigned (If you didn't get it, notice first screenshot)

step5:Take your symbian smart phone with pys60 installed. Turn your bluetooth ON and open pys60 application. From 'options' menu, select 'bluetooth console'. Your application then searches for blutooth device. You can optionally select it as your default connection.

step6 (Error Debugging): You are now probably connected successfully. Not yet? Check your connections. Check whether you run your bluetooth driver.If your bluetooth driver is running, a symbol of bluetooth will appear on the panel (see screenshot 1). I used Enter blutooth dongle (part number:E-UBTV) from entermultimedia. and it's driver(BlueSoleil). The driver is downloadable in case you lost the CD/DVD with your dongle. If you can type anythong on the white blank screen of hyperterminal, you are probably done everything. Else, you should check the whole procedure.
In any case, you should plug out the dongle and replug.
Didn't connected yet? Some mysterious powers are playing around you ;-)
I am happy to help if you can't find any way to connect.


step7: If you are successful in connecting your mobile, you are done.

step8:You can do anythong with python. Try these

step9: While you close application, you get a dialogue box and click yes.

You can save hyperterminal settings for the future use. Then when you run 'hypertrm' command, you will get a window like screenshot 2. simply close the box named 'Connection Description' and then you can open the saved file (here, pybluetooth.ht). Again there is an option to save the connection in your mobile and make it as default connection.

Saturday, June 20, 2009

Google maps works without GPS


A GPS phone with Google maps is really amazing. But unfortunately, my Nokia E65 has not any GPS support, but navigator programs are included in Symbian. A bluetooth GPS device can be used along with many phones without any GPS module in-built. But it costs around Rs.5000 India. But Google maps is useful even if you have any GPS support because it works well using GPRS network to find current position, not much accurate because it will show the nearest mobile radio transmitting tower. But it becomes handy and have only 1.3MB to download and useful in navigation. Recently, Nokia also provided "nokia maps", but I am not commenting about it because, now I decided to stick with Google!
You can download Google maps directly to your mobile phone from m.google.co.in/maps
or vist www.google.co.in/mobile from your PC.