Saturday, November 1, 2008

J2ME versus other mobile application development technologies

i have left mobile application developmet area (specifically J2ME) from about half year but i am still eager to know the latest technologies in the area so i found in the last few years appear many mobile application development technologies what make J2ME different from them and what is the features for each technology


first i will list most of the technologies that compete with J2ME



  1. Android

  2. c++ Symbian

  3. flash lite

  4. Web Widgets – Web Runtime for S60

  5. Widget WidSets

  6. Yahoo Mobile Widget

  7. JavaFX

first i want to list the keys that i will make my comparisons based on them



  1. easy of programming and learning

  2. precentage of devices that support each technology

  3. precentage of developers in the mareket for each technology

  4. supporting tools (materials,IDEs, emulators,...)

  5. customer devlivery-->how its easy to deliver a mobile application to the end user in an easy way

  6. porting problems-->how its easy to port specific application to another model of mobile devices

  7. limitations and suitable applications for each technology

  8. localization problems

  9. precentage of usage for each technology

Android


programming language on Android phones are Java so any java programmer or J2ME can leran Android very fast. but there is very samll number of devices that support Android phone for now there is only one phone model that support android (T-Mobile G1 smartphone http://en.wikipedia.org/wiki/T-Mobile_G1 ). Android sum the features of both Java ME and C++ symbian . it takes form Java ME its easy of programming and learning and from c++ symbian the low level acess to the device hardware capabilities. also with respect to supporting tools there is small number compared with J2ME and symbian.also android provide great support for localization and Internationalization like symbian but J2ME lake these feature as to be programmed by hand in J2ME.android also very suitable for most type of applications (Games,disconnected application,network aware application,socail application and GPS..)



C++ Symbian


symbian provide acess to all device hardware but the its hard to learn and application development somehow take time compared to J2ME and other mobile application technologies but it also provide support for localization and Internationalization which is lake in J2ME and have to be programmed by hand.there many phone models that support symbian but compared with J2ME.the last is the winner as J2ME is supported on both symbian phones and none symbian ones (most smart phones)


Flash Lite


Flash from Adobe is a leading technology for delivering engaging media content on the web. Flash Lite from Adobe is the mobile-optimised version of that technology.its most suitable for producing games and rich GUI application that is fully with graphics.flash lite is supported on many Nokia phone models.and nokia provide great support and tools for development with flash lite


Web Widgets – Web Runtime for S60


Widgets — you're familiar with them from the desktop. Small, focused Web applications that are easy to install and use. Perfect for the small screen. Nokia has now extended the S60 browser engine to behave as a runtime platform in its own right.it use script language for programming



Widget WidSets ---Yahoo Mobile Widget


boths of these two technologies are actually copies of each other have the same features and capabilities. its like Web Widgets – Web Runtime for S60 but it requite client to be installed first on mobile phones.any of them can run on any mobile devices that support J2ME(CLDC1.1 -MIDP2.0)each of them use script language for programming


Widget WidSets -->make script language called WidSets Scripting Language (WSL).
Yahoo Mobile Widget -->make script language called blueprint.


mobile Widget(Yahoo,Widsets) is a powerful framework, built on top of Mobile Java (Java™ ME), making many Java ME features available for developers. Additionally, many Java ME features have been wrapped in a more developer-friendly way, requiring fewer lines of code to do the same thing than in Java.
Because the WidSets client is a Java application, it can be run in any mobile device supporting MIDP 2.0. WidSets is currently verified to support more than 300 different phone models.
With WidSets you can get your favourite Web content directly to your mobile phone. You can share your preferred content with other users or publish it on the Web. Widgets with useful functionality can be developed, deployed, and updated very quickly.



WidSets widgets are small mobile applications written in tailored and optimized for the WidSets service. WSL is a strongly typed, Java-like language, designed to be light-weight but powerful.
The service and developer tools are free: no need for certificates, no fee for development tools, and no payment needed for accessing developer programs.


Yahoo Mobile Widget Build world-class mobile services in record time with the Yahoo! Blueprint platform—offering easy-to-use development tools, a powerful feature set, and beautiful UI controls—all within an open environment that runs across thousands of devices.


JavaFX


The processing and networking capabilities in today's mobile handsets have the potential to deliver a new class of rich, Internet-enabled content. To allow content creators to tap into this power, Sun Microsystems is bringing JavaFX technology to mobile devices. Moreover, JavaFX Mobile builds on top of the market-leading Java ME platform to take advantage of its powerful, device-level capabilities.JavaFX for mobile is still under development



application develivery


what i mean by the application delivery how the customer get and install the application developed by each technology.


its have two main categories



  1. application that installed and run as standalone (J2ME,C++ Symbian,Android,
    flash lite ,Web Widgets – Web Runtime for S60 ,JavaFX)

  2. application that need client to be installed first and the application is get installed over the client(Widget WidSets,Yahoo Mobile Widget )

refrences


http://en.wikipedia.org/wiki/Google_Android


http://code.google.com/android/index.html


http://www.symbian.com/


http://www.forum.nokia.com/main/resources/technologies/flash/


http://www.forum.nokia.com/main/resources/technologies/browsing/widgets.html


http://www.widsets.com/library.html


http://www.forum.nokia.com/main/resources/technologies/browsing/widsets.html


http://mobile.yahoo.com/developers


http://www.sun.com/software/javafx/mobile/index.jsp


Friday, October 10, 2008

Second Phone Interview At Google

when i hear that google planning to open branch in the middle east at jordon and there is open job vacancies for arabic fluent software engineers i am applied from the job and after two or three weeks my cell phone ring i am replied and found google calling me to organize two phone interview with me
i dont remember the questions of the first interview so i decided to write the second interview after finishing it

its my second interview at google
the interview was at 8:00 PM Cairo time
i am near to the phone waiting for the call
the phone ring at 8:05 PM and one of software engineers at google start talking to me
the interview was about 45 minutes
he ask me the following questions



  1. my work experience as per my cv

  2. what is my prefered programming language

  3. what the diffrence between the following three java keywords (final,finally and finalize)

  4. implement algorithm that find all pairs of integers in an interger array that the sum of each pair equal to specific value.

my answers



  1. regards my work experience i am now working at TE-Data.one of the largest internet service provider (ISP) in egypt. i fill the position of Java Software Developer.we are mantain and develop customized software to support the company business regards ADSL services. google interviewer also asked me about the period i spend there at TE-Data and i say i am their from 4 months i joined TE-Data at June 2008 before TE-Data i was doing military service through this period i work as part time J2ME Developer at Telecom-Arabia

  2. my prefered programming language is Java as per my study and work experience

  3. the three java keywords
    -->final
    is java keword and have three diffrent meaning in three context. first if i declare avariable as final then its constant its value will not change through the life time of the program.second if method its declared final the the subclasses cannot override it.third if the class declared as final it canot be extended
    --->finally
    is java keyword that is used with try catch statement its used to closed any open connection or any code that must run if error happen or not.
    -->finalize
    is java method that is called when the object is reclaimed from the memory its like c++ destructor we put code that free system resources in it but its not preferable to account on this method as we are not sure when this method will be called.

  4. algorthim that find the pairs of integers that their sum will equal specific value. i say that the straightforward solution is through two for loops that take each array elment and sum it to every element in the array and i provided this code to support my words

int a[];//this array hold list of integers


int x;//this variable hold the sum



for(int i=0;i<a.lenght;i++)
{
int sum=a[i];
for(int j=0;j<a.lenght;j++)
{
if(i==j)
continue;
if((sum+a[j])==x)
print(i,j);
}
}

then google interviewer this code will repeat the printing of the pairs


and asked how many times it will repeat two,three,...


i sayed it will print every pairs two times


as each two pairs will be compared two times


then i say to modify the inner loop instead of intializing j=0 to i+1


and the algorthim will look like that


int a[];//this array hold list of integers
int x;//this variable hold the sum

for(int i=0;i<a.lenght;i++)

int sum=a[i];
for(int j=i+1;j<a.lenght;j++)

{

if(sum+a[j]==x)

print(i,j);

}


}

