×
Namespaces

Variants
Actions
(Difference between revisions)

Become an Series 40 application developer - Part 1

From Nokia Developer Wiki
Jump to: navigation, search
adarsha_saraff (Talk | contribs)
(Adarsha saraff -)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Add ArticleMetaData)
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Draft]]
+
{{ArticleMetaData <!-- v1.2 -->
{{Abstract|This article explains how to ... }} ''Develop an Native Application for S40 devices''<br />
+
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
This is for absolute Beginners. If you are familiar with JavaME application development and looking forward to get started with S40, this suits best for you.<br />
+
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
Skills Level: Beginner.
+
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
S40 experts, please keep updating this article.
+
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Qt SDK 1.1.4]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20120726
 +
|author= [[User:Adarsha saraff]]
 +
}}
 +
[[Category:Java ME]][[Category:Series 40]][[Category:Code Snippet]][[Category:Getting Started]][[Category:Tutorial]][[Category:Series 40 Developer Platform 2.0]]
 +
{{Abstract|This article explains how to develop a Java ME ("native") application for Series 40 devices.}}  The article is for absolute beginners, and also for developers who are familiar with Java ME, but want to work on Series 40.
 +
 
 
== Introduction ==
 
== Introduction ==
  
Java is the Native application development platform for S40 devices. However, Flash Lite and S40 Web environment are also supported by these devices.<br />
+
Java is the native application development platform for Series 40 devices. Series 40 Web Apps provide an alternative environment, primarily for developing apps to access existing Internet services. Flash Lite apps can be created in Series 40 devices released before May 2012.
  
Developing applications to these devices are Interesting. S40 phones are like budget phones cost less and more efficient considered to any other manufacturer's low-end devices. Most of the users of phones are students, teachers, farmers, senior citizen and taxi drivers and all. The total number of users are not few 100's neither millions. More than 3 billion people are using S40 devices. So, your are going to develop applications for billions of people.<br />
+
Developing applications for these devices is interesting. Series 40 phones are like budget phones cost less and more efficient considered to any other manufacturer's low-end devices. Most of the users of phones are students, teachers, farmers, senior citizen and taxi drivers and all.
  
When it comes to development, Series 40 devices have different screen resolutions, different memory size, different CPU clock rates and different hardware type. There are Classic phones, Touch and Type phones, Qwerty Phones and Full Touch phones. When it comes to screen resolution; it ranges from small screen (128x160 pixels) to medium (240x320 pixels, 320x240 pixels) and to large (240x400 pixels) resolutions.<br />
+
When it comes to development, Series 40 devices have different screen resolutions, different memory size, different CPU clock rates and different hardware type. There are Classic phones, Touch and Type phones, Qwerty Phones and Full Touch phones. When it comes to screen resolution; it ranges from small screen (128x160 pixels) to medium (240x320 pixels, 320x240 pixels) and to large (240x400 pixels) resolutions.
  
We need to consider memory at most. For some of device max. jar size allowed is 2MB and max. heap memory available is 4MB. S40 devices are feature phones and there are some smart phones also,(ex: Asha 303 and Asha 311) which have got processing power of 1GHz.<br />
+
We need to consider memory at most. For some of device max. jar size allowed is 2MB and maximum heap memory available is 4MB. High-end Series 40 devices can have the features of smart phones - for example Asha 303 and Asha 311 have got a 1GHz CPU.
  
[[File:Devicetype.png]]<br />
+
[[File:Devicetype.png|frame|none|Series 40 Devices]]
Picture: Series40 Devices.
+
  
 
== Beginning With Development ==
 
== Beginning With Development ==
  
Through out the development process, we will use two IDE's and three SDK's. We will use NetBeans IDE with Sun Java Micro-edition SDK to develop application for classic phones, NetBeans IDE with Nokia Java SDK 1.1 for Touch and Type devices and Nokia IDE for full touch devices.<br />
+
Throughout the development process, we will use two IDE's and three SDK's. We will use NetBeans IDE with Sun Java Micro-edition SDK to develop application for classic phones, NetBeans IDE with Nokia Java SDK 1.1 for Touch and Type devices and Nokia IDE for full touch devices.
At the end of this tutorial, you should be able to develop application for S40 devices. You will be taken from ''Absolute Beginner'' to ''Expert''. This include one full application development (Which will ready to publish on Nokia Store), apart from the application/project created in part 1. <br />
+
 
