目前分類:Android (33)
- Sep 11 Thu 2014 09:40
Eclipse 徹底更改 Android Project 名稱
- Sep 10 Wed 2014 13:24
如何使用 Google Mobile Ads SDK
- Jun 02 Mon 2014 08:30
Invalid Project Description error when importing Android Projects to Eclipse
When am trying to import an existing android project to Eclipse it is showing the error “Invalid Project Description”. The solution for this “Invalid Project Description” error is
1. Instead of using Android => Existing Android code to workspace you need to choose General => Existing projects into workspace
- Jul 26 Fri 2013 09:17
Android 學習網站
- Jul 16 Tue 2013 17:55
Android Item Resource has a Name and Type
For example, given the following XML located in a file in the res/values directory
<?xml version="1.0" encoding="utf-8"?> <resources> <item name="host" type="setting">10.0.2.2</item> <item name="port" type="setting">3000</item> </resources>
I can now use the following Java syntax within an Android Activity:
- Jul 16 Tue 2013 16:48
An Android Master/Detail Flow Tutorial
The Master/Detail Flow
A master/detail flow is a interface design concept whereby a list of items (referred to as the master list) is displayed to the user. On selecting an item from the list, additional information relating to that item is then presented to the user within a details panel. An email application might, for example, consist of a master list of received messages consisting of the address of the sender and the subject of the message. Upon selection of a message from the master list, the body of the email message would appear within the detail panel.
- Jul 16 Tue 2013 15:43
佈景主題
Android 提供了“佈景主題”的機制,讓各個應用程式間可以維持一致的風格。佈景主題對於顏色,高度,距離間隔,和字型大小都設定了規範。
在Android 4.0 (ICS) 中提供了三種佈景主題給軟體開發者使用,分別是:
- Jul 10 Wed 2013 11:22
原來WiFi上也可以執行ADB
- Nov 22 Thu 2012 11:39
寫入文字檔
程式執行當中常常需要記錄各種資訊,如果需要處理的資訊較為單純,可以直接使用文字檔來紀錄,假若資料較繁雜就需要用SQLite,在此先以簡單文字檔做切入,先以Java I/O介紹寫檔、讀檔常用的方法及常用的Method
- Nov 21 Wed 2012 15:12
android開機後自動啟動activity/service
首先是從BroadcastReceiver派生出一個新類,用來監聽系統啟動後發出的廣播消息android.intent.action.BOOT_COMPLETED 。
- BootReceiver.java:
- import android.content.BroadcastReceiver;
- import android.content.Context;
- import android.content.Intent;
- import android.util.Log;
- publicclass BootReceiver extends BroadcastReceiver {
- publicvoid onReceive(Context context, Intent intent) {
- if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED"))
- {
- Log.d("BootReceiver", "system boot completed");
- Intent newIntent = new Intent(context, FirstRun.class);
- newIntent.setAction("android.intent.action.MAIN"); //MyActivity action defined in AndroidManifest.xml
- newIntent.addCategory("android.intent.category.LAUNCHER");//MyActivity category defined in AndroidManifest.xml
- newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //If activity is not launched in Activity environment, this flag is mandatory to set
- context.startActivity(newIntent);
- //if you want to start a service, follow below method:
- /*******************************************************
- Intent service = new Intent(yourService.ACTION_START);
- service.setClass(context, yourService.class);
- context.startService(service);
- ******************************************************/
- }
- }
- }
接下来这个类就是监听到系统启动完毕后,我们要运行的activity.
- Nov 21 Wed 2012 10:42
Hello World C program using Android Toolchain
I had reported earlier how I had gotten a C Hello World statically-linked program running on my Android phone using CodeSourcery's toolchain (on linux). Today I got a dynamically-linked Hello World program running on the phone, compiled using Android's prebuilt toolchain from the source.
- Nov 21 Wed 2012 10:40
ERROR: Application requires API version 10. Device API version is 8
- Nov 20 Tue 2012 09:25
./hello1,出現:Not executable:magic 7F45
Hello World in C on Android
If you've been following the Android world, you'd know that Android's SDK requires you to write apps in Java. Ever since I got my phone I've been dying to run a Hello World C program, but I've been unable to get the right cross compiler for it.