How to use Bouncy Castle Cryptographic API in NetBeans or Eclipse for Java JSE projects
The Bouncy Castle Crypto API for Java provides a lightweight cryptography API that works with everything from the J2ME to the JDK 1.6 platform and also a provider for the Java Cryptography Extension JCE (provides an implementation for JCE 1.2.1) and the Java Cryptography Architecture, JCA.
The API provides cryptographic functions for Java JDK 1.1 to 1.6 applications and for J2ME (mobile applications) MIDlets. The API can be downloaded from the Bouncy Castle latest releases page.
In this post we will see how to use Bouncy Castle Cryptographic API either as a JCA provider or as a lightweight API to develop Java J2SE projects in NetBeans 7 (works also on older versions) or Eclipse IDE.
If you want to develop Java applications based on the JSE framework that provide cryptographic services as:
- generating hash values to check the integrity of the message or file;
- encryption/decryption using symmetric key algorithms;
- encryption/decryption using public certificates in a public key infrastructure;
- generating message authentication codes for messages;
you must use a cryptographic API which provides the necessary classes and methods. Read the rest of this entry »
Android Tutorial (3) – How to create, run and read your first application, Hello World
In this article we will see how to use the Eclipse IDE and the ADT (Android Development Toolkit) Plugin for Eclipse to create a very simple Android mobile application, the classic Hello World !. Despite its simplicity, the application just prints a message on the screen, its is very important to understand it, because its structure represents the core for any other Android mobile application.
Other topics highlighted in this article will help you to:
- create an Android mobile application project using Eclipse and ADT (Android Development Toolkit) Plugin;
- run the mobile application using different mobile Android emulators;
- understand and read the structure of the Android project.
Android Tutorial (2) – Applications key concepts, activities and resources
In order to understand the Android application architecture you need some basic knowledge regarding Android applications key concepts. Understanding these elements will allow you to control:
- application components
- application lifecycle
- application resources
In this post are described all these key concepts in order to highlight their role, utility and importance. Other posts will describe in more detail how are used in order to develop an Android mobile application.
The main characteristics of an Android application (more detailed information on developer.android.com) are:
Read the rest of this entry »
Android Tutorial (01) – Setting the development environment
Android is an open source software toolkit created by Google and Open Handset Alliance. Initially developed for mobile phones, it has become a major application platform for a wide range of mobile devices.
The scope of this post is to summarize the steps needed to set the development environment and to start learning and developing Android applications.
Tutorial Java SCJP – # 19 Enumerari de tip enum
Exista situatii in care o variabila trebuie sa aiba valori limitate la o anumita multime, definita in specificatiile solutiei. Sa presupunem ca trebuie dezvoltata o aplicatie Java care gestioneaza Vehicule iar tipul de motor trebuie sa ia o valoare din multimea {BENZINA, DIESEL, HYBRID, ELECTRIC}. Pentru a implementa cerinta se poate defini atributul asociat tipului de motor ca String sau ca int si se valideaza de fiecare data valoarea de intrare. Pentru siruri de caractere se poate compara valoarea de intrare cu "BENZINA", "DIESEL", si asa mai departe. Pentru int se poate face asocierea BENZINA este 1, DIESEL este 2, … si se verifica valorile pe baza acesti abordari. Aceasta este o solutie posibila, dar nu e eficienta pentru ca se pot face cu usurinta greseli si pentru ca se complica o procedura care ar trebui sa fie simpla.
Tutorial Java SCJP – # 18 Blocuri de initializare
Pentru a face prelucrari si pentru a obtine rezultate este nevoie de date. Si aceste valori de intrare sunt de obicei stocate in variabile statice, variabilele locale (definite în metode) sau variabile de instanta (variabile nonstatice definite în clase). Pentru a initializa o variabila o poti face la definitia sau mai târziu într-o metoda (constructor sau nu). In ciuda acestor doua solutii comune, exista o alta cale folosind blocuri de initializare.
Blocurile de initializarea sunt blocuri de cod definite intre { si }. Din acest punct de vedere, ele seamana cu blocuri/corpuri de metode, dar principala diferenta este ca blocurile de initializare nu au un nume. Ele sunt ca metodele, insa fara antet/header (tip returnat, nume metoda, lista de parametri).
Tutorial Java SCJP – #19 Enumerated lists or Enums
There are logically situations in which a variable must have values restricted to a specific range or set that is defined in the solution specifications. Let’s imagine that you must develop a Java applications that manages Vehicles and the engine type must take one value from the {GASOLINE, DIESEL, HYBRID, ELECTRICAL} set. You can define the engine type as a String or as an int and you can validate every time the input value. For strings you can compare the input value with “gasoline”, “diesel” and so on. For integer you can assume that GASOLINE is 1, DIESEL is 2, … and check the values based on this logic. This is a possible approach but it’s not ok because you can make easily mistakes and because you complicate a really simple procedure.
Tutorial Java SCJP – #18 Initialization blocks
In order to process something you need values. And values are usually stored in static variables, local variables (defined in methods) or instance variables (nonstatic variables defined in classes). In order to initialize a variable you can do it at definition or later in a method (constructor or not). Despite these two common solutions, there is another way using initialization blocks.
Initialization blocks are blocks of codes defined between { and }. At this point they are like methods blocks, but the main difference is that initialization blocks don’t have a name. They are like methods but without the method header (return type, name, parameter list).
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.
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.

in romanian
in english