Introduction

 
1. Introduction - Programming on Mobile Devices

There is a tremendous advancement in the mobile domain, currently mobile has been replacing the desktop and laptop in some other ways. This is an era of Smart Phone where most of the daily life work like communication, computing, Making calls, Sending messages, Playing music/videos, Gaming, Mailing, Web-browsing , Transaction business and Social Networking etc. has handle by our mobile phone. In addition, mobile devices can be used for programming like C, C++, Shell Scripts and Python.

Some of Mobile devices are capable of running Linux commands, Vi-editor, Filters, Pipes, Shell programming, and the languages like C/C++, Python and WAP.

Target Device

 
2. Target Device

Target mobile devices are N 900 and N950 based on Linux environment by Nokia.

Sample Experiment

 
3. Sample Experiment

  1. Vi-Editor: VI is used to create any source file like shell programs, python, C or C++ programs etc.
    $ vi [filename]
    Eg:-
    i) vi pro.sh
    ii) vi hello.c
    iii) vi examp.py
  2. Shell Programming: Shell programming on mobile is similar to the desktop

    Step 1: Open the xterminal in Nokia N900/950
    Step 2: Write a Shell Program :- Use editors like VI editor,
    Step 3: GTKeditor etc. to write with the file name extension .sh as in linux desktop environment.
    Step 4: Run the shell script:- ./shell script name .
    E.g. vi pro.sh
    ls -l
    pwd
    date
  3. Filters and Pipes:
    Step1. grep "ls" pro.sh
    Output: ls –l
    sed ´/ls -l/d´ pro.sh > pronew.sh // to delete the words ls –l from the file pro.sh and redirect the result into pronew.sh cat pro.sh| sort > pro1.sh
    Output: date
    ls -l
    pwd
  4. Python Programming:
    Step 1 : Open the X-terminal
    Type python to go to the python shell
    Eg:- to print any text similar to printf in C
    print " www.mobileeducationkit.net"
  5. C Programming : For C programming, we need to install GCC compiler as
    Download the following packages to work with gcc in the given order:
    • binutils_2.18.50.20070820-4+0m5_armel.deb: This package is used to assemble, link and manipulate binary and object files.
    • libgcc1_4.2.1-4maemo9+0m5_armel.deb: gcc support library
    • libgomp1_4.2.1-4maemo9+0m5_armel.deb: gcc OpenMP (GOMP) support library
    • cpp-4.2_4.2.1-4maemo9+0m5_armel.deb: The GNU C preprocessor
    • gcc-4.2-base_4.2.1-4maemo9+0m5_armel.deb:This package contains files common to all languages and libraries contained in the GNU Compiler Collection (gcc).
    • gcc-4.2_4.2.1-4maemo9+0m5_armel.deb:This package is the GNU C compiler, a fairly portable optimizing compiler for C.

    Steps:
    Browse the directory where these packages are stored.
    • #/home/user/MyDocs/gcc
    • De-packaging all the above downloaded packages
    • /home/user/MyDocs/gcc #dpkg – i <package name>
    • Go to home directory and create one new directory as /home #mkdir cprog
    • Compile the source C program
    • /home/cprog # gcc-4.2 hello.c –o out
    • View the out put by runing the exe file
    • # ./out

Note:-you will get the output on the terminal screen.

E.g. #include "stdio.h"
main()
{
printf("mobile c programming lab Mek \n");
}

Snapshots

 

4. Snapshots






Observation


5. Observation

It is observed that as we are able to run C / C++ and Python on N900, in coming future we also want to install JVM and run the java program as well. So by this way we are hoping that we can remove the constraint of desktop environment in programming aspect with the help of Smart Phone. Thus, it demonstrate the right way of using computing devices.

 

Download Link

6. Download link


Slides on Mobile Programming