You will be creating four packages for four different resolution and hardware to target all the above devices.<br />
+
In this "Become an Series 40 application developer - Part 1", I will cover the things about - Getting Started, Creating and running a project in both NetBeans and Nokia IDE.
 
+
In this "Become an S40 application developer - Part 1", I will cover the things about - Getting Started, Creating and running a project in both NetBeans and Nokia IDE.
+
  
 
== Getting Started with NetBeans IDE ==
 
== Getting Started with NetBeans IDE ==
  
[http://netbeans.org/downloads/ Download] the latest NetBeans IDE with JavaME technology included and follow the procedure to install and configure the IDE.<br />
+
[http://netbeans.org/downloads/ Download] the latest NetBeans IDE with JavaME technology included and follow the procedure to install and configure the IDE.
  
[[File:NetbeanIDEStartPage.png]]
+
[[File:NetbeanIDEStartPage.png|thumb|670px|NetBeans IDE after launch]]
This is how NetBeans IDE looks like when it is launched.<br />
+
  
==== Creating and Running a first project ====
 
  
*Create a New Project by press "Ctrl+Shift+N" keyboard shortcut or File>New Project. Now in ''New Project'' window select "JavaME" and "Mobile Application" and hit "Next" button.<br />
+
==== Creating and running a first project ====
  
*Now in ''New Mobile Application'' window, enter the Project Name as ''s40_firstapp'' and make sure that "Set as Main Project" and "Create Hello MIDlet" is checked and click "Next" button.<br />
+
*Create a New Project by pressing '"Ctrl+Shift+N'" keyboard shortcut or '''File>New Project''''. Now in the ''New Project'' window select "JavaME" and "Mobile Application" and hit '"Next"' button.
[[File:Netbean_first_project_step1.png]]<br />
+
*Now in ''New Mobile Application'' window, enter the Project Name as ''s40_firstapp'' and make sure that "Set as Main Project" and "Create Hello MIDlet" is checked and click "'Next'" button.
 +
*: [[File:Netbean first project step1.png|thumb|670px]]
 +
*Now Make sure that ''Emulator Platform" is set to "CLDC Oracle Java(TM) Platform Micro Edition SDK" and ''Device'' to "DefaultCldcPhone1" and ''Device Configuration'' to "CLDC-1.1" and ''Device Profile'' to "MIDP-2.0" and click '''Finish''' button.
 +
*: [[File:Netbean first project step2.png|thumb|670px]]
  
*Now Make sure that ''Emulator Platform" is set to "CLDC Oracle Java(TM) Platform Micro Edition SDK" and ''Device'' to "DefaultCldcPhone1" and ''Device Configuration'' to "CLDC-1.1" and ''Device Profile'' to "MIDP-2.0" and click "Finish" button.<br />
+
The picture below shows the components of NetBeans IDE, with which you are going to work:
[[File:Netbean_first_project_step2.png]]<br />
+
:[[File:Netbean first project step3.png|thumb|670px]]
 
+
The bellow picture shows the components of NetBeans IDE, with which you are going to work.<br />
+
[[File:Netbean_first_project_step3.png]]<br />
+
 
1- Source - Here your are going to code all program statement.<br />
 
1- Source - Here your are going to code all program statement.<br />
 
2- Screen - Visual editor to work with form components.<br />
 
2- Screen - Visual editor to work with form components.<br />
Line 55: Line 70:
 
10 - Work-space - Work-space to work with.<br />
 
10 - Work-space - Work-space to work with.<br />
  
*Now your first project is ready to run. Run project by clicking Run button.<br />
+
*Now your first project is ready to run. Run project by clicking '''Run''' button.<br />
[[File:Netbean_first_project_step4.png]]
+
[[File:Netbean first project step4.png|thumb|670px|Running a project]]
Picture: Running a project.<br />
+
 
 
Wow, you just created your project by coding nothing.
 
Wow, you just created your project by coding nothing.
You might be amazing how is this possible to get output without writing any code. That's because NeatBean had generated code on behalf of you. Now explore the code, by clicking on "Source" button.<br />
+
 
 +
You might be amazing how is this possible to get output without writing any code. That's because NeatBean had generated code on your behalf. Now explore the code, by clicking on '''Source''' button.
  
 
== Getting Started with Nokia IDE ==
 
== Getting Started with Nokia IDE ==
  
[https://www.developer.nokia.com/Develop/Java/ Download] the Nokia SDK 2.0 for Java Developers. Follow the instructions to install and configure the SDK.<br />
+
[http://www.developer.nokia.com/Develop/Java/ Download] the Nokia SDK 2.0 for Java Developers. Follow the instructions to install and configure the SDK.
 
+
[[File:NokiaIDEStartPage.png]]
+
Picture: Nokia IDE Welcome/Start page.
+
==== Creating and Running a first project ====
+
 
+
*Create a New Project by pressing "Alt+Shift+N" keyboard shortcut or "File>New>MIDlet Project"<br />
+
 
+
*Now in "New MIDlet Project" window, enter the ''Project Name'' as "frists40app" and click "Next" button.<br />
+
[[File:Nokiaide_first_project_step1.png]]<br />
+
  
*Enter ''MIDlet Name'' as "firsts40app" and "Your Name" in ''MIDlet Vendor'' and select ''Microedition Configuration" as "Connected Limited Device Configuration(1.1)" and ''Microedition Profile'' as "Mobile Information Device Profile(2.1)" and click "Finish" button to create.<br />
+
[[File:NokiaIDEStartPage.png|thumb|670px|Nokia IDE Welcome/Start page]]
[[File:Nokiaide_first_project_step2.png]]<br />
+
  
*Create a MIDlet, by right clicking on "src" folder, select "new" from the pop-up menu and select "JavaME MIDlet"<br />
 
[[File:Nokiaide_first_project_step3.png]]<br />
 
  
*Enter the ''Name'' as "Hello" in ''New Java MIDlet'' window and click "Finish" button.<br />
+
==== Creating and running a first project ====
[[File:Nokiaide_first_project_step4.png]]<br />
+
  
 +
*Create a New Project by pressing "Alt+Shift+N" keyboard shortcut or '''File>New>MIDlet Project'''
 +
*Now in "New MIDlet Project" window, enter the ''Project Name'' as "frists40app" and click "Next" button.
 +
*: [[File:Nokiaide first project step1.png|frame|none]]
 +
*Enter ''MIDlet Name'' as "firsts40app" and "Your Name" in ''MIDlet Vendor'' and select ''Microedition Configuration" as "Connected Limited Device Configuration(1.1)" and ''Microedition Profile'' as "Mobile Information Device Profile(2.1)" and click "Finish" button to create.
 +
*: [[File:Nokiaide first project step2.png|frame|none]]
 +
*Create a MIDlet, by right clicking on "src" folder, select "new" from the pop-up menu and select "JavaME MIDlet".
 +
*: [[File:Nokiaide first project step3.png|frame|none]]
 +
*Enter the ''Name'' as "Hello" in ''New Java MIDlet'' window and click "Finish" button.
 +
*: [[File:Nokiaide first project step4.png|thumb|670px]]
 
*Type the following statements inside the class.
 
*Type the following statements inside the class.
<code java>
+
*: <code java>
 
import javax.microedition.lcdui.Display;
 
import javax.microedition.lcdui.Display;
 
import javax.microedition.lcdui.Form;
 
import javax.microedition.lcdui.Form;
Line 117: Line 129:
 
}
 
}
 
</code>
 
</code>
 +
*Now, Its time for testing our first project. Right click on project folder. Select "Run As" from the pop-up menu and "Emulated JavaME MIDlet".
 +
*: [[File:Nokiaide first project step5.png|thumb|670px]]<br />
 +
* Repeat the previous step, if you didn't get application running on Emulator.
 +
*: [[File:Nokiaide first project step6.png|thumb|670px]]
  
*Now, Its time for testing our first project. Right click on project folder. Select "Run As" from the pop-up menu and "Emulated JavaME MIDlet".<br />
+
Congratulations, you just created your first application in Nokia IDE for Series 40 full touch device. Try to run the application by changing the string in {{Icode|new Form("Welcome")}} and {{Icode|main.append("Helo World!")}}.
[[File:Nokiaide_first_project_step5.png]]<br />
+
 
+
*Repeat the previous step, if you didn't get application running on Emulator.
+
[[File:Nokiaide_first_project_step6.png]]<br />
+
 
+
Congratulations, you just created your first application in Nokia IDE for S40 full touch device. Try to run the application by changing the string in ''new Form("Welcome")'' and ''main.append("Helo World!")''.
+
  
 
== Summary ==
 
== Summary ==
  
*"Java" is the ''Native Platform'' to develop application for Series 40.<br />
+
*"Java" is the native platform for developing application for Series 40.
*There are more than 3 billions of S40 users.<br />
+
*You can develop applications for taxi drivers, teachers, farmers and for every one.
*You can develop applications for taxi drivers, teachers, farmers and for every one.<br />
+
*There are different screen resolution, memory size, hardware support and CPU clock rate to be considered while developing Series 40 applications.
*There are different screen resolution, memory size, hardware support and CPU clock rate to be considered while developing Series 40 applications.<br />
+
*Netbeans IDE and Nokia IDE are used to develop applications for Series 40 device.
*Netbeans IDE and Nokia IDE are used to develop applications for S40 device.<br />
+
  
 
== Where to go Next ==
 
== Where to go Next ==
  
[https://www.developer.nokia.com/Devices/Device_specifications/?filter1=s40&filter2=javame Explore] S40 devices.<br />
+
[http://www.developer.nokia.com/Devices/Device_specifications/?filter1=s40&filter2=javame Explore] Series 40 device specifications.
Try testing your first application on different S40 device using [https://www.developer.nokia.com/Devices/Remote_device_access/ RDA]. Check out the "How it looks on different S40 device with different screen resolution?"<br />
+
 
Become an S40 application developer - Part 2 (Coming Soon).
+
Try testing your first application on different Series 40 devices using [https://www.developer.nokia.com/Devices/Remote_device_access/ RDA]. Check out the "How it looks on different Series 40 device with different screen resolution?"
 +
 
 +
[[Become an S40 application developer - Part 2|Become an Series 40 application developer - Part 2]].

Revision as of 10:52, 30 July 2012

Article Metadata
CompatibilityArticle
Created: adarsha_saraff (26 Jul 2012)
Last edited: hamishwillee (30 Jul 2012)

This article explains how to develop a Java ME ("native") application for Series 40 devices. The article is for absolute beginners, and also for developers who are familiar with Java ME, but want to work on Series 40.

Contents

Introduction

Java is the native application development platform for Series 40 devices. Series 40 Web Apps provide an alternative environment, primarily for developing apps to access existing Internet services. Flash Lite apps can be created in Series 40 devices released before May 2012.

Developing applications for these devices is interesting. Series 40 phones are like budget phones cost less and more efficient considered to any other manufacturer's low-end devices. Most of the users of phones are students, teachers, farmers, senior citizen and taxi drivers and all.

When it comes to development, Series 40 devices have different screen resolutions, different memory size, different CPU clock rates and different hardware type. There are Classic phones, Touch and Type phones, Qwerty Phones and Full Touch phones. When it comes to screen resolution; it ranges from small screen (128x160 pixels) to medium (240x320 pixels, 320x240 pixels) and to large (240x400 pixels) resolutions.

We need to consider memory at most. For some of device max. jar size allowed is 2MB and maximum heap memory available is 4MB. High-end Series 40 devices can have the features of smart phones - for example Asha 303 and Asha 311 have got a 1GHz CPU.

Series 40 Devices

Beginning With Development

Throughout the development process, we will use two IDE's and three SDK's. We will use NetBeans IDE with Sun Java Micro-edition SDK to develop application for classic phones, NetBeans IDE with Nokia Java SDK 1.1 for Touch and Type devices and Nokia IDE for full touch devices.

In this "Become an Series 40 application developer - Part 1", I will cover the things about - Getting Started, Creating and running a project in both NetBeans and Nokia IDE.

Getting Started with NetBeans IDE

Download the latest NetBeans IDE with JavaME technology included and follow the procedure to install and configure the IDE.

NetBeans IDE after launch


Creating and running a first project

  • Create a New Project by pressing '"Ctrl+Shift+N'" keyboard shortcut or File>New Project'. Now in the New Project window select "JavaME" and "Mobile Application" and hit '"Next"' button.
  • Now in New Mobile Application window, enter the Project Name as s40_firstapp and make sure that "Set as Main Project" and "Create Hello MIDlet" is checked and click "'Next'" button.
    Netbean first project step1.png
  • Now Make sure that Emulator Platform" is set to "CLDC Oracle Java(TM) Platform Micro Edition SDK" and Device to "DefaultCldcPhone1" and Device Configuration to "CLDC-1.1" and Device Profile to "MIDP-2.0" and click Finish button.
    Netbean first project step2.png

The picture below shows the components of NetBeans IDE, with which you are going to work:

Netbean first project step3.png

1- Source - Here your are going to code all program statement.
2- Screen - Visual editor to work with form components.
3- Flow - Shows flow diagram of command and actions.
4- Displays - Drag and Drop option to create all display components like Form, Alert, List etc.
5- Commands - Drag and Drop option to create commands.
6- Elements - Drag and Drop option for components to add to list, choice group and all.
7- Properties - Shows properties of the selected component. We use this to change name, type and all.
8- Clean and Build - Clears all previously build jar files and builds again.
9- Run - Runs the jar file on emulator.
10 - Work-space - Work-space to work with.

  • Now your first project is ready to run. Run project by clicking Run button.
Running a project

Wow, you just created your project by coding nothing.

You might be amazing how is this possible to get output without writing any code. That's because NeatBean had generated code on your behalf. Now explore the code, by clicking on Source button.

Getting Started with Nokia IDE

Download the Nokia SDK 2.0 for Java Developers. Follow the instructions to install and configure the SDK.

Nokia IDE Welcome/Start page


Creating and running a first project

  • Create a New Project by pressing "Alt+Shift+N" keyboard shortcut or File>New>MIDlet Project
  • Now in "New MIDlet Project" window, enter the Project Name as "frists40app" and click "Next" button.
    Nokiaide first project step1.png
  • Enter MIDlet Name as "firsts40app" and "Your Name" in MIDlet Vendor and select Microedition Configuration" as "Connected Limited Device Configuration(1.1)" and Microedition Profile as "Mobile Information Device Profile(2.1)" and click "Finish" button to create.
    Nokiaide first project step2.png
  • Create a MIDlet, by right clicking on "src" folder, select "new" from the pop-up menu and select "JavaME MIDlet".
    Nokiaide first project step3.png
  • Enter the Name as "Hello" in New Java MIDlet window and click "Finish" button.
    Nokiaide first project step4.png
  • Type the following statements inside the class.
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Form;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;
     
     
    public class Hello extends MIDlet {
    Form main;
     
    public Hello() {
     
    }
     
    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
     
     
    }
     
    protected void pauseApp() {
     
     
    }
     
    protected void startApp() throws MIDletStateChangeException {
    main = new Form("Welcome");
    main.append("Hello World!");
    Display.getDisplay(this).setCurrent(main);
     
    }
     
    }
  • Now, Its time for testing our first project. Right click on project folder. Select "Run As" from the pop-up menu and "Emulated JavaME MIDlet".
    Nokiaide first project step5.png

  • Repeat the previous step, if you didn't get application running on Emulator.
    Nokiaide first project step6.png

Congratulations, you just created your first application in Nokia IDE for Series 40 full touch device. Try to run the application by changing the string in new Form("Welcome") and main.append("Helo World!").

Summary

  • "Java" is the native platform for developing application for Series 40.
  • You can develop applications for taxi drivers, teachers, farmers and for every one.
  • There are different screen resolution, memory size, hardware support and CPU clock rate to be considered while developing Series 40 applications.
  • Netbeans IDE and Nokia IDE are used to develop applications for Series 40 device.

Where to go Next

Explore Series 40 device specifications.

Try testing your first application on different Series 40 devices using RDA. Check out the "How it looks on different Series 40 device with different screen resolution?"

Become an Series 40 application developer - Part 2.

469 page views in the last 30 days.