How to create an Android App using Google’s App Inventor

Today we’re going to take a look at Google’s App Inventor feature that offers programming-novices a nice possibility to enter the fabulous world of Android App programming without deeper knowledge of the API or complex SDK installations. So lets build some stuff .. Prerequisites Java 6 JDK App Inventors Extras Software A Google App Inventor Beta Account – request one here What we are going to build We are building a simple GUI with a Textbox and a button A click on the button starts an event that queries the acceleration sensor for coordinates If the sensor is active and enabled then the coordinates are displayed in the text box ...

August 4, 2010 · 4 min · 749 words · Micha Kops

How to create a simple OSGi Web Application using Maven

In this tutorial we will take a look at the development of a simple OSGi Web Application and what tools can save us some time. The Maven Bundle Plugin makes our life much easier here as does the OSGi Bundle Repository that offers some nice bundles – in our case the servlet API and an embedded Jetty web server. So lets develop some bundles .. Prerequisites You are going to need a JDK (>=5), Maven2, the Apache Felix OSGi implementation and and text editor/http://eclipse.org/[IDE] of your choice. ...

July 25, 2010 · 8 min · 1505 words · Micha Kops

How to create a Template Bundle Plugin in Confluence

Since Confluence 3.2. there is a new plugin module type that allows you to deploy templates in a bundle via the plugin API. In addition it is possible to assign these templates to specific spaces and preview available templates in the Confluence administration area. So let’s build some sample templates.. Creating a Template Bundle Plugin Creating a template bundle is easy – just create a class implementing TemplatePackage – there are two methods: one returns a list of bundled PageTemplate Objects the other the name for the template bundle. ...

July 12, 2010 · 4 min · 675 words · Micha Kops

A look at Google’s Protocol Buffers

Protocol Buffers are a serialization format developed by Google- you might ask if another IDL is really needed here – is Google barking at the wrong tree? But protocol buffers offer some advantages over data serialization via XML or JSON – Google says they (compared to XML).. are 3 to 10 times smaller are 20 to 100 times faster provide generated data access classes for programmatic use provide backward compatibility ...

July 6, 2010 · 5 min · 1022 words · Micha Kops

Java Server Faces/JSF 2 Tutorial – Step 1: Project setup, Maven and the first Facelet

In this short tutorial we are going to build a Java Server Faces Web-Application using JSF2.0, Facelets, Maven and Hibernate as ORM Mapper. The goals for this first step are: Setting up the project structure using Maven, defining a frame template/decorator and a registration facelet, creating a managed bean and mapping it’s values to the facelet, adding some basic validation, displaying validation errors and finally adding a navigation structure. In step2 of this tutorial we are going to add persistence using Hibernate, add some security, create a custom UI component and add some AJAX. ...

June 5, 2010 · 9 min · 1841 words · Micha Kops

Sensor Fun: Location Based Services and GPS for Android

The Android SDK offers a nice API to receive information about available providers for location based services and get the current location and coordinates. In this short tutorial we’re going to build a small activity that displays a list of available location providers and shows the current position using GPS services. Example Application Create a new Android Project using ADT and your IDE with a package named com.hascode.android.location_app Add the permissions needed to the AndroidManifest.xml – it should look like this <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hascode.android.location_app" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".LocationActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="7" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission> <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"></uses-permission> <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission> </manifest> ...

May 30, 2010 · 4 min · 731 words · Micha Kops

Extending the Confluence Search Index

Developing plugins for the Confluence Wiki a developer sometimes needs to save additional metadata to a page object using Bandana or the ContentPropertyManager. Wouldn’t it be nice if this metadata was available in the built-in Lucene index? That is were the Confluence Extractor Module comes into play.. Overview An extractor allows the developer to add new fields to the lucene search index. Creating a new extractor is quite simple – just implement the interface com.atlassian.bonnie.search.Extractor or bucket.search.lucene.extractor.BaseAttachmentContentExtractor if you want to build a new file extractor. ...

May 23, 2010 · 4 min · 713 words · Micha Kops

Creating a simple Gesture App with Android

The integration of gestures into your android app adds some nice functionality and is made very easy using Google’s GestureBuilder application and the integrated GestureLibrary and Gesture Overlay API – so let’s build a sample app. If you need some basic information regarding gestures on android first – take a look at this article. Creating a gesture library First you need to define the gestures that should be captured in the application later. For this reason there’s the GestureBuilder delivered with the Android SDK. You can find the app in the samples directory of your android sdk – e.g. <installation-directory>/android-sdk-linux_86/platforms/android-2.1/samples/GestureBuilder. ...

May 14, 2010 · 3 min · 635 words · Micha Kops

Playing around with QR Codes

Sometimes QR codes are a nice way to distribute information like calendar events, contact information, e-mail, geo-locations or internet addresses. In the following article we’re going to encode information to QR code images using the ZXing library and afterwards decode information from a given QR code. Finally we’re taking a look on online QR code generators and how to integrate the ZXing library in a Maven project. The ZXing Library Download the ZXing Libraries from http://code.google.com/p/zxing/downloads/list – the file name is ZXing-<version>.zip Unpack the downloaded archive somewhere Change to the extracted directory and run ant. If you don’t have JavaME installed – and you don’t have to for the samples below – run ant buildwithoutj2me – that will do the job Having compiled the libraries you’re now free to include the core.jar from zxing-<version>/core/ and the javase.jar from zxing-<version>/javase as dependency in your project ...

May 11, 2010 · 5 min · 1041 words · Micha Kops

First steps on Android: Creating a simple Todo App

In this tutorial we are going to build a simple todo app that is able to store simple todos in a database. The user is able to add new todos or delete old ones by clicking on a todo. For this tutorial we won’t use maven to keep it simple – if maven integration is desired – take a look at this tutorial. Steps Create a new android project using the Android SDK and your IDE Create some packages com.hascode.android.activity and com.hascode.android.persistence Create the layout in res/layout/main.xml – the main elements: a listview for the todos-list, a textbox and a button to enter new data. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/widget31" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" > <TableRow android:id="@+id/row" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_below="@+id/tasklist" android:layout_alignParentLeft="true" > <EditText android:id="@+id/etNewTask" android:layout_width="200px" android:layout_height="wrap_content" android:text="" android:textSize="18sp" > </EditText> <Button android:id="@+id/btNewTask" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@+string/add_button_name" > </Button> </TableRow> <ListView android:id="@+id/tasklist" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" > </ListView> </RelativeLayout> ...

April 26, 2010 · 5 min · 1056 words · Micha Kops