Archive for September, 2011

How to connect to a .NET Web Service from a J2ME MIDlet using kSOAP 2

Web services had and continue to have a great impact on the development of Web applications because they allow total independence between clients and service providers. The location, the platform, the programming language and the architecture of both the clients and the services has no effect on each other. The Internet technologies and standards that allowed the implementation of Web services are HyperText Transfer Protocol (HTTP), eXtensible Markup Language (XML), Remote Procedure Call (RPC), Web Services Description Language (WSDL), Simple Object Access Protocol (SOAP) and Universal Description, Discovery, & Integration (UDDI).

In this article we will see how to connect to a .NET Web Service from a j2ME MIDlet using kSOAP2 library. The Java 2 Micro Edition (J2ME) Platform offers support for Web Services through the J2ME Web Services API (WSA), JSR 172, which provides two optional APIs: remote service invocation (JAX-RPC) and XML parsing (JAXP). For the next example, we will use the third party kSOAP 2 library because it is lightweight and efficient. The solution is developed in the NetBeans IDE but you could use also Eclipse IDE.

Read the rest of this entry »

, ,


Android Tutorial (8) – How to add a menu, programmatic vs. declarative solution

How to add an Android menuAndroid mobile applications have the advantage of being deployed on mobile devices that have touch displays. This enhance the user experience and allows developers to design the user interface so it will be dynamic, easy to use and efficient. Despite this advantage, the display size and usability concepts (one golden rule is to have all the window controls visible on the display) limit the number of buttons and visual controls that can be placed on a single window/form. So, application wide options and functions can be made available using a menu, leaving the display for particular and contextual options.

A menu is a group of options (items) that are accessed using the device Menu key. The menu items are represented by single options or by groups of options, which are organized in submenus.

In this article, we will see how to add a menu to the Android application. The solution is implemented using both the programmatic and the declarative solution that uses menu.xml files. For the declarative solution we will use also the Android visual editor for menus.

Read the rest of this entry »



Tutorial Android (4) – Design procedural vs declarativ de interefete si formulare

Aplicatiile mobile Android se bazeaza pentru eficienta si utilitatea pe interfete compuse din ferestre de dialog, controale vizuale variate, grafica 2D si alte elemente multimedia. Platforma Android permite programatorilor sa utilizeze doua metode de proiectare/definire a interfetelor utilizator: procedural prin utilizarea de instructiuni din cod sau declarativ prin definirea de fisiere descriptive XML.

In acest articol vom dezvolta o aplicatie mobila Android simpla  pentru a face o analiza privind proiectarea procedurala vs. cea declarativa a interfetei cu utilizatorul.

Procedural inseamna sa utilizezi cod Java pentru proiectarea interfetei cu utilizatorul. Acest lucru este ceva obisnuit in proiectarea interfetelor Swing pe platforma JSE sau in proiectarea interfetelor utilizator in MIDlet-uri J2ME. Pentru ca fiecare element al interfetei cu utilizatorul este gestionat de instante ale unor diferite clase, proiectarea interfetei inseamna sa construiesti si sa gestionezi aceste instante.

Declarativ inseamna sa folosesti un limbaj de marcare descriptiv, ca XHTML sau XML, pentru a descrie interfata cu utilizatorul. Acest lucru este similar cu modul in care paginile HTML (cele simple) sunt construite. Designerul descrie aspectul paginii si browser-ul Web interpreteaza si genereaza interfata cu utilizatorul.

Read the rest of this entry »


1 Comment

Tutorial Android (3) – Cum sa dezvolti, testezi si sa intelegi o aplicatie de tip Hello World

In acest articol vom vedea modul de utilizare a mediului de lucru Eclipse si a plugin-ului ADT (Android Development Toolkit) pentru a dezvolta o aplicatie mobila Android, clasicul exemplu Hello World! . In ciuda simplitatii sale, aplicatia imprima doar un mesaj pe ecran, ea este foarte importanta pentru a intelege platforma Android deoarece structura ei reprezinta nucleul pentru orice alta aplicatie mobila Android.

Alte concepte descrise in acest articol va vor ajuta sa:

  • creati un proiect pentru o aplicatie mobila Android utilizand Eclipse si plugin-ul ADT (Android Development Toolkit);
  • testati aplicatia folosind diferite emulatoare pentru dispozitive mobile Android ;
  • intelegeti si sa cititi structura proiectului Android.

Read the rest of this entry »



Android Tutorial (7) – How to debug the Android mobile application with LogCat

In computer science and especially in programming, things can go wrong easily. Even simple things, that you have done it before, can generate runtime exceptions that crash the application. Most of the time, the reason is the inability to think to all aspects every time you do something. And because this will not happen, the programmer best friend is the debugger.

In this article we will see how to debug the Android mobile application using the Android LogCat. Despite this Android SDK tool, the application can be debugged in Eclipse like any other Java application (i.e using breakpoints).

Read the rest of this entry »



Android Tutorial (2) – Concepte, activitati si resurse ale unei aplicatii Android

Pentru a intelege arhitectura unei aplicatii mobile Android este nevoie de un minim de cunostinte cu privire la conceptele cheie ale aplicatiilor Android. Intelegerea acestor elemente va permite programatorului sa controleze:

  • componentele aplicatiei;
  • ciclul de viata al aplicatiei;
  • resursele aplicatiei.

In acest articol sunt descrise toate aceste concepte cheie, pentru a evidentia rolul lor, utilitatea si importanta lor. Alte articole vor descrie in detaliu modul in care sunt utilizate pentru a dezvolta o aplicatie mobila Android.

Read the rest of this entry »