google interviewer says ok


and ask about the time complexity of the algorithm i sayed its n square (n2)


he asked about to get it faster (enhancing its performance)


i say can we assume the array is sorted he say assume its sorted then i say we will take every element in the array and subtract this element from the required value then do binary search on this value and i provide the following code to support my words


int a[];//this array hold list of integers


int x;//this variable hold the sum


for(int i=0;i<a.lenght;i++)
{


int secondPair=x-a[i];


int j=binarySearch(secondPair,i+1);


if(index!=-1)


print(i,j);


}


he says ok and good then asked about the time complexity i says its (nlogn)


then he asked again what about if the array is not sorted


the i say we will sort it first using quicksort or mergesort its


then we will do the above algorithm again


then he asked about the time complexity i says


sort will take (nlogn)


pair search will another (nlogn)


then its (2nlogn) and we can ignore the constant factor then the algorithm complexity still (nlogn)


he says good


and asked me if i have any questions


and i says thanks and i am happy from the call


Thursday, April 17, 2008

J2ME Interview Questions

What is J2ME

Java 2, Micro Edition is a group of specifications and technologies that pertain to Java on small devices. The J2ME moniker covers a wide range of devices, from pagers and mobile telephones through set-top boxes and car navigation systems. The J2ME world is divided into configurations and profiles, specifications that describe a Java environment for a specific class of device.

