Generating getter and setter methods in NetBeans

Creating getter and setter methods for attributes of a Java class is usually not a dificult task, but it takes some time. Several development environments have the ability to generate these simple methods. NetBeans IDE also has this feature.

Take a look at the following code:

[[{"type":"media","view_mode":"media_original","fid":"59","attributes":{"alt":"","class":"media-image","height":"360","width":"955"}}]]

Creating JSONP data source with Drupal

When creating applications for mobile phonesit is often required that data be read from a remote data source (from a server). When using web-based technologies JSON (JavaScript Object Notation) data format is often applied for data exchange between the client and the server. If your website wants to get some data from the server without reloading the entire page an ajax request using some JavaScript code will do the trick. If the data source is accessible on the same domain name as the website the JSON data format is adequate.

Multi-platform mobile applications with PhoneGap

If you want to create some mobile applications but you only know web technologies like HTML and JavaScript, PhoneGap could be a wise choice.

With PhoneGap you can do the job with HTML, CSS and JavaScript (JavaScript frameworks like jQuery and jQuery mobile are also available) and you can deploy the application to many platforms like Android, iOS, Windows mobile, Blackberry, etc.

PhoneGap or Cordova?

Sending e-mail with multiple lines in bash script

Recently I've had to write a bash script which sends an e-mail alert message when it's needed. The text of the e-mail should be written in multiple lines.

My first thought was to use \n character to separate lines, but unfortunately that doesn't work.

After a little research I finally found a pretty good solution for the problem - we can use functions in bash scripts as well:

#!/bin/bash

function high_alert_mail {
  echo "Temperature is TOO HEIGHT:"
  echo " - alert limit: $ALERT_MAX"
  echo " - measured temperature: $TEMP1"

Android - Global variables

If your Android application contains two or more activities you may need to store global variables that can be accessed from any activity.    

Create a new class inherited from Application class and create your global variables in it.

[[{"type":"media","view_mode":"media_original","fid":"25","attributes":{"alt":"","class":"media-image","height":"137","width":"382"}}]]

Now we have to specify the name of the class in AndroidManifest.xml file: