Home Home
SQLite Basics PDF Print E-mail
Sunday, 11 July 2010 03:08
SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file.
Read more...
 
How to build Android NDK with GNU Makefile PDF Print E-mail
Friday, 09 July 2010 22:01

Just try this command: ndk-build -B --makefile=/path_to_your_gnu_makefile/Makefile

 
AsyncTask: perform background operations and publish results on the UI thread PDF Print E-mail
Friday, 09 July 2010 03:20

This exercise have the same effect of "Android background thread, by extending Thread" and "Android background thread, by implementing Thread object, provided with a Runnable object". It is implemented in AsyncTask instead of Thread.

 



AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.

An asynchronous task is defined by a computation that runs on a background thread and whose result is published on the UI thread. An asynchronous task is defined by 3 generic types, called Params, Progress and Result, and 4 steps, called begin, doInBackground, processProgress and end.

Read more...
 
How to make a native c application on Android using NDK? PDF Print E-mail
Thursday, 08 July 2010 21:00

How to make a native c application on Android using NDK?

 

First, download Android SDK, NDK, Eclipse and follow the instruction on NDK page. Make sure that you installed the development environment correctly.

 

Make an Android project with Eclipse (check our previous posts). Inside your project folder make a jni folder: <project>/jni/

 

Then write your c code, here is an Hello Android exemple:

 

#include <stdio.h>

 

int main()

{

printf ("hello Android \n");

return 0;

}

 

 

Then make an Android makefile: Android.mk inside jni folder:

 

 

 

LOCAL_PATH:= $(call my-dir)

 

include $(CLEAR_VARS)

 

LOCAL_MODULE    := test

LOCAL_CFLAGS    := -Werror

LOCAL_SRC_FILES := test.c

 

 

include $(BUILD_EXECUTABLE)

 

 

Open a terminal, go to your project folder, type: ./ndk-build

 

You should have an executable file at your_project/bin/ndk/armeabi/

 

Use adb to copy this file to emulator:

 

./adb push /path_to_your_project/bin/ndk/local/armeabi/test data

adb shell data/test

 

Then you should see "Hello Android" on your screen.

 

Or you can try to open a terminal on the emulator, then go to the folder data, then type ./test, you should see "Hello Android" on the emulator's screen also.

 
How to make Android.mk for a deep source tree PDF Print E-mail
Wednesday, 07 July 2010 18:53
If you need to build sources spread over a deeply nested tree:
<topdir>/

        dir1/

                file1.c

                file2.c
        dir2/

                file3.c

                file4.c

and so on . And you don't want to list the paths to all source files in LOCAL_SRC_FILES in Android.mk, you can do something like:

 

<topdir>/Android.mk:
LOCAL_PATH := $(call my-dir)
LOCAL_MODULE := mylib

include $(LOCAL_PATH)/dir1/sources.mk
include $(LOCAL_PATH)/dir2/sources.mk

include $(BUILD_SHARED_LIBRARY)

 

<topdir>/dir1/sources.mk:
sources := file1.c file2.c
LOCAL_SRC_FILES += $(sources:%=dir1/%)

<topdir>/dir2/sources.mk:
sources := file3.c file4.c etc...
LOCAL_SRC_FILES += $(sources:%=dir2/%)

 
A closer look at the Android project build system: android.mk PDF Print E-mail
Wednesday, 07 July 2010 18:39

This is the second post on the build system where we will take a closer look at the Android.mk file and what options are available. An Android.mk file describes the build for any native module that should go in the platform. We will start by looking at the makefile for the external ping facility found in external/ping.

Read more...
 
How to build and run a native c application on android emulator PDF Print E-mail
Wednesday, 07 July 2010 03:20

* to start emulator
  ./emulator -console
 

* to transfer a file to emulator; this is stored in emulator's
userdata.img file
  adb push <file> <dst file>
 

* to copy a file or a directory recursively to emulator
  adb push <source> <destination>
 

* to copy a file or a directory recursively from emulator
  adb pull <source> <destination>
 

* emulator can run native ARM Linux code.
  build your apps using GNU/ARM Linux toolchain and then run in
emulator.

Read more...
 
Displays video in VideoView PDF Print E-mail
Wednesday, 07 July 2010 03:14

The VideoView class can load images from various sources (such as resources or content providers), takes care of computing its measurement from the video so that it can be used in any layout manager, and provides various display options such as scaling and tinting.

Read more...
 
Linkify PDF Print E-mail
Wednesday, 07 July 2010 03:10

Linkify take a piece of text and a regular expression and turns all of the regex matches in the text into clickable links. This is particularly useful for matching things like email addresses, web urls, etc. and making them actionable. Alone with the pattern that is to be matched, a url scheme prefix is also required. Any pattern match that does not begin with the supplied scheme will have the scheme prepended to the matched text when the clickable url is created.

Read more...
 
Example of AutoCompleteTextView PDF Print E-mail
Wednesday, 07 July 2010 03:06

AutoCompleteTextView is an editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.

Read more...
 
« StartPrev12345678910NextEnd »

Page 8 of 44