Owner: Cell Phones & Portable Devices Programming URL:http://www.portadev.com Join Date: Mon, 17 Sep 2007 04:35:33 -0500 Rating:0 Site Description: Everything you need to know about cell phones and portable devices programming. Site statistics:Click here
NetBeans Hotkeys 2007-09-17 03:07:00 In my previous post, I forgot to write some useful hotkeys for NetBeans
, so I decided to fix this problem now. Here's a list of mos used hotkeys:F4: Run to cursorF5: Starts debuggerF6: Lanches the midlet without debuggingF7: Step inF8: Step overF9: Compiles the codeF11: Builds main project.Shift+F11: Cleans and rebuilds the main projectCtrl+F7: Step outShift+F5: Ends degub sessionCtrl+F5: Continues debug session when pausedCtrl+Shift+F7: New watch
Debugging Mobile Application 2007-09-14 07:25:00 Now I think it's time to say some words on J2ME Emulator. As I said in my previous post, this emulator comes with NetBeans's Mobility Pack plugin. With it we are able to run, test and debug our mobile application from the pc without having to install our software on mobile device.Starting The Application
To start our midlet and see how it performs, simply click "Run" button on the top of the screen.After clicking, NetBeans will save any changes you've made in your project, then it will build the midlet and execute it using the Emulator.As you can see, We see the name of our application on the screen. Click "Launch" button to start our midlet.We see now the "Hello World" text which is contained in the helloForm form :). You can change this text, or add new one from Form Designer, by double clicking helloForm object from the Flaw Designer. Debugging The ApplicationThe "Debug" button is located on the right side of "Run" button. When clicked, the IDE and Emulator starts working in debug Read more:Mobile
Java IDE 2007-09-12 03:57:00 About The IDEAs you can see, NetBeans IDE looks really user friendly.On the left side, we have "Projects" tab which shows a list of projects on which we are working, "Files" which shows project files and "Runtime" tab which we don't need at the moment.To create a new project click File -> New Project. When a screen will appear make sure to select "Mobile" from the "Categories" list and Mobile Application from the "Projects" list.After clicking Next button we are asked for Project Name and Project Location. You may specify a valid folder path in which your projects files will be created. There are also two checkboxes. "Set as Main Project" if we keep this checked our project will load automatically every time we start the IDE, and "Create Hello Midlet" which creates a hello world sample midlet. check both checkboxes and keep the other options with default values and click Finish button.Working With The ProjectCongratulation, you have just created your first midlet project. As you can,
Prerequisites 2007-09-08 04:10:00 IDEFirst thing we need now is to get a fully working software from which we will be able to write and compile our code. Such kind of software is called IDE (Integrated Developement Environement). We have two choice, NetBeans and Eclipse. Both IDE-s are freeware, open source and cross-platform. I recommend NetBeans, because it is considered as the best IDE for Java developement. You may download a copy of NetBeans from http://www.netbeans.org/. When NetBeans installed we will need NetBeans Mobility Pack plugin. This plugin includes J2ME libraries, emulator and compiler for creating midlets. You can download Mobility Pack too from NetBeans official site. Install both package and let's continue.Other ResourcesIf you'll need further help, you may visit Java Technology Forum at http://forum.java.sun.com/. There is a special section for J2ME MIDP programming. I started their too :)You can also check the documentation which comes with NetBeans and Mobility Pack.
Overview 2007-09-04 04:45:00 HelloThis blog is dedicated to cell phones and PDA programming. I will cover both .NET, J2ME and Symbian programming. The main purpose why I created this blog is that there is not good enough information for beginner developers on the net, hope this blog will help you a bit.First of all, it is recommended that you know at least one programming language before starting, (so it will be easyer for you to understand all the materials I'm going to offer) and of course at least one cell phone or PDA :).I think it will be easyer for you to start from J2ME.J2ME means Java Micro Edition. As you would guess, it is a light edition of Java programming language, specially designed for cell phone devices. J2ME is a portable language at binary level. It means that you compile your code and run the executable almost on any device. Other languages such as C++ or Pascal are portable at source level, this means that you have to compile your source code for each platform you are going to run your softwar Read more:Overview
The Last Dictator 2007-09-27 16:16:00 I'm sorry for this off topic but this post is dedicated to the dictatorial government of Georgia.Everyday people are being killed for politicians personal interests.Everyday millions of dollars are stolen by president Saakashvili and his relatives.Everyday people are arrested for someones personal &/or business interest.Everyday people are dying from hunger when Saakashvili and his band are drown in millions.All business is controlled by president Saakashvili and his family.This is a very light description of the situation which is in my country. Yesterday the ex-minister of defense denounced Saakashvili in killing premier minister of Georgia. He also denounced his and his family's personal businesses which are protected personally by Saakashvili and has a carte blanche. Today he was arrested for this denouncement.I even can't remember how many people died with their fault. If you find Georgian embassy in your country, throw them eggs please while we have Saakashvili as the pres Read more:Dictator
OOP In Java Part VI 2007-09-27 05:51:00 Static MembersStatic members are members which are not a part of class instance, but to a class itself. Static members can be variables and methods. For example TestClass c = new TestClass(); here, c is an instance of TestClass class, but TestClass is a class itself. From now, we have learned how to declare members of a class instance, now I'll teach you how to declare a member for a class itself.public class TestClass{public static int getRandom(){Random r = new Random();return r.r.nextInt();}}Random is a class which generates random integer numbers. To use this class import java.util.Random package.To access our getRandom() method you no longer need to create a class instance. Look at the code below:int randomInt = TestClass.getRandom();You can not access class instance's members from static method, instead you can access only static members, but you can access static members from class's instance. For example, you can not call a non-static method from a static method, or access a
OOP In Java Part V 2007-09-26 03:37:00 Java PackagesJava packages is like namespaces in C++ and C#. It is used to organize classes into namespaces. Every class that you use are located in their namespaces. So a class must have it's own namespace. When you create a Mobile Application Project with NetBeans, a default package is automatically created where is located you midlet's main class. In our case, the package is called hello. Look at the picture.Packages are shown under the project name. Right now we have only one package. If we undock the package, we will see classes wich is included in that package. A class can be included only in one package, but a package can include more thatn one class.To specify a class it's package, simply write "package YourPackageName;" at the top of the code. For example.package TestPackage;public class ClassG{public void DoSomething(){//Here we do something.}}You may change the package name for what you want it to be named. Now it's TestPackage but it can be MyGirlsLegs :). Note that dec
OOP In Java Part IV 2007-09-24 12:04:00 Protected ModifierAs I promised, right now I'm going to discuss about the protected modifier. Class member marked with this modifier can not be accessed from outside of the class, just like the private fields, but can be accessed by a child class. A child class is a class which extends the functionallity of other class (Inheriting class). The other class is called a parent class, or super class in java more preciselly.public class Class1{protected void TestClass(){//Do something}}public class Class2 extends Class1{public void Test(){TestClass(); //
OOP In Java Part III 2007-09-21 03:45:00 InheritanceInheritance means to extend a class functionality in another one. For example, imagine we have ClassA and ClassB.public class ClassA{public void Test1(){//do something}public void Test2(){//do something}}As you see, ClassA has 2 public methods. Now we want to create a class called ClassB which will have all the properties and methods of ClassA and some extra members, which we do not want to implement in ClassA. There are two methods for this approach. The first one is to copy and paste ClassA and change it's name to ClassB, which is not a pretty solution. The second one is inheritance. We can implement ClassA in ClassB, It's quite simple. Take a look at the codepublic class ClassB extends ClassA{public void Test3(){//do something}}That's it. :) ClassB has all the members of ClassA plus another method called Test3(). Now you can call and access extended functions and members from ClassB.ClassB b = new ClassB();b.Test2();b.Test3();Please note that in Java language, we don'
This Blog Needs Your Help 2007-09-20 05:48:00 HelloIf you find my content interesting and you like it, please take a time to vote us on blog directories. On the right side, find voting links and vote for us please.Thanks :) Read more:Needs
OOP In Java Part II 2007-09-19 03:15:00 DestructorA destructor is a method which is called before a class instance is being destroyed, so you can make some extra cleanup there. If you have programmed in other languages, I'm sure you are freeing object instances with yourself to avoid memory leaks. Well, in Java and J2ME this is not required anymore, because here everything is freed by Garbage Collector automatically. We will discuss about Garbage Collector later, now let's get back to the destructor. If you want to impliment custom a destructor in your class and make some actions before the class is being destroyed than you have to create a public method called finalize(). here's the syntax:public void finalize(){//Some extra cleanup or other actions goes here.}Class PropertiesNow when we know how to create a class, declare method and set it's modifiers, let's say some words on properties. Properties are simple variables which are part of a class or class instance. As I told you declaring a public member variable is pro
OOP In Java Part I 2007-09-18 04:59:00 Now before we go on serious tasks, I want to describe the Object Oriented Programming(OOP) model. You will need to know OOP like your five fingers if you want to develop in J2ME, because Java is Full OOP language. It means that we can't write procedural code here, everything is Objects, even such data types like byte :).Today I think that OOP model doesn't have alternate. Maybe you ask why we shall really need it? There are some reasons, first of all it helps us writing more elegant and readable code, it reduces the lines and complexity in our code and simply it just splits the whole task in little pieces. Working on large projects without OOP is like taking a walk from earth to the moon. OOP has a little performance penalty, but in modern computers this is not even remarkable. That's the reason why an application written in pure C is faster than C++. As you know, C doesn't have OOP support, but it's much more difficult to write an application in C rather than C++. Java is even ea
Reference And Value Types 2007-11-01 11:55:00 Stack And HeapIn any kind of applications, memory is divided into 2 parts, one is called Stack, and another Heap. Reference is also called pointers in some languages, like C, C++, Object Pascal etc. This is the most difficult part of programming concepts for beginners to understand. I will do my best to describe it the best way I can.Value
TypesValue types are variable types which are allocated and stored into the stack. For example, we all know that int data type allocates 4 bytes from physical memory. This 4 bytes is stored directly in the stack because int is value type. byte, short, int and boolean are value types.Reference TypesThe working principes of reference types are a bit harder to understand. strings and Class objects are reference types. Reference typed objects are allocated into the heap, because strings and classes might require much more memory space then for example int type. Heap is always bigger then stack. So they are allocated into the heap but they also store a nu
Advertisement 2007-10-30 08:38:00 If you are interested in advertising on this blog, contact me at dato0011(at)portadev.com.