final CharSequence[] items = {"Red", "Green", "Blue"};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Pick a color");
builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
}
});
AlertDialog alert = builder.create();
2013年2月21日 星期四
Add radioboxes and checkboxes
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2013年2月20日 星期三
Playing android games on PC?
Youwave for Android works great! My son wanted to play Robodefense on the PC so I found this little piece of software that's simple and uses .apk files I had on my G-Tablet. http://www.youwave.com/ Thanks, how do you get the android files from the market to the pc to begin with? Playing robo defense on the phone will wipe out the battery quick try 4shared This hosts warez items which is not allowed here (neither the discussion).
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
R.menu cannot be resolved
You need to import the R.java class. import [package_name].R; like import com.HennighanDev.IncomeTax.R
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
Unable to resolve target 'android-5'
問題描述: 當程式import進來後,執行前下方出現Unable to resolve target'android-X' 原因: 安裝2.1或2.2 version ,API level:7裡面沒有"API level5的AVD"可對應 解決方式: 開啟default.properties文件,將target=android-5改成target=android-7即可執行了 (高版本可以向下相容)
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2012年9月15日 星期六
Error generating final archive: Debug certificate expired on xxxxxx(date)
When you build a project in Eclipse, it prompts you an error message.
Error generating final archive: Debug certificate expired on xxxxxx
Solution
Error generating final archive: Debug certificate expired on xxxxxx
Solution
- Go to directory C:\Documents and Settings\Administrator\.android
- Delete the file debug.keystore and ddms.cfg
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2011年11月10日 星期四
2d draw example
Android 2D Graphics Example
This example shows how to use onDraw() method and create a simple drawing program. The only significant files are Draw activity and the DrawView.
Draw.java
This activity creates the DrawView and sets it as activity's main content. It also sets the borderless window.
package com.example;
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
public class Draw extends Activity {
DrawView drawView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set full screen view
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
drawView = new DrawView(this);
setContentView(drawView);
drawView.requestFocus();
}
}
DrawView.java
DrawView is a view. It listens to mouse click events and draws a point at the point that it was clicked on.
package com.example;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
public class DrawView extends View implements OnTouchListener {
private static final String TAG = "DrawView";
List points = new ArrayList();
Paint paint = new Paint();
public DrawView(Context context) {
super(context);
setFocusable(true);
setFocusableInTouchMode(true);
this.setOnTouchListener(this);
paint.setColor(Color.WHITE);
paint.setAntiAlias(true);
}
@Override
public void onDraw(Canvas canvas) {
for (Point point : points) {
canvas.drawCircle(point.x, point.y, 5, paint);
// Log.d(TAG, "Painting: "+point);
}
}
public boolean onTouch(View view, MotionEvent event) {
// if(event.getAction() != MotionEvent.ACTION_DOWN)
// return super.onTouchEvent(event);
Point point = new Point();
point.x = event.getX();
point.y = event.getY();
points.add(point);
invalidate();
Log.d(TAG, "point: " + point);
return true;
}
}
class Point {
float x, y;
@Override
public String toString() {
return x + ", " + y;
}
}
Results
You should see a black screen and be able to draw on it with your finger. Expand the features and enjoy it!
This example shows how to use onDraw() method and create a simple drawing program. The only significant files are Draw activity and the DrawView.
Draw.java
This activity creates the DrawView and sets it as activity's main content. It also sets the borderless window.
package com.example;
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
public class Draw extends Activity {
DrawView drawView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set full screen view
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
drawView = new DrawView(this);
setContentView(drawView);
drawView.requestFocus();
}
}
DrawView.java
DrawView is a view. It listens to mouse click events and draws a point at the point that it was clicked on.
package com.example;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
public class DrawView extends View implements OnTouchListener {
private static final String TAG = "DrawView";
List
Paint paint = new Paint();
public DrawView(Context context) {
super(context);
setFocusable(true);
setFocusableInTouchMode(true);
this.setOnTouchListener(this);
paint.setColor(Color.WHITE);
paint.setAntiAlias(true);
}
@Override
public void onDraw(Canvas canvas) {
for (Point point : points) {
canvas.drawCircle(point.x, point.y, 5, paint);
// Log.d(TAG, "Painting: "+point);
}
}
public boolean onTouch(View view, MotionEvent event) {
// if(event.getAction() != MotionEvent.ACTION_DOWN)
// return super.onTouchEvent(event);
Point point = new Point();
point.x = event.getX();
point.y = event.getY();
points.add(point);
invalidate();
Log.d(TAG, "point: " + point);
return true;
}
}
class Point {
float x, y;
@Override
public String toString() {
return x + ", " + y;
}
}
Results
You should see a black screen and be able to draw on it with your finger. Expand the features and enjoy it!
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2011年6月30日 星期四
取得系統基本資訊
package com.demo.android.info;
import com.demo.android.info.R;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.widget.TextView;
public class Info extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//android.os.Build.VERSION
setContentView(com.demo.android.info.R.layout.main);
TextView _tv = (TextView)findViewById(R.id.main_textview);
_tv.append("CPU type + ABI convention: "+android.os.Build.CPU_ABI+"\n");
_tv.append("Board: "+android.os.Build.BOARD+"\n");
_tv.append("Brand: "+android.os.Build.BRAND+"\n");
_tv.append("Device: "+android.os.Build.DEVICE+"\n");
_tv.append("Display: "+android.os.Build.DISPLAY+"\n");
_tv.append("Fingerprint: "+android.os.Build.FINGERPRINT+"\n");
_tv.append("Host: "+android.os.Build.HOST+"\n");
_tv.append("ID: "+android.os.Build.ID+"\n");
_tv.append("Manufacturer: "+android.os.Build.MANUFACTURER+"\n");
_tv.append("Model: "+android.os.Build.MODEL+"\n");
_tv.append("Product: "+android.os.Build.PRODUCT+"\n");
_tv.append("Tags: "+android.os.Build.TAGS+"\n");
_tv.append("Time: "+String.valueOf(android.os.Build.TIME)+"\n");
_tv.append("Type: "+android.os.Build.TYPE+"\n");
_tv.append("User: "+android.os.Build.USER+"\n");
_tv.append("The current development codename "+android.os.Build.VERSION.CODENAME+"\n") ;
_tv.append("Versoin incremental: "+android.os.Build.VERSION.INCREMENTAL+"\n");
_tv.append("The user visible version(release): "+android.os.Build.VERSION.RELEASE+"\n");
_tv.append("The user visible sdk version: "+android.os.Build.VERSION.SDK+"\n");
_tv.append("The user visible sdk version(int) : "+String.valueOf(android.os.Build.VERSION.SDK_INT)+"\n");
}
}
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
錄製mp4檔案
package com.demo.android.test;
import java.io.File;
import android.app.Activity;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.util.Log;
public class Test extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
File file = new File("/storage/test.mp4");
try
{
if(!file.exists())
{
if(file.createNewFile())
{
Log.e("debug","create empty file successful.");
}
else
{
Log.e("debug","create empty file failure.");
}
}
MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile("/storage/test.mp4");
recorder.prepare();
Log.e("debug","recorder start ....");
recorder.start(); // Recording is now started
Thread.sleep(60000);
Log.e("debug","reorder stop....");
recorder.stop();
}
catch(Exception ex)
{
Log.e("debug",ex.toString());
}
}
}
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2011年3月29日 星期二
Unable to execute dex: Java heap space
最近要用到第三方的庫android-sdk-windows\platforms\android-8\data\layoutlib.jar,但出現Conversion to Dalvik format failed: Unable to execute dex: null這個問題。且出現對話方塊
下面是解法:
(註: 紅色標記表示有試過但不行,綠色標記表示有試過可行。)
As Android developer, I have met a strange problem when I want use a third party jar, it remained me that:
Dex Loader] Unable to execute dex: null
Conversion to Dalvik format failed: Unable to execute dex: null
out of memory error…An internal error occurred during: “Build Project”.
Java heap space
This is the DEX Error,I find the solutions by Google, one way is to modify the eclipse.ini, you can increase the memory allocated in eclipse.ini to this: -Xms128m -Xmx512m or something higher, but this didn’t work for me. After modify the eclipse.ini, I cannot start the eclipse. By StackOverflow, I find a solution:
eclipse.ini file must have -vm on first line and path on second line. don’t try to put everything into one line!
-vm
C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe
After add the -vm and the path in my eclipse.ini, I can start my Eclipse and the problem has been resolved.
Another way to solve the ” Conversion to Dalvik format failed: Unable to execute dex: null” problem is using the user library, the concrete steps are as follows:
1. Right-click the project in Eclipse and select “Build Path -> Add Libraries…”.
2. Select User Library from the list and click Next.
3. Click the “User Libraries…” button.
4. Click “New…” in the User Libraries dialog.
5. Give the user library a name and select the System library checkbox and click OK.
6. Highlight the newly added user library in the list and click the “Add JARs…” button and add the desired jar files.
7. Click OK on the User Libraries dialog.
8. Make sure the new user library is checked in the Add Library dialog and …
Posted by CuteAndroid
下面是解法:
(註: 紅色標記表示有試過但不行,綠色標記表示有試過可行。)
As Android developer, I have met a strange problem when I want use a third party jar, it remained me that:
Dex Loader] Unable to execute dex: null
Conversion to Dalvik format failed: Unable to execute dex: null
out of memory error…An internal error occurred during: “Build Project”.
Java heap space
This is the DEX Error,I find the solutions by Google, one way is to modify the eclipse.ini, you can increase the memory allocated in eclipse.ini to this: -Xms128m -Xmx512m or something higher, but this didn’t work for me. After modify the eclipse.ini, I cannot start the eclipse. By StackOverflow, I find a solution:
eclipse.ini file must have -vm on first line and path on second line. don’t try to put everything into one line!
-vm
C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe
After add the -vm and the path in my eclipse.ini, I can start my Eclipse and the problem has been resolved.
Another way to solve the ” Conversion to Dalvik format failed: Unable to execute dex: null” problem is using the user library, the concrete steps are as follows:
1. Right-click the project in Eclipse and select “Build Path -> Add Libraries…”.
2. Select User Library from the list and click Next.
3. Click the “User Libraries…” button.
4. Click “New…” in the User Libraries dialog.
5. Give the user library a name and select the System library checkbox and click OK.
6. Highlight the newly added user library in the list and click the “Add JARs…” button and add the desired jar files.
7. Click OK on the User Libraries dialog.
8. Make sure the new user library is checked in the Add Library dialog and …
Posted by CuteAndroid
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2011年3月17日 星期四
Robotium資源
- http://code.google.com/p/robotium/
- http://stackoverflow.com/search?q=robotium
- http://bbs.51testing.com/thread-283893-1-1.html
- How to resign the Android APK
- 白箱黑箱測試
- RobotiumForPreInstalledApps
- How do I run Robotium tests from the command line
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
How do I run Robotium tests from the command line
By using this command:
adb shell am instrument -w com.android.foo/android.test.InstrumentationTestRunner
Reference:
http://code.google.com/p/robotium/wiki/QuestionsAndAnswers
adb shell am instrument -w com.android.foo/android.test.InstrumentationTestRunner
Reference:
http://code.google.com/p/robotium/wiki/QuestionsAndAnswers
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
RobotiumForPreInstalledApps
- Log in as root: adb root
- Remount: adb remount
- adb pull /system/app/X.apk (Replace X with the name of the application)
- Resign X.apk so that it has the same certificate signing as the test project (測試APK的sign需與被測試APK的sign一致。)
- adb pull /data/system/packages.xml
- Open packages.xml and remove:
..... - Push packages.xml back to device: adb push packages.xml /data/system
- Restart your device
- Push the resigned X.apk back to the device: adb push X.apk /system/app
Reference:
http://code.google.com/p/robotium/wiki/RobotiumForPreInstalledApps
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
白箱黑箱測試
白箱測試(White-Box Testing)
白箱測試也稱為結構性測試(Structural Testing),有時候因為牽涉到內部機密的問題,這種測試路線大都是在公司內部進行很少委外給其他公司或個人。 嚴格來說,白箱測試有兩大層面;資料流程面(Data Flow Coverage)以及控制流程面(Control Flow Coverage),資料流程面就是測試資料在系統的進出入於程式內所經過的流程,控制流程面就是測試程式在執行過程中每個階段的流程。
黑箱測試(Black-Box Testing)
測試人員並不需要對軟體的結構性有足夠深層的瞭解,所進行的測試是著重於軟體的功能面,所以也有人稱之為功能測試。 這樣的測試除了在自己公司內部進行之外,同樣的也可以委外給其他人員或是公司去執行。 為了要控制黑箱測試的執行,測試人員必須要按照測試案例(Test Cases)來逐一進行,所以Test Cases設計的好壞就會直接影響到測試結果。
Reference:
http://stevenhsu.myweb.hinet.net/softwaretesting.htm
白箱測試也稱為結構性測試(Structural Testing),有時候因為牽涉到內部機密的問題,這種測試路線大都是在公司內部進行很少委外給其他公司或個人。 嚴格來說,白箱測試有兩大層面;資料流程面(Data Flow Coverage)以及控制流程面(Control Flow Coverage),資料流程面就是測試資料在系統的進出入於程式內所經過的流程,控制流程面就是測試程式在執行過程中每個階段的流程。
黑箱測試(Black-Box Testing)
測試人員並不需要對軟體的結構性有足夠深層的瞭解,所進行的測試是著重於軟體的功能面,所以也有人稱之為功能測試。 這樣的測試除了在自己公司內部進行之外,同樣的也可以委外給其他人員或是公司去執行。 為了要控制黑箱測試的執行,測試人員必須要按照測試案例(Test Cases)來逐一進行,所以Test Cases設計的好壞就會直接影響到測試結果。
Reference:
http://stevenhsu.myweb.hinet.net/softwaretesting.htm
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
How to resign the Android APK
- 用壓縮軟體解壓縮檔案test.apk 至資料夾test,移除資料夾 “META-INF”
- 準備一個key store用來作簽證
keytool -genkey -v -keystore android.keystore -alias android.keystore -keyalg RSA -validity 20000 - 用壓縮軟體壓縮資料夾test,將壓縮檔重新命名為test.apk.
- 重新對檔案test.apk作簽證
"C:\Program Files\Java\jdk1.6.0_10\bin\jarsigner" -verbose -keystore android.keystore -storepass 123456 -signedjar ./testNew.apk ./test.apk android.keystore - 得到重新簽證後的檔案testNew.apk
http://blog.csdn.net/sooner01/archive/2010/12/27/6101018.aspx
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2011年3月2日 星期三
Creating Toast
Context context = getApplicationContext();
CharSequence text = "Hello toast!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
CharSequence text = "Hello toast!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2011年2月23日 星期三
java.lang.NoSuchMethodError:
寫程式測試手機reboot功能
程式碼
pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
pm.reboot(null);
權限
程式碼
pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
pm.reboot(null);
權限
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
java.lang.Object cannot be resolved
在Eclipse中建制專案,總是報下面的錯誤。
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
解決辦法:引入需要的android.jar即可。 (Project->properties->Java Bulid Path )
android.jar location:
D:\android-sdk-windows\platforms\android-#\android.jar
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
解決辦法:引入需要的android.jar即可。 (Project->properties->Java Bulid Path )
android.jar location:
D:\android-sdk-windows\platforms\android-#\android.jar
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
Eclipse找不到proguard.cfg解決辦法
- Eclipse--->Window--->Android SDK And AVD Manager(或者直接在Android解壓目錄底下運行SDK Setup.exe)
- 選擇installed packages,在右邊列表中選擇SDK tools ,點擊update all
等待更新完畢就OK了!
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2011年2月16日 星期三
用logcat除錯,將log寫入檔案
- 在android裝置中啟動測試程式。
- 在PC設定裝置檔案系統權限 adb shell mount -o remount,rw rootfs /,因為之後要寫入檔案。
- 在PC將log寫入檔案中 adb logcat -b main -f /data/mains 。
FORMAT: adb logcat -b main -f <remote device file name> - 當測試程式執行完畢,執行 adb pull /data/mains mains_test 來取得log檔案。
FORMAT: adb pull <remote device file name> <local file name>
Labels:
Android
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
2011年2月15日 星期二
Error - java.lang.VerifyError
是說當“校驗器”檢測到一個類文件雖然格式正確,但包含著一些內部不一致性或安全性問題時,拋出該錯誤。從你列出的信息這能看出這些信息具體的你依據提示信息檢查一下你的程序
補充:很可能從1,4 版本以後jdk加強了安全機製或者增進了改善這是jdk的版本問題 沒有什麼好鬱悶的
肯定是jdk版本不一致比如你用1.5的編譯出來,然後去1.4運行就可能出現這樣的問題。1.4編譯出來的,到1.5上運行就不會有這樣的問題
補充:很可能從1,4 版本以後jdk加強了安全機製或者增進了改善這是jdk的版本問題 沒有什麼好鬱悶的
肯定是jdk版本不一致比如你用1.5的編譯出來,然後去1.4運行就可能出現這樣的問題。1.4編譯出來的,到1.5上運行就不會有這樣的問題
在文字的世界裡尋找心靈的共鳴,遠山藍以溫柔的筆觸分享書籍的力量與生活的智慧。無論是細膩的書評、深刻的人生感悟,還是技術與創新的新奇發現,每篇文章都是一次內心的療癒旅程。希望透過閱讀,帶領讀者在忙碌的生活中找到一片寧靜與啟發。讓我們一起,在書香中遇見更好的自己!
訂閱:
文章 (Atom)