What is J2ME WTK

The J2ME Wireless Toolkit is a set of tools that provides developers with an emulation environment, documentation and examples for developing Java applications for small devices. The J2ME WTK is based on the Connected Limited Device Configuration (CLDC) and Mobile Information Device Profile (MIDP) reference implementations, and can be tightly integrated with Forte for Java

What is API

An Application Programming Interface (API) is a set of classes that you can use in your own application. Sometimes called libraries or modules, APIs enable you to write an application without reinventing common pieces of code. For example, a networking API is something your application can use to make network connections, without your ever having to understand the underlying code.

What is CDC

The Connected Device Configuration (CDC) is a specification for a J2ME configuration. Conceptually, CDC deals with devices with more memory and processing power than CLDC; it is for devices with an always-on network connection and a minimum of 2 MB of memory available for the Java system

What is CLDC

The Connected, Limited Device Configuration (CLDC) is a specification for a J2ME configuration. The CLDC is for devices with less than 512 KB or RAM available for the Java system and an intermittent (limited) network connection. It specifies a stripped-down Java virtual machine1 called the KVM as well as several APIs for fundamental application services. Three packages are minimalist versions of the J2SE java.lang, java.io, and java.util packages. A fourth package, javax.microedition.io, implements the Generic Connection Framework, a generalized API for making network connections.

What is MIDP

The Mobile Information Device Profile (MIDP) is a specification for a J2ME profile. It is layered on top of CLDC and adds APIs for application life cycle, user interface, networking, and persistent storage. What is configuration
In J2ME, a configuration defines the minimum Java runtime environment for a family of devices: the combination of a Java virtual machine (either the standard J2SE virtual machine or a much more limited version called the CLDC VM) and a core set of APIs. CDC and CLDC are configurations. See also profile, optional package.

What is Foundation Profile

The Foundation Profile is a J2ME profile specification that builds on CDC. It adds additional classes and interfaces to the CDC APIs but does not go so far as to specify user interface APIs, persistent storage, or application life cycle. Other J2ME profiles build on the CDC/Foundation combination: for example, the Personal Profile and the RMI Profile both build on the Foundation Profile.

What is Generic Connection Framework

The Generic Connection Framework (GCF) makes it easy for wireless devices to make network connections. It is part of CLDC and CDC and resides in the javax.microedition.io package.

What is GPRS

The General Packet Radio System (GPRS) is the next generation of GSM. It will be the basis of 3G networks in Europe and elsewhere.

What is HTTPS

Hyper Text Transfer Protocol Secure sockets (HTTPS) is a protocol for transmission of encrypted hypertext over Secure Sockets Layer.

What is Java Card

