Posts Tagged J2ME

Cum conectam o aplicatie MIDlet J2ME la un serviciu Web .NET folosind kSOAP 2

Serviciile web au avut si continua sa aiba un impact mare asupra dezvoltarii aplicatiilor Web deoarece acestea permit independenta totala între clientii si furnizorii de servicii. Locatia, platforma, limbajul de programare si arhitectura clientilor si a celor care ofera serviciile Web nu are niciun efect asupra lor. Tehnologiile Internet si standardele care au permis definirea si utilizarea serviciilor Web sunt Hypertext Transfer Protocol (HTTP), eXtensible Markup Language (XML), Remote Procedure Call (RPC), Web Services Description Language (WSDL), Simple Object Access Protocol (SOAP) si Universal Description, Discovery, & Integration (UDDI).

In acest articol vom vedea cum conectam o aplicatie MIDlet J2ME la un serviciu Web .NET folosind libraria kSOAP 2. Platforma Java 2 Micro Edition (J2ME) ofera suport pentru Web Services prin J2ME Web Services API (WSA), JSR 172, care ofera doua API-uri optionale: invocare de la distanta de servicii (JAX-RPC) si parsare XML (JAXP). Pentru urmatorul exemplu, vom folosi libraria independenta kSOAP 2, pentru ca are un impact minimal asupra performantei aplicatiei si este eficienta. Solutia este dezvoltata în NetBeans IDE, dar se poate folosi, de asemenea, Eclipse IDE.

Read the rest of this entry »

, ,

No Comments

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 »

, ,

8 Comments

J2ME tutorial – Cum se construiesc si se afiseaza formulare si alerte intr-un MIDlet

Aplicatiile mobile J2ME sunt solutii simple, care permit utilizatorilor sa-si gestioneze datele folosind formulare/ferestre (Displayable in J2ME) ce contin diferite tipuri de controale. In API-ul J2ME, echivalentul ferestrelor din aplicatiile de tip desktop este reprezentat de un set relativ redus de formulare care reprezinta subclase ale clasei Displayable. Intregul framework este un set redus de clase, care sunt usor de utilizat si cu un impact mai mic asupra memoriei si resurselor procesorului decât omologul pentru desktop, Java AWT (Abstract Window Toolkit) sau Swing.

Read the rest of this entry »

No Comments

J2ME tutorial – How to create and display forms and alerts

J2ME mobile applications are simple solutions that allow users to manage their data using different controls that are placed in forms, windows or Displayable. In the J2ME API, the equivalent of desktop applications windows is represented by a relative reduced set of forms which are subclasses of Displayable class. The entire framework is a limited, smaller set of classes which are easy to use and less demanding of memory and processor resources than the desktop counterpart as Java AWT (Abstract Window Toolkit) or Swing.

Read the rest of this entry »

2 Comments

How to encrypt with 3DES – DESede from Bouncy Castle API in J2ME applications

In this post we will see how to use the 3DES (Triple Data Encryption Standard in EDE mode) or DESede algorithm implementation from the Bouncy Castle API for J2ME platform. The example will use the 3DES lightweight engine to encrypt and decrypt a file managed by a J2ME (MIDlet) application.

The Bouncy Castle Crypto API for Java provides a lightweight cryptographic API that works with everything from the J2ME to the JDK 1.6 platform. The API is different for J2ME platform than the one for JDK platform. For example, the lightweight API has different implementations for the two platforms:

Read the rest of this entry »

, , , , ,

3 Comments

How to encrypt / decrypt with DES from JSR 177 SATSA API in J2ME applications

In this post we will see how to use the DES (Data Encryption Standard) algorithm implementation, in CBC and ECB modes, from the Security and Trust Services API (SATSA) for J2ME platform. The complete example will use the DES engine (in CBC or ECB mode) to encrypt and decrypt a file managed by a J2ME (Midlet) application.

The Security and Trust Services API (SATSA) specification defines optional packages for the Java 2 Platform, Micro Edition (J2ME) and is a lightweight cryptographic version of the standard version in JSE. The API is different for J2ME platform than the one for JDK platform because it provides fewer classes. Regarding the API, both the J2ME and JSE platforms use Cipher as the main class for cryptographic algorithms.

Read the rest of this entry »

, ,

2 Comments

J2ME MIDlet care foloseste servicii de localizare GPS şi Google Static Map API

Astazi, cele mai multe dispozitive mobile contin un modul GPS sau se pot conecta la unul utilizand servicii Bluetooth. Platforma Java de pe aceste dispozitive ofera suport pentru API-ul de localizare pentru J2ME definit de JSR-179, care permite dezvoltarea de aplicatii J2ME, MIDlet-uri, care pot obtine de la modulul GPS coordonatele geografice (latitudine si longitudine). De asemenea, aplicatii mobile pot integra servicii bazate pe localizare. Unul dintre serviciile cele mai folosite este furnizarea de harti cu ajutorul Google Maps sau Google Static Maps. A doua posibilitate este accesibila prin intermediul Google Maps API static V2 , care este un serviciu gratuit si deschis (nu mai necesita o cheie API Maps) este o solutie mai eficienta, deoarece minimizeaza transferuri de date in retea.

In acest articol este descrisa o aplicatie MIDlet complet functionala, care preia coordonatele GPS de la modulul dispozitivului mobil si le utilizeaza pentru a afisa o harta statica Google pentru acea locatie. Aplicatia poate fi testata pe emulator sau pe un dispozitiv real, care are un modul GPS incorporat.

Read the rest of this entry »

, , ,

No Comments

Cum sa parsezi un RSS feed XML cu kXML intr-un MIDlet J2ME

Din cei in ce mai multe dispozitive mobile sunt folosite pentru a accesa serviciile Internet pri conexiuni de date. O modalitate eficienta de a transfera date intre platforme si tehnologii diferite este de a utiliza fisiere XML, care sunt simple fisiere text formatate conform regulilor XML.

Pentru a procesa un fisier XML si pentru a extrage datele necesare este nevoie de un parser XML, care implementeaza un motor pentru procesare de texte.

Read the rest of this entry »

, , ,

No Comments

How to use GPS location services and Google Static Map API in J2ME MIDlets

Today, most mobile devices come with a GPS module or can connect to one using Bluetooth services. These devices come with support for the Location API for J2ME under JSR-179 that allow J2ME MIDlets applications to query the GPS module for geo-location coordinates. Also mobile applications integrate location based services and one increasingly used it to provide maps images using Google Maps or Google Static Maps. The later is accessible through Google Static Maps API V2, which is an open and free service (no longer requires a Maps API key) and more efficient as it minimizes network transfers.

In this article it is described and developed a fully MIDlet application that gets coordinates from the mobile device GPS module and use them to display a Google static map for that location. The application can be tested on the emulator or on a real device that has a GPS module incorporated.
Read the rest of this entry »

, , ,

8 Comments

How to use kXML to parse XML files in J2ME projects

kXML is a small XML pull parser, specially designed for constrained environments such as Applets, Personal Java or MIDP devices.

The problem for J2ME MIDlets is that there are mobile devices that don’t support the XML API for Java ME additional package (JSR 280). In order to solve this problem, we need an independent and lightweight XML parser that must be fast and with a small impact on the memory. Two possible solutions are kXML and NanoXML.

Read the rest of this entry »

,

4 Comments