Compiling the AndEngine Racer Game Demo

The creator of AndEngine, Nicolas Gramlich, has released a number of sample projects to illustrate how to create games with the engine. The Racer sample is a simple top-down game where you drive a race car around a track and avoid obstacles. Here it is running in the emulator:

Getting Started with AndEngine Gaming Engine

AndEngine is an Open Source framework that can help you create 2D graphics-based games for the Android platform. The core engine contains components that wrap the functionality of OpenGL and provides a basic framework for games. There are also a number of extensions, most notably the Box 2D extension which allows you to access the renowed Java Box 2D physics engine via AndEngine, and the Live Wallpaper extension for making, surpise, live wallpapers. The project source is hosted on Google.

How to Resume an App and Restore State

When for whatever reason focus switches away from your app to another, for instance the user answers an incoming call or switches to the Home screen (which is itself an Activity just like any other), your app will be paused - that is, it will be suspended for an indefinite period. Whilst paused, it's quite possible that the system will kill it in order to free up its resources for whatever app is running in its place.

Accessing ListView Items with a Context Menu

The first thing to do is to register your ListView as having a context menu, using the registerForContextMenu() method. The following lines of code in your ListActivity's onCreate() method accomplish this:

ListView lv = getListView();
registerForContextMenu(lv);

Next we need to set up the menu options that the user will be able to choose from. It can be useful to define a suitably named class constant for each of our options:

Binding Data to a ListActivity's ListView

Extending the ListActivity class is the only way Android applications can display data with a ListView widget. The ListActivity class contains a ListAdapter, which is how we attach our data to the ListView.

Adding a Second Activity to your Android App

Android apps are organised into distinct 'activities', each represented by an instance of Activity or one of its subclasses.

When you create a new Android project in Eclipse, a default Activity is created for you. For anything beyond the most simple app, a single Activity will not be enough. The user can easily switch back and forth between different activities, and they are the basic way of subdividing distinct functionality in Android.

Create a SQL Database for your Android App

If you want to store arbitrary amounts of structured data, you'll probably want to make use of Android's SQLite database support. SQLite provides a simplified subset of SQL statements for managing your data. Databases are stored on the device's public data area, either on the SD card or in the device's internal memory.

The documentation on this page discusses how to use a SQLite database in an Android app. In Eclipse, the procedure is this:

'To Do' Notepad App

I want to create an android app that serves as a 'to do' list.

  • It should be suitable for keeping shopping lists and also general 'to do' lists.
  • It should be easily accessible from the home screen, perhaps by a widget.
  • Make use of previous entries e.g. previous items on a shopping list

Rather than each list being a simple block of editable text, it would appear a database driven solution would fit better as that would support moving items more readily.

Firefox pounces onto Android: Current Browser Round-up

Firefox 4

The Mozilla corporation released the production version of Firefox 4 on 29th March. Unfortunately it only supports phones with ARM 7 processors; older devices that run on ARM 6 will not be able to run this app. Thus neither HTC Magic or HTC Wildfire are able to run the Mozilla browser - click here for a full list of supported devices.

IcedRobot under Construction by l33t Java Hackers

A bunch of developers have got together to form a team headed by Mario Torres and David Fu to create an alternative to the Dalvik JVM in Android. The idea is to replace the licence-hobbled Dalvik with something based on OpenJDK which they're calling IcedRobot (following the pattern of the IcedTea plugin for Java support in browsers).

Syndicate content

Theme port sponsored by Duplika Hosting reloaded by Deeson Design
Home Back To Top