The Java Card specification allows Java technology to run on smart cards and other small devices. The Java Card API is compatible with formal international standards, such as, ISO7816, and industry-specific standards, such as, Europay/Master Card/Visa (EMV

What is JCP

The Java Community Process (JCP) an open organization of international Java developers and licensees who develop and revise Java technology specifications, reference implementations, and technology compatibility kits through a formal process.

What is JSR

Java Specification Request (JSR) is the actual description of proposed and final specifications for the Java platform. JSRs are reviewed by the JCP and the public before a final release of a specification is made

What is kSOAP

kSOAP is a SOAP API suitable for the J2ME, based on kXML.

What is kXML

The kXML project provides a small footprint XML parser that can be used with J2ME.

What is LCDUI

LCDUI is a shorthand way of referring to the MIDP user interface APIs, contained in the javax.microedition.lcdui package. Strictly speaking, LCDUI stands for Liquid Crystal Display User Interface. It's a user interface toolkit for small device screens which are commonly LCD screens.

What is MIDlet

A MIDlet is an application written for MIDP. MIDlet applications are subclasses of the javax.microedition.midlet.MIDlet class that is defined by MIDP.

What is MIDlet suite

MIDlets are packaged and distributed as MIDlet suites. A MIDlet suite can contain one or more MIDlets. The MIDlet suite consists of two files, an application descriptor file with a .jad extension and an archive file with a .jar file. The descriptor lists the archive file name, the names and class names for each MIDlet in the suite, and other information.

What is Obfuscation

Obfuscation is a technique used to complicate code. Obfuscation makes code harder to understand when it is de-compiled, but it typically has no affect on the functionality of the code. Obfuscation programs can be used to protect Java programs by making them harder to reverse-engineer.

What is optional package

An optional package is a set of J2ME APIs providing services in a specific area, such as database access or multimedia. Unlike a profile, it does not define a complete application environment, but rather is used in conjunction with a configuration or a profile. It extends the runtime environment to support device capabilities that are not universal enough to be defined as part of a profile or that need to be shared by different profiles. J2ME RMI and the Mobile Media RMI are examples of optional packages.

What is OTA

Over The Air (OTA) refers to any wireless networking technology.
What is Personal Profile
The Personal Profile is a J2ME profile specification. Layered on the Foundation Profile and CDC, the Personal Profile will be the next generation of PersonalJava technology. The specification is currently in development under the Java Community Process (JCP).

What is PNG

Portable Network Graphics (PNG) is an image format offering lossless compression and storage flexibility. The MIDP specification requires implementations to recognize certain types of PNG images.

What is RMS

The Record Management System (RMS) is a simple record-oriented database that allows a MIDlet to persistently store information and retrieve it later. Different MIDlets can also use the RMS to share data.

What is SDK

A Software Development Kit (SDK) is a set of tools used to develop applications for a particular platform. An SDK typically contains a compiler, linker, and debugger. It may also contain libraries and documentation for APIs.

What is SMS

Short Message Service (SMS) is a point-to-point service similar to paging for sending text messages of up to 160 characters to mobile phones

What is WMA

The Wireless Messaging API (WMA) is a set of classes for sending and receiving Short Message Service messages. See also SMS.

What is the difference between MIDP 1.0 and MIDP 2.0?

Full Canvas will work in MIDP 2.0but not possible in MIDP 1.0
Push Registry is added in MIDP 2.0but not possibly in MIDP 1.0
Game API added in MIDP 2.0not added in the MIDP 1.0

What is the difference between CLDC 1.0 and CLDC 1.1?

CLCD 1.0 does not have support for floating points whileCLDC 1.1 does.

What is 3G?

Third generation (3G) wireless networks will offer faster data transfer rates than current networks. The first generation of wireless (1G) was analog cellular. The second generation (2G) is digital cellular, featuring integrated voice and data communications. So-called 2.5G networks offer incremental speed increases. 3G networks will offer dramatically improved data transfer rates, enabling new wireless applications such as streaming media.
What is WAP Wireless Application Protocol (WAP) is a protocol for transmitting data between servers and clients (usually small wireless devices like mobile phones). WAP is analogous to HTTP in the World Wide Web. Many mobile phones include WAP browser software to allow users access to Internet WAP sites.

Refrences
http://techpreparation.com/computer-interview-questions/j2me-interview-questions-answers6.htm
http://www.allinonetech.co.in/J2ME.php
http://www.geocities.com/j2me_interviewquestion/

Monday, April 14, 2008

Mobile Application Experience

i have worked in mobile application development using J2ME for 2 years and this is sample of my work
  • Mobile VNC Viewer this is really my graduation project and its is a client for VNC (http://www.realvnc.com/) that which allows you to view and interact with one computer anywhere on the Internet taking into attention limitation of mobile device (network bandwidth, mobile processing speed, different resolution of mobile and PC).
    VNC is an open source project developed in Cambridge university –EnglandVNC stands for Virtual Network Computing. It is remote control software which allows you to view and interact with one computer (the "server") using a simple program (the "viewer") on another computer anywhere on the Internet. The two computers don't even have to be the same type, so for example you can use VNC to view an office Linux machine on your Windows PC at home. VNC is freely and publicly available and is in widespread active use by millions throughout industry, academia and privately.

























Mobile VNC Features
  • 1.Remote Desktop
  • 2.soft mouse and keyboard
  • 3.file transfer from remote pc to another remote pc
  • 4.file viewer to minimize network bandwidth and cost
  • 5.save your configuration