Finally Google Released the NDK, which allows developers to use native code/libraries in their code (programmed in C or C++) which can be used for intense CPU operations such as encoding/decoding or physics.
You can download it here.
For most Developers this isn’t much interesting, but if you need advanced stuff as implementing your own audio and video codec, you may want to try it out.
Source: Android Developers Blog
One difference to between conventional programming and Android development is that the Android OS can at any time kill your Activity if it runs low on resources or in certain other conditions like configuration changes.
This can be very critical when it comes to data. On such an event, there is a possibility that data loss will occur and as programmer you want to avoid that under any circumstances.
Most of the standard widgets like EditText already preserve their state under certain circumstances. By default widgets/UI elements with an android:id attribute defined, will by default preserve their states when the application is destroyed and recreated.
But what if the you need to preserve data defined inside of your Activity or your own widgets?
Continue Reading »
SavedState: Preserve data when your Activity is recreated – Part 1
When you’re developing application, there is often a need to create your own controls/widgets/classes or to extend already available ones. And in most cases, you want this control/widget to be as flexible as possible. In order to achieve this, you have to create special events, which can be handled outside of your widget.
Some of the popular examples are OnClickListener and OnKeyListener. But sometimes you need Events/Listener which aren’t predefined by the Java or Android SDK. In this case, you have to create your own Listener interface.
In the last post, I’ve shown three different way on how to implement Listeners in your application. Now I’ll show you how to implement your own Listeners.
Continue Reading »
How to implement your own Listener in Android/Java
I’ve seen many people asking how to implement Listeners in their applications. Implementing a Listener is quite easy. There are 3 ways to implement an Listener and the have their advantages and disadvantages.
The tree way to implement Listeners are
- Inline Implementation
- Using the
implementskeyword - By using variables
We’ll use our good old LoginExample application, created in previous tutorial which can be found at Android: Your first Android Application.
Continue Reading »
Implementing Listeners in your Android/Java application
In the last article, Android: Your first Android Application, we created a simple login screen, but didn’t had time to go in deeper in the UI XML structure. In this article I will explain the basics of creating an UI via XML resource. I’ll use the XML file from previous example here.
So, you finally want to make you first Android Applications. But don’t be scared, we won’t start with the "Hello, World!" application usually used to introduce you into a programming language, but will start with something more useful: A login screen.
If you haven’t setup the SDK & Eclipse yet, you should first read my previous "Android: Installing the SDK" post and then come back.
First we create a new project by selecting the File menu -> New -> Android Project or right-clicking the Package Explorer -> New -> Android Project.
Before getting started, you first need to download and install the Android SDK. But first, if you meet the requirements.
In order to use the Android SDK, you need to have JDK 5 or JDK 6 installed on your system (JRE alone won’t do it!). Next you’ll need an IDE (it’s optional, but makes developing much much easier than writing all your code in a simple text editor). I suggest using Eclipse 3.4 together with the Android Development Tools for Eclipse.





