顯示具有 How-to 標籤的文章。 顯示所有文章
顯示具有 How-to 標籤的文章。 顯示所有文章

2012年12月27日 星期四

Local datetime in SQLite




This article shows how to get the local date time from SQLite


When we run the following SQL, it returns the UTC time..

select datetime('now');

2012-12-26 16:01:07




To return the local time, you can add the the parameter 'localtime' 

select datetime('now', 'localtime');

2012-12-27 00:01:07

2012年12月18日 星期二

[How-to] Get the year-month-day (yyyy-mm-dd) from a date field in SQLite

SQLite is the database for the Android Application.


The following SQL is an example of getting date by SQL statement.

select _id, strftime('%Y-%m-%d', create_date) c_date from TABLE1

Returned result:


Another SQL example shows how to get counts of records by date

select strftime('%Y-%m-%d', create_date), count(strftime('%Y-%m-%d', create_date) ) from TABLE1 group by strftime('%Y-%m-%d', create_date)



More reference for the date field in SQLite can be found in the official website
http://www.sqlite.org/lang_datefunc.html

2012年11月25日 星期日

Andriod Permission: Connect to Internet



The following permission should be grant for the internet connection from Android Application.

<manifest xmlns:android="http://schemas.android.com/apk/res/android" ... />
    ...
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

2012年1月15日 星期日

Android Development for Beginner: Snake


This tutorial is for the beginner and demonstrate how to implement a tradition game "Snake" using Android 4.0.3.

The source code of this tutorial are extracted from the android developer official website and we will show you step by step on how to download and run the program. (http://yp-appdev.blogspot.com/)





2012年1月9日 星期一

[SOLVED]: Unable to find a 'userdata.img' file for ABI armeabi to copy into the AVD folder


System may returns error in creating an Android Virtual Device for the 4.0.x android ice cream sandwich and returns the error message in console
Unable to find a 'userdata.img' file for ABI armeabi to copy into the AVD folder.



Solution

Install ARM EABI v7a System Image and the problem is resolved! (http://yp-appdev.blogspot.com/)

After the installation, create the Android Virtual Device again and no errors found.


AVD Created


Success!




2012年1月2日 星期一

Android + Eclipse Development Platform Setup


The following tutorial shows how to setup the development environment for Android.

You have to install the following software in your machine.
- JAVA SDK
- Eclipse
- Android Development Kit

Steps by steps
1. Download and Install the latest version of the Java SDK.