1. 新建单独的定义code的变量文件:

    保存格式必须为.c文件

Chi Learning 發表在 痞客邦 留言(0) 人氣()

在協同工作中,經常會有模塊維護和代碼封裝的問題。 把需要封裝的代碼打成一個lib無疑是一種很好的方式。

1.創建lib

Chi Learning 發表在 痞客邦 留言(0) 人氣()

 最近遇到了以dmg结尾的文件,着实把我给忙着了,之前没有遇到过这种后缀名的文件,查询了下,总结四种方法分享给遇到此类问题的朋友么,以后大家就不会再有
dmg文件怎么打开,如何打开dmg文件,dmg格式用什么打开 这些疑问了。

Chi Learning 發表在 痞客邦 留言(0) 人氣()

VMware Server 當掉後重新啟動 Guest OS 時,出現

cannot open the disk '*.vmdk' or one of the snapshot disk is depends on.
Reason: Failed to lock the file.

解決方法一:

Chi Learning 發表在 痞客邦 留言(0) 人氣()

程式執行當中常常需要記錄各種資訊,如果需要處理的資訊較為單純,可以直接使用文字檔來紀錄,假若資料較繁雜就需要用SQLite,在此先以簡單文字檔做切入,先以Java I/O介紹寫檔、讀檔常用的方法及常用的Method

 

Chi Learning 發表在 痞客邦 留言(0) 人氣()

首先是從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.

Chi Learning 發表在 痞客邦 留言(0) 人氣()

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.

Chi Learning 發表在 痞客邦 留言(0) 人氣()

入門 Android,安裝了一堆有的沒的之後  

新增一個Project執行,卻出現

Chi Learning 發表在 痞客邦 留言(0) 人氣()

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.

Chi Learning 發表在 痞客邦 留言(0) 人氣()